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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:47:07+00:00 2026-05-27T00:47:07+00:00

What is the appropriate way to implement a location-based Android app that periodically sends

  • 0

What is the appropriate way to implement a location-based Android app that periodically sends its location to a server?

Here is the specific flow I would like to implement:

  1. Main Android app is inactive (i.e., hasn’t been launched)
  2. Based on GPS location of the device, the server may push a message (via C2DM) to the device
  3. Upon receiving the message, a notification should appear in the notification bar (which can then be used to launch the app)

My main confusion stems from point #1: how do I send GPS coordinates to the server if the app has not been launched? Is it simply a matter of implementing a service that periodically sends the phone location to the server? How can I ensure the service is always running once the user has installed the app?

(The Groupon app for Android does something similar, where you intermittently receive notifications of nearby deals even when the app is inactive. Any idea how they may have implemented this?)

  • 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-27T00:47:08+00:00Added an answer on May 27, 2026 at 12:47 am

    I would not use just a Service, Better set an Alarm using AlarmManager each (5 minutes, 15 minutes or what you need) and then get the location. @CommonsWare have done some code thats quite useful ( it deals also with WEAK_LOCKS so if the phone goes sleep everything still run etc..)

    Also, You don’t need to use C2DM because you must send your location to the server and the server response you with the geo-information. C2DM is only for the case that you not start the communication.

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

Sidebar

Related Questions

What is the appropriate way to flip an ExtJs Panel horizontally for RTL languages,
I'm not sure whether or not this is the appropriate way of doing this,
Testing: return request.getCookies() == null; is not an appropriate way test. Is there another
I'm looking for an efficient way to implement a serialization mechanism in C. I
Warm-up I'm trying to come up with a good way to implement customized document
I need to implement a forwarding. I did it the following way: <html> <head>
I am trying - with JSF 2.0 - to implement in a neat way
What is the simplest way to implement a remote FIFO queue as a Python
I have a project here that connects to an in-production database and grabs tables
I'd like to implement a way to display a list of stored addresses sorted

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.