Accessing glassfish server from Android, emulator -


i have glassfish running on laptop. how can access real android device or emulator

if want access using httpurlconnection have simply:

        httpurlconnection con = (httpurlconnection) ( new url(url)).openconnection();         con.setrequestmethod("post");         con.setdoinput(true);         con.setdooutput(true);         con.connect(); 

remember if use emulator localhost (127.0.0.1) corresponds 10.0.2.2. once have connection open can read , write using inputstream or outpustream.

if use real device sure glashfish server visible smartphone.


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -