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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:09:17+00:00 2026-06-01T20:09:17+00:00

I am writing an android app where a user will geolocate using coarse location

  • 0

I am writing an android app where a user will geolocate using coarse location using Network Location. I want the user to be able to save a location at a particular time into a db (savedLocation), and then if the user returns to savedLocation, (or within a coarse range of that location since i’m suing network location) I want to fire to a broadcast receiver. I know fine and well how to save the user’s location to the db, and to compare it with the current location, etc etc.

However, given that the network location is a relatively inaccurate method for determining location, what would be a good approach for determining when the user approaches within distance X of that savedLocation.

  • 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-01T20:09:18+00:00Added an answer on June 1, 2026 at 8:09 pm

    What understand from your question is that you are tracking the user’s location and saving that locations to the database. Now you want to prompt user when user reach to the previous location but there should be a specific region. If this is then you can use the below code to know the region of the user from latitude and longitude.

    String latitude1, latitude2, longitude1, longitude2;
    //Now Suppose you have some values in this variables. 
    //In your case latitude1 and longitude1 is from database and latitude2 and longitude2 is from current Location.
    float radius = 500; //Distance in meters
    
    Location location1 = new Location("GPS");
    location1.setLatitude(latitude1);
    location1.setLongitude(longitude1);
    
    Location location2 = new Location("GPS");
    location2.setLatitude(latitude2);
    location2.setLongitude(longitude2);
    
    Float distance = location1.distanceTo(location2);
    distance = Math.abs(distance);
    
    //Here you can compare two distances 1. distance and 2. radius
    if(distance <= radius) {
    //Use is in a 500 meters radius. You can notify user by notification
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an android app using the GPS location provider in a Service
I'm writing an Android app, which uses location services. I want to detrmine the
I am writing an android app. I want to pass some data across the
I'm writing a small android app that lets the user pick a date and
I'm looking at writing an app which will use text present on a user's
I am writing an app that will be downloading user's documents from a remote
Background I am writing an Android app whose main function is tracking the user's
I'm writing simple Android app to filter some events from user's calendar. The questions
I'm writing an android app that will connect to a REST/JSON webservice. Users will
I am writing an Android app which can take pictures and save them on

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.