HttpConnection | Thales IoT Developer Community
June 7, 2015 - 11:07am, 2738 views
I am trying to create a very simple HttpConnection.
http = (HttpConnection) Connector.open(url);
String url = "http://220.127.116.11/ping/Ping"
But the http.getResponseCode()
throw the exception, as You probadly know "Profile could not be activated"
The String strCommand = "AT^SJNET=\"gprs\",\"internet\",\"\",\"\",\"\",\r"; does not do it
There must be something more...
Can You help?
Br Morten, DK
Found out ->
http = (HttpConnection) Connector.open(url + ";" + connProfile);
String connProfile = "bearer_type=gprs;access_point=internet;username=;password=";
This will do it.
You should be able to use AT^SJNET or pass the parameters to Connector.open() method. Both should work.
If you get "Profile could not be activated" most probably the parameters are incorrect.