简体   繁体   中英

connect with a android emulator to the localhost webservice [C#]

i have a emulator (from Xamarin Studios, its a android) now i develop a app for this emulator, they must be connect to the web Service (localhost), which i write with C# in Visual Studio. But the emulator dont connect to the localhost and dont can see the site. I want to write a webservice with any functions (connect to database, select, update and so on) and i want that the app can connect to this web service and can be use the function.

i hope someone can help me.

greetz

Your Android emulator's localhost will be the Android emulator itself. You will need to connect to your webservice using the actual IP address of your machine. If you are running your webservices using the VS host, keep in mind that it will not serve to non-local addresses by default.

Host that service in your IIS

then call by HTTP methods with url like

http://localhost(or Ip address)/Urservicename.svc/ServicefunctionName

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM