database - Trying to verify person specific url then bring up login screen in Android -


i'm trying make application person connects specific website , can access data it. first page asks them put in url. parse , need verify url's existence can move them login screen. how go doing this? i'm trying httpurlconnections i'm not having luck. thoughts?

try below code :

try {  int status = 0; try {     httpurlconnection httpconnection = (httpurlconnection) new url(     "http://www.google.com").openconnection();             httpconnection.setrequestmethod("head");             log.e("statuscode",httpconnection.getresponsecode());              if ((httpconnection.getresponsecode() == 200)||(httpconnection.getresponsecode() == 302)) {                 status = 1;             }          } catch (exception ex) {}         if (status == 1) {             log.e("website","found");         } else {             log.e("website","notfound");         }  } catch (exception ex1) { log.e("error",ex1.getmessage().tostring()); } 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -