Skip to content Skip to sidebar Skip to footer

To Shorten The Url Using Google Api

Hi i am using an example to make a url shorten. But cant able to do that, here's my code package com.tinyurl; import java.io.IOException; import android.app.Activity; import androi

Solution 1:

You have to modify AndroidManifest.xml to grant permission of "android.permission.INTERNET"

Info from: http://android-er.blogspot.com/2011/09/query-and-parse-google-json.html

Solution 2:

This looks a network issue. Use the code given here to access a website using java network api http://www.coderanch.com/t/440335/sockets/java/Access-website-Java-Code This will allow you to track the actual error and once that is fixed you can use any JSON lib to parse the response from server.

Solution 3:

Ah, if you're getting UnknownHostException that means your DNS server is not successfully resolving www.googleapis.com. I'd check to make sure that you actually have a working network connection.

Post a Comment for "To Shorten The Url Using Google Api"