Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- URL url = new URL("http://"+params[0]);
- HttpURLConnection urlc = (HttpURLConnection) url.openConnection();
- urlc.setRequestProperty("User-Agent", "Android Application:"+Z.APP_VERSION);
- urlc.setRequestProperty("Connection", "close");
- urlc.setConnectTimeout(1000 * 30); // mTimeout is in seconds
- urlc.connect();
- if (urlc.getResponseCode() == 200) {
- Main.Log("getResponseCode == 200");
- return new Boolean(true);
- }
- } catch (MalformedURLException e1) {
- e1.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
Add Comment
Please, Sign In to add comment