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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -