I am trying to login into https://thingspeak.com/login website programmatically. I have written blow android program but its not help me to login. pls tell me what am i doing wrong.
//inside thread function
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("User ID", "****"));
nameValuePairs.add(new BasicNameValuePair("Password", "*****"));
nameValuePairs.add(new BasicNameValuePair("Sign In", "Sign In"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
//after thread function getting called, below line is from oncreate method
WebView webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setAppCacheEnabled(false);
webview.getSettings().setJavaScriptEnabled(true);
WebSettings webSettings = webview.getSettings();
webSettings.setJavaScriptEnabled(true);
webview.loadUrl("https://thingspeak.com/channels/42085");
I am able to load the website but its tells This channel is not public because its not logged in. pls help me out. thanks in advance.
username:niru
password:helloworld@123
The method you are searching for is called HTTP basic authentication. In the case that your target server is using SSL it gets really difficult because you need a certificate.
Such a authentication is working as these steps:
Http request / response header.
Important resource:
How to automate login a website – Java example