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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:06:35+00:00 2026-06-09T16:06:35+00:00

How can I make the server and a client pair up? I have a

  • 0

How can I make the server and a client pair up?

I have a server which sends messages using Google Cloud Messaging.
I also have a client on Android which has an app ready to receive.

But i need to get the device id from the client and give it to the server. Is there any other way to pair up the devices?

I want to connect multiple devices to the same server, it this possible?

Thanks

  • 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-09T16:06:36+00:00Added an answer on June 9, 2026 at 4:06 pm

    You can send the GCM registration id from device to server using a HTTP call along with a device ID (ANDROID_ID or IMEI).
    Server can persist the mapping between device and its GCM registration id.
    While sending the GCM from server: use GCM regId, server key and project id.

    In your first Activity:

    if (regId.equals(""))
    {
        GCMRegistrar.register(this, Constants.GCM_SENDER_ID);
    }
    else
    {
    // Send "regId" to server (e.g. using http)
    }
    

    In your GCMIntentService class:

    protected void onRegistered(Context arg0, String arg1)
    {
        // Send arg1 to server along with some device Id (e.g. ANDROID_ID or IMEI)
    }
    

    Yes, it is possible to pair different devices with a server. We have paired up few hundred devices with our server.

    Edit:

    Device call following URL from code:
    http://www.example.com/updateGcm?id=&gcmId=

    Server simply saves/updates the mapping in a database table.
    I am afraid I can’t provide exact server side code.
    We are using a PHP server (not using the jar provided for server)

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

Sidebar

Related Questions

I am trying to make a server-client model in which the server can see
I'm currently developing a client/server application in Java and i can't make up my
Does Google cap the number of connections a server can make to Google IMAP
I'm trying to make a server/client program where the client sends the text Hello
I'm programming my first socket lines, and have accomplish to make a client server
I am writing simple client-server program. Client send some messages to server using UDP
I have written a server/client application using sockets in C# for .NET 3.5. I'm
Currently I'm success fully make server and client using TIdTCPServer and TIdTCPClient Indy components,
Project Description: I have to make an application in android which gets the Latitude
I'm writing a client-server solution which is using Java RMI (Via the Cajo project).

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.