I have a
servlet running, working OK with my browser.
The servlet is based on GET requests only.
I created an Android project.
Added to AndroidManifest.xml this: <uses-permission android:name="android.permission.INTERNET" />
Than I found on the net, this type of function:
private static
String accessURL(String inputURL) throws IOException{
String inputLine = "";
try {
URL oracle = new URL(BASE_URL + inputURL);
URLConnection yc = oracle.openConnection();
InputStream iS = yc.getInputStream(); <------------------------------------ Exception here
InputStreamReader iSR = new InputStreamReader(iS);
BufferedReader in = new BufferedReader(iSR);
inputLine = in.readLine();
in.close();
} catch (MalformedURLException e) {
e.printStackTrace();
} finally{
return inputLine;
}
}
Which works fine using regular
Java project, but when I try to use it on my Android project, I get an exception ^ .
I'm trying to use a GET request in order to get a String returned to me.