Я пытаюсь получить базовые функции, работающие для тестирования с помощью службы Android C2DM. Я последовал примеру источник здесь:C2DM hello world failing, получение ошибки 404 при регистрации
http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html#c2dm
Вот основной вид деятельности, который пытается регистрацию
public class C2DMClientActivity extends Activity {
public final static String AUTH = "authentication";
// Example Activity to trigger a request for a registration ID to the Google
// server
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public void register(View view) {
Log.w("C2DM", "start registration process");
Intent intent = new Intent("com.google.android.c2dm.intent.REGISTER");
intent.putExtra("app",
PendingIntent.getBroadcast(this, 0, new Intent(), 0));
// Sender currently not used
intent.putExtra("sender", "[email protected]");
startService(intent);
}
public void showRegistrationId(View view) {
SharedPreferences prefs = PreferenceManager
.getDefaultSharedPreferences(this);
String string = prefs.getString(AUTH, "n/a");
Toast.makeText(this, string, Toast.LENGTH_LONG).show();
Log.d("C2DM RegId", string);
}
}
Log результат кошка:
01-01 02:13:00.536: E/HttpResponse(670): <html><head>
01-01 02:13:00.536: E/HttpResponse(670): <meta http-equiv="content-type" content="text/html;charset=utf-8">
01-01 02:13:00.536: E/HttpResponse(670): <title>404 Not Found</title>
01-01 02:13:00.536: E/HttpResponse(670): </head>
01-01 02:13:00.536: E/HttpResponse(670): <body text=#000000 bgcolor=#ffffff>
01-01 02:13:00.536: E/HttpResponse(670): <h1>Error: Not Found</h1>
01-01 02:13:00.536: E/HttpResponse(670): <h2>The requested URL <code>/register</code> was not found on this server.</h2>
01-01 02:13:00.536: E/HttpResponse(670): <h2></h2>
01-01 02:13:00.536: E/HttpResponse(670): </body></html>
Is есть ли какая-либо другая информация, которую я могу предоставить? Пожалуйста, дайте мне знать
Покажи мне ваш манифест. В прошлый раз реализация C2DM завершилась неудачно, потому что я определил неправильный пакет в манифесте. – anticafe