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
Related
I have a webservice in c# ,I want to access it via my android device through adhoc , I am able to get it in emulator using 10.0.2.2; but can't see on android device, Kindly suggest me any method to access that.
This is online webservice on w3school i am able to access it via my android device
private final String NAMESPACE = "http://www.w3schools.com/webservices/";
private final String URL = "http://www.w3schools.com/webservices/tempconvert.asmx";
private final String SOAP_ACTION = "http://www.w3schools.com/webservices/CelsiusToFahrenheit";
private final String METHOD_NAME = "CelsiusToFahrenheit";
This is url of my local webservice http://localhost:63693/Notif.asmx
unable to access via android phone , though in emultor it is working
http://10.0.2.2:63693/Notif.asmx
If you are running your webservice on localhost then you can run it in emulator using address http://10.0.2.2:63693/Notif.asmx.
And if you want to run it live on phone then either you have to host your service on some Server.
For accessing localhost service on live phone, the phone and service(machine on which service is being hosted locally) must run on same Private network. You need to then call the Private address of machine from android app. With Private address, I mean IPv4 address of machine.
E.g., http://192.168.1.180:63693/Notif.asmx
You can get IPv4 of machine from ipconfig command in cmd.
If you want to access the website on your device then your PC and your android device should be on same network and same subnet.
Then yourIP:port in address in url you can access your website on your android device
You also need to turn windows feature on . Go to -> Control Panel -> Add or Remove Program -> Turn Windows feature on or off -> .Net framework 4.5 advanced service -> WCF Services -> HTTP Activation . Enable this and Restart ur PC .
Use adhoc on android and connect your machine to it, simply use MachineIP:PortNo/Webservice.asmx
For custom IP - Enable IIS in turn features on or off .Run inetmgr via administrator and add your website there after that right Click edit bindings use IP or hostname whatever you want.
We want to create a http server on wp8 that manages the phone files.After that we want the phone to connect to an external webservice to give the internal IP address that the service is being run at.
1.Can we create a http server on wp8 that can do that?
2.Can we create the external webservice with asp.net mvc web api running on localhost(IIS)?
After getting the IP address we want to generate an url that inserted in a pc browser can establish a connection between the phone and pc. In pc browser page we want to be able to make requests to the http server on wp8 (airdroid like app).
Can this be done, considering the security ,in wp8?
Any documentation on any of these questions is welcomed.
What i found untill now is that a connection between wp8 and pc can be done as this app shows http://wp8webserver.codeplex.com/
I have a c# win app that works with SQL. I want to develop an Android app that sends a query to win app and query result return to Android app. I didn't develop any android app.
1.Is there any way that I connect to my SQL database directly?
2.How send info from android app to PC?
3.How detect android device from win app?
You need to create Web Services and call them from your android app. Please have a look at this link which will give you information on calling webservices in android How to call a RESTful web service from Android?
1.Is there any way that I connect to my SQL database directly?
no there is no way to access SqlServer ... directly , you have to make a webservice to communicate with sql server.
2.How send info from android app to PC?
with that WebService and a url you can call http Post/Get in your Android App and consume the related WebService and send your data to the server and get proper data from server. for implenting such behavior here(StackOverFlow) is huge number of links that you can search for it.
3.How detect android device from win app?
if i get it right you can add google usb driver which is inside Android SDK , then Eclipse/Netbeans or other IDE's can detect your android device.
I have developed a web client and a web service which works fine in my localhost.
The next step for me is to test it in other PC from my network.
I send my IP to my friends lets say: 195.50.12.65. From another pc they can't access my client.
So i try this: "http://195.50.12.65/MyWebServices2/WebApp.aspx" (without the double quotes) and nothing.
Next thing I open a port 80 from my firewall and still nothing any ideas on what to do next?
Note: my client and service are program in C#, using the notepad, asp.net and the IIS, not using Visual Studio (don't ask why, I am just not using it)
I'm developing a mobile application (on visual strudio 2005 sp1) and I get this exception when I try to reach the web service(written on sap). But this is not all.
When I run the app on emulator on computer(connecting internet with cable) it works fine. Also I installed the app to mobile device and no problem BUT only with cradle, I mean only works when it connected to computer with cable of cradle.
Problem starts if the app try to connect web service via wireless connection of our customer's internet.(unplugging from cradle).
I figured out that if I write the WSDL link in IP form, device connects to web service(on wireless)(but not via code, by copying link to text file and clicking to it) but on other form device can't find web service's page. I added the IP of web service to hosts file but problem still exists.
I solved this problem by taking web service address from sap transaction sicf.