Android emulator Internet connection in my application - android

I have a problem with my android emulator on my mac. I can use the browser and load websites so there is an internet connection in my AVD.
My application can't connect to the internet, I am aware of the manifest configuration and I have set the internet permission on.
<uses-permission android:name="android.permission.INTERNET" />
The application works well on several devices but never worked on the emulator.
What am I doing wrong?
Thanks,
Omri.

Preferrences->Launch settings to Default emulator options: -dns-server
and use https on url.

I solved my problem, James Elsey's question turend me in the right direction.
I was trying to reach my own server with a ssl certificate. For some reason the emulator doesn't like my rapidsssl certificate and the connection is timedout. It does work on android devices though.
Because the emulator is only for developing I can change the configuration and work with http only without ssl.
Thanks everyone.

Related

Network Connectivity Error In Android Emulator

I know that there are several threads posted about this issue, however I believe my problem to be a bit different:
I have installed Android emulator on my desktop.
When i try to browse internet via the emulator, it works perfect.
But the problem is the apps that i have installed in the emulator are not able to access the internet
i installed whatsapp successfully, the registration screen loads properly, then i entered my mobile number and pressed OK button. I keep getting the following error
Unable to connect. Please check that you are connected to the internet
and try again. Please reboot your phone if your connection problem
persists.
Its very annoying that i have been Googleing the error for weeks now and still havent reached a solution to the problem
I tried bluestacks .. i also reinstalled it as well as emulator several times... it did not help...
1000 thanks to person that helps me solve this issue..:D
Re install emulator
Delete and create the emulator again
Check whether machine is connected to online
Check Android manifest to see whether application has access to internet
These are some common issues.
From this answer:
<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
inside your AndroidManifest.xml
Add 8.8.8.8
on a Mac: System Preferences > Network > DNS
(or equivalent for Windows)
As described here: Android emulator not able to access the internet
I have installed youwave on my laptop at home and downloaded whatsapp, then registered in whatsapp. It worked perfectly without any problem.
Then I tried the same at office and it did not work. But can access the internet thru the browser. I believe that the reason is that at office I'm behind a proxy and not sure if whatsapp uses certain protocols not allowed by office proxy.
ok... i have the same problem.
but i know, what is the best solution till now for bluestacks connection problem.
you have to install proxycap software.
make new proxy rules for bluestacks.
in c/program*86/bluestacks/HD-network.exe
this is the file that you have to make rule for.
whatsapp will work and other apps too.
but still u can't download data using bluestacks.
but yes if you have bluetooth then there is no problem. connect ur phone having internet connection.
and your rule's proxy will allow you to download data. the good thing is that 95% data is downloaded through your wired network(LAN). bluetooth connection of phone just helps you to maintain the server side connected...and now go to google store or wtever u want to download. you are good to go.
and just activate a small data pack on your phone.... thanxx.. hope that would help
one solution can be to disable the gps, just go to advance conf. then to location and turn that off. that worked for me at least.

Setting proxy to Android Emulator

I'm having a problem to surf internet on my Emulator, wich is targeting Google API8.I followed all the instructions I have read, setting the proxy in MobileNetworks-->APN--->....,etc, and doesn`t work. If I remove the proxy, the browser navigates locally, and if I have the proxy configured it doesn't even navigate locally.
I tested the same coonfiguration on an emulator targeting API16 and did work!!!!(local and on the Internet), so please how can I solve this.Any help will be appreciated.
PD: I tested using -dns-server x.x.x.x too and happens the same.
Emulator uses the internet connection from the host computer where it's installed.
If the host computer doesn't need any special configuration to access internet (proxy, etc.), then your emulator doesn't need it either.
Only if your computer needs a proxy configuration (or other), you will need to replicate it in the emulator.
Regards.

Not able to connect secure sites ("https:") from android emulator

