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 6168989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:46:56+00:00 2026-05-23T22:46:56+00:00

I have developed push notification system in android using c2dm, It’s working fine but

  • 0

I have developed push notification system in android using c2dm, It’s working fine but I having one problem i-e it works fine with one email only.

  • 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-05-23T22:46:56+00:00Added an answer on May 23, 2026 at 10:46 pm

    It seems that you are under the wrong impression that the Role Email account which is created to identify the application using the C2DM service should be changed in the registration intent.

    You must have that role email the same as the one on the server otherwise Google will not be able to identify your application as sender/receiver of this c2dm message.
    Sample Registration Intent:

        Intent registrationIntent = new Intent(
                C2DMessaging.REQUEST_REGISTRATION_INTENT);
        registrationIntent.setPackage(C2DMessaging.GSF_PACKAGE);
        registrationIntent.putExtra(
                C2DMessaging.EXTRA_APPLICATION_PENDING_INTENT,
                PendingIntent.getBroadcast(context, 0, new Intent(), 0));
        registrationIntent.putExtra(C2DMessaging.EXTRA_SENDER, senderId);
        context.startService(registrationIntent);
    

    The Variable senderId here should hold the role account you created and signed up for C2DM on the google C2DM signup Page

    This same email is used to obtain the Authentication token from google servers which is used to send C2DM messages later

    Sample server code to get an authentication key:

            List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
            nameValuePairs.add(new BasicNameValuePair("Email",
                    senderId));
            nameValuePairs.add(new BasicNameValuePair("Passwd", "testpassword"));
            nameValuePairs.add(new BasicNameValuePair("accountType", "GOOGLE"));
            nameValuePairs.add(new BasicNameValuePair("source",
                    "Fleet Tracker Pro"));
            nameValuePairs.add(new BasicNameValuePair("service", "ac2dm"));
            post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
            HttpResponse response = client.execute(post);
            BufferedReader rd = new BufferedReader(new InputStreamReader(
                    response.getEntity().getContent()));
    
            String line = "";
            while ((line = rd.readLine()) != null) {
                if (line.startsWith("Auth=")) {
                    String auth = line.substring(5);
                    System.out.println("Auth token = " + auth);
                    return auth;
                }
            }
    

    notice the variable senderId this should also hold the role account you created and signed up for C2DM on the google C2DM signup Page
    any other email can be changed to whatever you like, but these to emails have to remain identical

    here is the definition from google C2DM page at google code:

    Sender ID An email account associated with the application’s
    developer. The sender ID is used in the registration process to
    identify a Android application that is permitted to send messages to
    the device. This ID is typically role-based rather than being a
    personal account—- for example, my-app@gmail.com.

    I hope i helped have a nice day.

    would have been nice if you included code snippets or more information about the emails you are talking about.

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

Sidebar

Related Questions

We have developed a website that uses MVC, C#, and jQuery. In one of
I have developed a build system on MSBuild (NET 3.0) and cc.net to perform
I have developed some classes with similar behavior, they all implement the same interface.
I have developed some custom DAO-like classes to meet some very specialized requirements for
We have developed our website(Business users website) in .net Framework 2.0 Our client us
I have developed a VB.NET WCF service that recives and sends back data. When
We have developed a webservice that sits and runs in the context of a
I have developed about 300 Applications which I would like to provide with multi-language
I have developed a framework that is used by several teams in our organisation.
I have developed a couple of extensions for Firefox, and am annoyed that it

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.