相关疑难解决方法(0)

Android模拟器 - 无法创建用户帐户

我的Android模拟器中需要一个或两个用户帐户,以便我可以测试我的应用程序的一些短信/邮寄功能.麻烦的是,当我尝试在模拟器中执行此操作时:

设置 - >帐户和同步 - >添加帐户 - >(my_gmail_account /密码) - >下一步

我收到消息" 安装程序无法完成 - 无法打开与服务器的连接 ".

我的模拟器工作正常,可以通过它的浏览器连接到互联网.所以不确定为什么它不起作用.有人遇到过这个问题吗?

谢谢!

android android-emulator

41
推荐指数
2
解决办法
3万
查看次数

Android GCM注册失败.为什么?

我试图使用GCM在我的应用程序中进行推送通知.我打电话给我GCMRegistrar.register(this, SENDER_ID),但是我收到了一个错误.

我的清单文件:

   <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
            <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
            <category android:name="com.salamworld"/>
        </intent-filter>
    </receiver>
    <service android:name=".GCMIntentService"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<permission android:name="my.package.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
<uses-permission android:name="my.package.permission.C2D_MESSAGE"/>
<uses-sdk android:minSdkVersion="8"/>
Run Code Online (Sandbox Code Playgroud)

这是错误:

DEBUG/GCMBaseIntentService(423):注册错误:ACCOUNT_MISSING

我的GCMIntentService类:

public class GCMIntentService extends GCMBaseIntentService{

    public GCMIntentService() {
        super();
    }

    @Override
    protected void onMessage(Context context, Intent intent) {
    }

    @Override
    protected void onError(Context context, String errorId) {
    }

    @Override
    protected void onRegistered(Context context, String registrationId) {
        Log.d("@R@", registrationId);
    }

    @Override …
Run Code Online (Sandbox Code Playgroud)

java android push-notification google-cloud-messaging

2
推荐指数
1
解决办法
6562
查看次数