2

How to enable the internet connection in android emulator?

I am having the code to display the google map in android emulator.But in my emulator here I am using google device AVD as a emulator and I run the program in my eclipse platform.

How To enable the internet permission in emulator.But I already added in my manifest file for internet permission..internet is not working in emulator to display the map...
Rashmi.B
  • 1,787
  • 2
  • 18
  • 34
  • First check emulator browser, open any site and check internet connection is there? and also check in Manifest that your have added uses-library? – MKJParekh Jan 04 '12 at 06:59
  • 1
    If not added in manifest then add `` and if internet is not there then open avd from cmd like this `D:\SOFTWARE\Android-SDK\android-sdk-2.2>emulator -avd avdname -dns-server 8.8.8.8` – MKJParekh Jan 04 '12 at 07:01
  • Follow this - http://developer.android.com/guide/tutorials/views/hello-mapview.html – Praveenkumar Jan 04 '12 at 07:02
  • ya.my browser is working with internet connection. see.. i am using ubuntu linux.so how to check android emulator whether intenet is working or not –  Jan 04 '12 at 07:03
  • @InfantRajesh: Frankenstein is talking about checking the browser that is present inside your emulator, and not the browser that is in your computer (eg:chrome or default browser that ubuntu provides). To check the browser of your emulator, simply run the emulator without running any projects. Then try opening any website (google for example) from the emulator browser. That's all you've to do to check if the emulator browser is working.. – Ghost Jan 04 '12 at 07:22
  • Not sure what error you are getting, if any, but this post may help if you are....http://stackoverflow.com/questions/6006835/android-mapactivity-couldnt-get-connection-factory-client – electricSunny Jan 04 '12 at 08:40

1 Answers1

3

You are asking three questions in one which is against the policies of Stackoverflow. And all three questions can be answered by mere browsing stackoverflow.

1)how to show Google Map in android emulator device? This might not work since emulator lacks some hardware present in actual device. So its a better option to test in a real device using GPRS or Edge or wifi. Most importantly USE GOOGLE MAP API IN EMULATOR AND NOT DEVICE AVD.

2)How to enable the internet connection in android emulator? Check whether you can use the browser present in emulator.(www.google.com). If not check this link.

3)How To enable the internet permission in emulator?

<uses-permission android:name="android.permission.INTERNET"/>

<uses-library android:name="com.google.android.maps"/> 

Along with this use, ACCESS_FINE_LOCATION,ACCESS_COARSE_LOCATION and ACCESS_NETWORK_STATE in the <uses-permission> tag of your manifest. Check this link for more permission details http://developer.android.com/reference/android/Manifest.permission.html

Community
  • 1
  • 1
Rashmi.B
  • 1,787
  • 2
  • 18
  • 34