简体   繁体   中英

android emulator cannot connect to internet

I 'm having trouble connecting to internet through android emulator. I did go through other post to check if im missing something but to no avail.

I have the permissions in my manifest file also

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

Following is my logcat

04-04 16:25:41.575: DEBUG/SearchDialog(285): launching Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=com.android.browser/.BrowserActivity (has extras) }
04-04 16:25:41.575 : INFO/SearchDialog(285): Starting (as ourselves) #Intent;action=android.intent.action.SEARCH;launchFlags=0x10000000;component=com.android.browser/.BrowserActivity;S.query=http%3A%2F%2Fyahoo.com;S.user_query=http%3A%2F%2Fyahoo.com;end
04-04 16:25:41.594: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=com.android.browser/.BrowserActivity (has extras) }
04-04 16:26:02.485: ERROR/Tab(285): onReceivedError -2 http://yahoo.com/ The URL could not be found.

I also added -dns-server 8.8.8.8 to my run configuration ...that also didnt work.

I can connect to internet (wifi)when working from home. When at work i cant connect to the LAN(have disabled wifi).

Any suggestions what am i missing.

Are you sure didn't disable the internet connection in the emulator?

From this doc:

Toggle cell networking on/off   F8

On the other hand, did you try creating a new emulator to be sure you didn't create it without internet?

如果您的工作使用代理,则必须配置仿真器以单独处理它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM