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

  • SEARCH
  • Home
  • 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 9099711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:41:18+00:00 2026-06-17T00:41:18+00:00

Per a Google Cloud Messaging For Android (GCM) Simple Tutorial , I have created

  • 0

Per a Google Cloud Messaging For Android (GCM) Simple Tutorial, I have created an android application for push notification using GCM services. Now I successfully get the notification in a device or emulator but problem is that I am getting only in one device (device used for testing purpose), not in other application installed devices.

final String regId = GCMRegistrar.getRegistrationId(this);

Using this code I am getting the registration id, the output I have copied from logcat window and send manually to my .Net developer. He copied that id in server side and thus for that device I am getting the notification. Please help me to send that registration id dynamically to the server side(Asp.net server). So that he can store those ids in database and pass array of registration ids to Google GCM Server. I think then only we can get notification for all devices(installed application). Because now in the server side, we are passing the data to GCM server in this way:

string postData = "collapse_key=score_update&time_to_live=108&delay_while_idle=1&data.message=" + value + "&data.time=" + System.DateTime.Now.ToString() + "&registration_id=" + deviceIDs + "";

Please correct me if my procedure is going wrong somewhere.

  • 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-17T00:41:19+00:00Added an answer on June 17, 2026 at 12:41 am

    Basically what you’ll want to do is open a data connection to your web server and send your gcmid to it with some other identifying factor of the phone (such as a userid or the phone id) you’ll want to do this in your OnRegistered Method of the GCMIntentService class. I send a Form Post request to the webserver. On the webserver you will probably want to store the information in a database.
    I use a multidimensional array for my form variables

    public String formPost(String[][] Vars) {
    
        String url = "put url of web server here";
        HttpClient httpclient = new DefaultHttpClient();
        HttpPost httppost = new HttpPost(url);
        String tmp = null;
        String rturn = null;
        try {
            List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
            for (int i = 0; i < Vars.length; i++) {
                nameValuePairs.add(new BasicNameValuePair(Vars[i][0], Vars[i][1]));
            }
            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
            HttpResponse response = httpclient.execute(httppost);
            String ttmp = parseISToString(response.getEntity().getContent());
            Log.i("test", ttmp);
            if (ttmp.contains("Success")) {
                rturn = ttmp;
                Log.i("test", "Success:" + ttmp);
            } else {
                rturn = ttmp;
                Log.i("test", "Fail:" + ttmp);
            }
    
        } catch (ClientProtocolException e) {
    
        } catch (IOException e) {
        } /*
         * catch (RuntimeException e){ Context context =
         * getApplicationContext(); CharSequence text =
         * "There was an error try again later."; int duration =
         * Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, text,
         * duration);toast.show(); Log.i("test",e.getMessage()); finish(); }
         */
        return rturn;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Per the answer here: Upload images/video to google cloud storage using Google App Engine
Using Visual Studio 2005 As per the title; MSDN and google can't tell me,
I have built a service with ServiceStack (customer example) as per this link: https://docs.google.com/present/view?id=dg3mcfb_213gsvvmmfk
I have been using the Google Websearch API for over 1 year now. The
As per google places API documentation, no authentication is required for using the API.
While looking through the pricing of some cloud computing hosting services like Google App
Using Maps API v3. As per Google documentation, if the map container is resized
It is well know to people using Google Maps in an Android app that
As per the Google design patterns I have been implementing the dashboard layout by
I have registered my web application for use with oath2 using the following instructions:

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.