C2DMフレームワークをテストしようとしています。数日前に確認メールを受け取った後、登録できるクライアントを作成しようとしました。そのために、このチュートリアルで説明されている手順に従って簡単なクライアントを作成しました:http ://code.google.com/intl/es-419/android/c2dm/index.html 。
Androidマニフェストファイルには、特に次のコードが含まれています。
<permission android:name="com.bilthon.ufrj.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.bilthon.ufrj.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET"/>
<receiver android:name=".C2DMReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.bilthon.ufrj" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.bilthon.ufrj" />
</intent-filter>
</receiver>
そして、プログラムの開始時に起動されるメインアクティビティには、次のコードがあります。
Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); // boilerplate
registrationIntent.putExtra("sender","mytestemail@gmail.com");
Log.d("WelcomeScreen","mytestemail@gmail.com");
startService(registrationIntent);
また、必要だと言われたので、クライアントを実行しているAVDにGoogleアカウントを登録しました。しかし、問題は、放送受信機を「ウェイクアップ」させることができないことです。何が悪いのかわかりません。ログを分析すると、登録インテントが作成され、明らかに正しく使用されていることがわかりますが、レシーバーコードが実行されることはありません。何が問題になっている可能性がありますか?
事前に感謝しますネルソン