I am working on a android application, which is accessing a secured (https://) web service for some data. But I am facing some problem while testing the application in AVD emulator. The problem is that I am not been able to access the "https:" site neither from my application nor from the emulator browser. While I am trying to connect the site (in fact any secured website ) from the browser it's showing the error message as "Data connectivity problem.
A secure connection could not be established.". Though I can access the same websites from my window's web browsers.
According to my analysis the problem is with the privilege setting of the emulator. I am running the application on a corporate (my office) machine, where I don't have the admin rights (but I am a power user) and the machine is also behind the proxy. But as mentioned before I can access those secure sites from the machine's browsers, the only problem seems to be with the emulator accessibility.
I tried to test the same code from my personal laptop and as expected it's working perfectly.
Can somebody please help me out to find out the solution for this? How can I access a secured site from the emulator? FYI I am using eclipse Helios & Android 2.1
Please let me know if you need any more information from my side.

How to access the internet with an Emulator simulating Android Tablet without GSM

I'm trying to test an application that has on the Manifest:
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.CALL_PHONE" />
This was done to support Tablets without GSM capabilities.
The problem is... I don't have a physical device to test, and I need to access the internet from the app. Whenever I create a emulator without GSM support... I cannot access the internet.
Does anybody have a clue on how to access the internet from the Android emulator when it doesn't have GSM support?
The documentation that I read said that there is no WiFi support on the emulator, so.. is there anyway to use another thing?
UPDATE:
This question might help others with the same problem: How to disable/enable network, switch to Wifi in Android emulator?
Have you looked at the Android-x86 project, it has wi-fi support so it will be able to do what you need. This screenshot shows wifi working.
I know it isn't exactly what your looking for, but as far as I'm aware you're correct in thinking that wi-fi support is not possible on the default emulator.
The wifi initialization on emulator must be modified to do what you want.
The idea is to trick to emulator wifi initialization phase and provide it a handmade list of wifi networks. For debugging purposes, I guess it's ok...
Someone did that here (code sample included) :
http://kmansoft.com/2010/07/27/debugging-wifi-in-the-emulator/
Maybe these point are trivial, but I would check:
Had you defined the <uses-permission
android:name="android.permission.INTERNET"/> inside the
<manifest> tag, but outside of the <application> tag?
Don't forget, that what you put in manifest, describes your
application, not emulator. (your question makes me think that you
have an error in understanding it)
Edit: Ok, now I see.
Is there only one emulator out there? What about using different IDE with different emulator?
If you want to access internet on your emulator then. Please have a look on this. It should be help for you.
First thing you have to set adb path(i.e. plateform tools and tools)
then fire the following command on command prompt.
syntax:
emulator.exe -avd avd_name -scale scale_size -dns-server 8.8.8.8
exa.
emulator.exe -avd avd2.2 -scale 0.7 -dns-server 8.8.8.8
I think you should be able to do that
more here
1) In which OS u r working?
2) U can access internet in emulator if ur system have wired net connection.
I am using
Environment/Platform : Linux/Eclipse, Android SDK
By adding in the manifest.
with wired connection.
Read this post :1) How to set Internet options for Android emulator?
2) http://code.google.com/p/0xdroid/issues/detail?id=3
3) http://i-miss-erin.blogspot.com/2009/09/android-emulator-external-gsm-modem.html
Although it may be not use-full for u as u r using it Without GSm enabled, I tested those condition in a e-pad, got the net connection from wifi.

emulator throwing hostunresolved exception in android?

i have as my first activity in my application a request to a certain address, from where i get XML and then i parse it...
I have added the permission on for internet access in my android.manifest file.
my problem
whenever i run my application on my emulator the following exception is thrown:
05-19 18:25:05.099: WARN/System.err(473): java.net.UnknownHostException: Host is unresolved: www.svgverlag.de:80
i don't understand what is going wrong.
when i open the same address in my browser it opens up fine
i have tried restarting the emulator several times.
i am using a mac.
thank you in advance.
EDIT:
i have tried creating several emulators and in all of them this is happening.Also i tried on my friends macbook pro, and the same thing is happening.
Also in the emulator's browser no webpage is opening.For some reason the emulator is not able to access the internet.
UPDATE
I believe that there is a problem with the emulator on mac per se. No matter what i try:
set the dns in Eclipse Preferences using dns-server- 8.8.8.8
turn of my firewall
nothing seems to make a difference and my emulator is not able to access the internet.
Also there is a 3G symbol at the top of my emulator but with no help regarding internet access.
While on a my windows machine, things seem to work fine without any settings from my side.
what do i do?
Can you try using the IP address of this website instead of using its host name?

Categories

Resources