Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8255779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:38:28+00:00 2026-06-08T01:38:28+00:00

It does not get registration id from GCM server the app does not give

  • 0

It does not get registration id from GCM server the app does not give any error,this is my logcat.

    07-13 16:43:39.920: I/** pushAndroidActivity **(5310): inside oncreate() 
07-13 16:43:39.920: I/** pushAndroidActivity **(5310): started registration 
07-13 16:43:39.920: D/GCMRegistrar(5310): resetting backoff for com.example.registration_id
07-13 16:43:39.920: V/GCMRegistrar(5310): Registering app com.example.registration_id of senders 803641917196
07-13 16:43:42.735: V/GCMBroadcastReceiver(5310): onReceive: com.google.android.c2dm.intent.REGISTRATION
07-13 16:43:42.735: V/GCMBroadcastReceiver(5310): GCM IntentService class: com.example.registration_id.GCMIntentService
07-13 16:43:42.735: V/GCMBaseIntentService(5310): Acquiring wakelock

This is the main Activity .i have used the existing gcm.jar file to use GCMRegistrar class methods.

package com.example.registration_id;

import android.os.Bundle;
import android.util.Log;
import android.widget.EditText;
import android.app.Activity;

import com.google.android.gcm.GCMRegistrar;

public class MainActivity extends Activity {


    private String TAG = "** pushAndroidActivity **";
    EditText edittext;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Log.i(TAG, "inside oncreate() ");




        //check if registered,if not get registration id from GCM server
        if(GCMRegistrar.getRegistrationId(this).equals(""))
        {
            Log.i(TAG, "started registration ");
            GCMRegistrar.register(this, "803641917206");

        }
        else
        {
        final String regId = GCMRegistrar.getRegistrationId(this);
        Log.i(TAG, "registration id =====  "+regId);

        edittext=(EditText)findViewById(R.id.msg);
        edittext.setText(regId);
        }
    }




}

This is the service class-

package com.example.registration_id;

import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.google.android.gcm.GCMBaseIntentService;

public class GCMIntentService extends GCMBaseIntentService {

    private static final String TAG = "===GCMIntentService===";



    //default constructor
    protected GCMIntentService(String senderId) {
        super(senderId);
        // TODO Auto-generated constructor stub
    }

    @Override
    protected void onError(Context arg0, String arg1) {
        // TODO Auto-generated method stub
        Log.i(TAG, "error ");
    }

    @Override
    protected void onMessage(Context arg0, Intent arg1) {
        // TODO Auto-generated method stub

    }

    @Override
    protected void onRegistered(Context arg0, String registrationId) {
        // TODO Auto-generated method stub
        Log.i(TAG, "Device registered: regId = " + registrationId);

    }

    @Override
    protected void onUnregistered(Context arg0, String arg1) {
        // TODO Auto-generated method stub

    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:38:30+00:00Added an answer on June 8, 2026 at 1:38 am
    onReceive: com.google.android.c2dm.intent.REGISTRATION
    

    onReceiver is being called which means you are getting a message back.

      protected GCMIntentService(String senderId) {
          super(senderId);                }  
    

    This is your problem. you must declare a public, no argument constructor for your GCMBaseIntentService subclass. Otherwise, your GCMIntentService class can’t be constructed and used properly by the background services.

    Why?

    protected GCMIntentService(String senderID){
    super(senderId);}
    

    because this protected constructor isn’t visible to the service class that handles all incoming intents, because it is in a different package.

    Hardcode the senderId in a static constant in your GCMIntentService class because that will no longer change from google.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following error: Client does not support authentication protocol requested by server;
In the following I the get the error IndentationError: unindent does not match any
Why do I get a CS5001: does not have an entry point defined error
I dont get why this simple line of code does not work: <?php $someVariable
Here's the error: The incoming request does not match any route. Basically I upgraded
I have a ListView item in my application. The scroll position does not get
Why does the array a not get initialized by global variable size ? #include<stdio.h>
Silverlight does not provide perfmon counters for GC. How do i get GC Information?
I get a few errors saying: The name 'title' does not exist in it's
I have following code that does not work: I never get to goToFoodDetail .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.