I am total noob at Android dev. I am still learning, and I am on very first step of my app dev.
I have this code working and it runs fine or regular Java, now I am trying to implement to Android OS.
In my code where it says TEST.openStream() I get Unhandled exception type IOException error.
package com.zv.android;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import android.app.Activity;
import android.os.Bundle;
public class ZipActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
URL TEST = new URL("http://www.google.com/");
BufferedReader in = new BufferedReader(new InputStreamReader(TEST.openStream()));
String inputLine;
int line=0;
while ((inputLine = in.readLine()) != null){
line++;
//System.out.println(line + "\t" + inputLine);
}
// in.close();
} catch(MalformedURLException e) {
//Do something with the exception.
}
}
}