Friday, April 18, 2014

android software can be connected in the simulator, the server can not connect the phone


I use struts2 + json + android,
 HttpResponse response = httpclient.execute (post); 
In this machine simulator time, it can connect to the back-office services, But we would not run on the phone.
Find some relevant information in the activity also added
 StrictMode.setThreadPolicy (new StrictMode.ThreadPolicy.Builder () 
. DetectDiskReads ()
. DetectDiskWrites ()
. DetectNetwork () / / or. DetectAll () for all detectable problems
. PenaltyLog ()
. Build ());
StrictMode.setVmPolicy (new StrictMode.VmPolicy.Builder ()
. DetectLeakedSqlLiteObjects ()
. PenaltyLog ()
. PenaltyDeath ()
. Build ());

Still can not connect, for help!
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Great God, do you solve this problem, the server's ip how to set, I also tangled ah.

No comments:

Post a Comment