I'm using JDeveloper 184.108.40.206. I created a mobile application by which i can access a table from the database. I did this by creating a web service from data controls. I deployed the application to the android emulator. Everything works great and i'm able to query the table using a simple view criteria. I know that in order to be able to connect to the database, i have to change the url in the connections.xml file from
Everything works great after changing to 10.0.2.2. However, this is working only in the emulator environment. Whenever i try deploying to the device i'm getting:
Cannot connect to 10.0.2.2 on port 7101:java.net.ConnectException: Connection timed out.
I read that i should also change the port to 8080. But still it's not working.
I tried entering the URL in the browser of the device to check if its working, but it wasn't!
Any one has an idea about this?
For the Android Emulator 10.0.2.2 refers to the PC underwhich you're running the emulator. As such the IP address 10.0.2.2 is only useful for when running apps on the emulator.
When you've deployed the app to a real device, and you want the app running on the device to access the web service running on your PC, the Android device must be connected to your local network, and you must deploy the app with the IP address of your local PC for the webservice (in the connections.xml file of your JDev app). Simply being connected via USB is not enough.
So the link should be:
I tried that! It didn't work. I got java.net.ConnectException: Connection timed out.
I also tried:
but still nothing. With this i get the same Exception.
I have connectivity to the local network! I tried accessing a local webpage and it's working fine! But i just can't seem to be able to run the service on the device!
You seem to keep on referring back to the emulator. But your original issue was accessing the web service from a real Android device correct? So 10.0.2.2 wont help you here as that hardcoded 10.0.2.2 is a "hack" the emulator puts in place for you.
So returning to the Android device, if you can't access the following URL from Chrome on Android:
...then it wont work for ADF Mobile either, because your device can't see that address at all. You need to resolve why your Android device can't access that IP address and URL.
Not from the ADF Mobile side. You need to resolve the Android issue first as it simply can't get to the required URL. I know you said you could access a simple web page from your PC on your Android device, so this would suggest maybe it's a port issue but I don't have any more suggestions to give.