Send pre established post with a toggle android widget -
I am using a PII as a web server to enable it to activate and deactivate the relay connected to the light Receives a form post for the bulb. In this way I can turn it on and off from the web browser. I am trying to create a widget in my Android so that the switch can be controlled and shut down and need to send a form post with HP basic authentication.
What would be the easiest way to achieve this? Since I do not have any other android programming skills, I'm looking at several online sites to create simple Android apps, but I do not need to.
This is what I used for simple HTML posting:
String basal = "http://yoursite.com" + yourpostdata; HTTPARPPRMART = new basic HTTPPARM (); // Set the timeout in milliseconds until the connection is established. // The default value is zero, this means that the timeout is not used. Int Timeout Connection = 4000; HttpConnectionParams.setConnectionTimeout (httpParameters, Timeout Connection); // Set the default socket timeout (SO_TIMEOUT) / // in milliseconds which is timeout for data waiting. ////httpClient.setParams(httpParameters); Eight timeout to edit socket = 8000; HttpConnectionParams.setSoTimeout (httpParameters, timeout socket); HTTP Client vClient = New DefaultHttpClient (httpParameters); HttpGet vGet = new HTTG Gate (unprinted); String feedback = ""; {ResponseHandler & lt; String & gt; VHandler = New BasicResponseHandler (); Feedback = vClient.execute (vGet, vHandler); } Hold (exception e) {e.printStackTrace (); }
Comments
Post a Comment