Click here to Skip to main content
15,878,996 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have created a simple webservice on visual studio that adds two numbers and now I want to consume it on my android emulator (using android studio) so can I do that or do I need to host the service first.? If it is possible plz tell me how... step by step tutorial would be helpful.
Posted
Updated 3-Mar-15 15:03pm
v2
Comments
Sergey Alexandrovich Kryukov 3-Mar-15 10:46am    
What does it mean, "un hosted web service"? There is no such thing as ".net service on visual studio". Visual Studio is just the IDE. Maybe you need to have self-hosted service? something else?
—SA
[no name] 3-Mar-15 12:13pm    
Yes I know that... what im trying to ask that can I consume it on my android emulator without hosting it?
Sergey Alexandrovich Kryukov 3-Mar-15 12:16pm    
You either have a service running or not. I have no idea what "without hosting" might mean. How do you think, can you consume it if it is not running? If it is running, even under VS, it does not matter how it is hosted, but you should have access to the IP in question. What could make a problem here?
—SA
[no name] 3-Mar-15 21:08pm    
Yes it is only running under VS. That is the problem how will data be transferred if it is only under VS and not online?
but still if it is possible plz tell me how?

1 solution

To call methods (consume) in ANY web service you have to fulfill two preconditions:
1. Must have a web server that your web services defined inside it as a site
2. You must have a network connection to that web service
So if you want to use the web service form any Android device, you definitely must host in on a publicly accessible web service, however if it is for test purposes it is enough to link your Android device to the same network as the web service...
 
Share this answer
 
Comments
[no name] 3-Mar-15 23:32pm    
can you please explain how do I link my android device on the same network as my web service?
Kornfeld Eliyahu Peter 4-Mar-15 0:15am    
Use WiFi settings - it should automatically find the network and than all you need is some credentials...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900