1

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?

Community
  • 1
  • 1
neteinstein
  • 17,529
  • 11
  • 93
  • 123

6 Answers6

1

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/

Gomoku7
  • 1,362
  • 13
  • 31
  • This is interesting. But the ideia is to access the server (internet) without having GSM enabled. Will this do the trick? I don't think so. – neteinstein Jan 19 '12 at 18:06
  • I don't understand your comment. This modification has nothing to do with GSM it's just wifi. Wifi and GSM can coexist independlty. It's normal you don't have internet access when GSM is off because you don't have any connectivity at all since wifi is also off by default. – Gomoku7 Jan 20 '12 at 10:40
  • Yes. But I need to have connectivity WITHOUT GSM. My app needs to access a server.. but i need to test a case where like a Tablet a device only has WiFi and no GSM. Got it? – neteinstein Jan 20 '12 at 10:42
1

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.

Kingamajick
  • 2,281
  • 1
  • 16
  • 19
-1

Maybe these point are trivial, but I would check:

  1. Had you defined the <uses-permission android:name="android.permission.INTERNET"/> inside the <manifest> tag, but outside of the <application> tag?
  2. 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?

Gangnus
  • 24,044
  • 16
  • 90
  • 149
  • Yes of course. The problem is that the emulator uses the "3G" connection to access the internet. Removing that, and without WiFi support that I know of, there is no way to access it.. and that's the problem. – neteinstein Jan 14 '12 at 23:42
  • Sorry. Wish you luck. But if you won't find a solution for emulator, do not be afraid to debug on the external device. I debugged on emulator for a year, now changed to ext. device and feel no difference. – Gangnus Jan 15 '12 at 00:28
  • The problem is.. i don't have any device without GSM support to test on. – neteinstein Jan 15 '12 at 00:40
  • And how will that tablet access the Internet? By Ethernet connection? – Gangnus Jan 15 '12 at 14:14
  • GSM internet connection can be turned on - it is the standard operation on my LG Optimus, for example. And I use it heavily - wifi is free, GSM Internet is for money - so, that turning off surely works. – Gangnus Jan 15 '12 at 20:07
  • we are talking about a tablet emulator. – neteinstein Jan 15 '12 at 20:20
  • I have tried to divide the answer to your question - on the emulator. and the comments - on the possible workaround using extenal devices. – Gangnus Jan 15 '12 at 21:11
-1

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

Jitendra
  • 1,015
  • 9
  • 24
-1

I think you should be able to do that

more here

Vijay
  • 2,021
  • 4
  • 24
  • 33
-1

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.

Community
  • 1
  • 1
Jeet
  • 115
  • 2
  • 13
  • OS: Windows 7 ; Yes i have access to the internet when having wired net, IF I have GSM ENABLED (which I don't, and that the problem). – neteinstein Jan 20 '12 at 14:18