問題描述
我需要一個或兩個 Android 模擬器中的用戶帳戶,以便我可以測試我的應(yīng)用的一些短信/郵件功能.問題是當(dāng)我嘗試在模擬器中執(zhí)行此操作時:
I need a user account or two in my Android Emulator so that I can test some texting/mailing function of my app. The trouble is that when I try to do this in the emulator:
設(shè)置 --> 帳戶和同步 --> 添加賬戶 --> (my_gmail_account/password) --> 下一步
Settings --> Accounts & sync --> Add account --> (my_gmail_account/password) --> Next
我收到消息設(shè)置無法完成 - 無法打開與服務(wù)器的連接."
我的模擬器運(yùn)行良好能夠通過它的瀏覽器連接到互聯(lián)網(wǎng).所以不知道為什么它不起作用.有人遇到過這個問題嗎?
My emulator works fine & is able to connect to internet through it's browser. So not sure why it is not working. Has anyone run across this problem?
謝謝!
推薦答案
@Varun 的解決方案適合我.有兩件事必須正確配置:模擬器和您的 eclipse 項目.
@Varun's solution works for me. There are two things that must be configured correctly: the emulator and your eclipse project.
要設(shè)置模擬器,您必須創(chuàng)建一個新模擬器.不要選擇 Android 目標(biāo),而是選擇您需要的 Google API 目標(biāo)(此目標(biāo)包括 Android 平臺,但Android"并未出現(xiàn)在其標(biāo)題中).見截圖:
To set up the emulator, you'll have to create a new one. Instead of selecting an Android target, select the Google APIs target that you need (this target includes the Android platform, but "Android" doesn't appear in it's title). See screenshot:
該模擬器現(xiàn)在應(yīng)該可以登錄 gmail 帳戶了.
That emulator should now be able to sign into a gmail account.
要配置您的 Eclipse 項目,請在包資源管理器中右鍵單擊該項目.從下拉菜單中選擇屬性".單擊屬性窗口左側(cè)的Android",然后選擇您為模擬器選擇的相同 Google API 目標(biāo).見截圖:
To configure your eclipse project, right click the project in the package explorer. Select "Properties" from the dropdown menu. Click "Android" on the left of the properties window, and select the same Google APIs target that you selected for your emulator. See screenshot:
您還應(yīng)該確保選擇了正確的模擬器來運(yùn)行項目.為此,請選擇項目屬性窗口左側(cè)的運(yùn)行/調(diào)試設(shè)置".編輯啟動設(shè)置,然后在目標(biāo)"選項卡下選擇適當(dāng)?shù)哪M器 (AVD).
You should also make sure that the correct emulator is selected to run the project. To do this, select "Run/Debug Settings" on the left of the project properties window. Edit the launch settings, and select the appropriate emulator (AVD) under the "Targets" tab.
這對我有用!
這篇關(guān)于Android 模擬器 - 創(chuàng)建用戶帳戶時遇到問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!