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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:05:21+00:00 2026-05-26T15:05:21+00:00

I’m currently in the process of developing an app which has some very demanding

  • 0

I’m currently in the process of developing an app which has some very demanding needs.

The Project

An application which can communicate with a server is needed.
Small messages has to be send to the app which could display a notification or start an activity.

The Demands

Client needs to be sure that the phone is ‘connected’ at all times.

The client expects that the app can tell when it’s no longer connected (or able to connect) to the server it tells the user.

Client needs to be able to send a message to individual devices

If the client needs to broadcast a message to the connected devices and to the individual devices.

My thougts (or problems)

Currently, the app is polling the server with a http request once a minute – if the app isn’t able to connect to the server the user gets notified. The polling is able to tell which device is calling and telling it if it has a message for it.

But…

IMO this is a terrible design – it generates a lot of excess traffic, uses resources which probably wasn’t necessary and it offers a lot of issues with connectivity (which I’m not sure I’ll ever get past no matter which method is used).

I need your experience to select the right solution for my project.

I’ve been thinking of C2DM, but I’m not sure this could cover my needs?
Is polling for my only real solution?
Is there a third option I haven’t thought about?

  • 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-26T15:05:22+00:00Added an answer on May 26, 2026 at 3:05 pm

    I’d consider MQTT as a good solution, although it is what I’m most familiar with. Disclaimer – I write an Open Source MQTT broker. You could achieve what I think you want like this:

    Have an MQTT broker running somewhere. The service on the phone connects to the broker and subscribe to a unique topic, e.g. device/23412364, where 23412364 is the per device unique id and referred to as <phone id> below. When your client wants to send a message to a specific phone, the message goes to device/<phone id>. If you want messages to go to all phones, then the phones could also subscribe to device/all for example.

    If you make your subscriptions and messages have Quality of Service of 1 or 2 and set the “clean session” option for the clients to false, then messages will be queued up on the broker if the phone disconnects for whatever reason. QoS=1 means “at least once” and QoS=2 means “exactly once”. When the phone reconnects, those messages will be delivered.

    You could also have the phone send a message like “register <phone id>” to a fixed topic just after it connected (topic of “register” for example). A feature of MQTT that is very useful is the “Last Will and Testament”. When you connect a client, you have the option of specifying a Will message and the topic that it should be delivered on, in the case that the client disconnects unexpectedly (ie. without telling the broker that it is going to disconnect). So you could set the will message to be “unregister <phone id>” and to be delivered to the same fixed topic as above (“register” in this example). You could then have another MQTT client at the server end sitting subscribed to “register”. When a phone connects, it sends a “register <phone id>” message, when it gets disconnected the broker sends “unregister <phone id>”. The MQTT client can therefore keep track of the connected clients at the server side.

    At the phone end of things, you can get notified if the TCP connection goes down through normal network code.

    Some relevant links:

    • Using MQTT in Android mobile applications: http://dalelane.co.uk/blog/?p=1599
    • Trivial MQTT Android project based on above: http://mosquitto.org/2011/11/android-mqtt-example-project/
    • MQTT Power Profiling: http://stephendnicholas.com/archives/219
    • MQTT features: http://mosquitto.org/man/mqtt-7.html
    • Facebook using MQTT: http://www.facebook.com/notes/facebook-engineering/building-facebook-messenger/10150259350998920
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has

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.