user1746708
user1746708

Reputation: 691

Calling a web service from android locally

I've built a web-service which i call from my android application.My problem is that when i want to connnect my mobile with my laptop and call this service locally without using internet.(Provided that my server runs locally) how can i do that?I know that there is a shell property when running the avd but how can achieve this when i run it from a tablet which is in the same lan with my server?Thank you for your time.

Upvotes: 1

Views: 2446

Answers (2)

user756706
user756706

Reputation:

How your phone and your laptop connected ? To use web service running in your laptop you need to run both in same network, for example your need wifi router which connect your laptop and mobile in network. when you connect your laptop with wifi router using cable or wifi , router will assign one ip to your laptop, you can use that Ip in your mobile application to access web service,

In Short: need network between your phone and laptop

Upvotes: 1

Alpay
Alpay

Reputation: 1368

When you want to call a web service using Internet, you use the external ip and port of the server. But if you want to call your web service locally (without the use of Internet), you need to use the internal ip of your server. You can see your internal ip from Windows command ipconfig or linux command ifconfig

Upvotes: 2

Related Questions