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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:51:37+00:00 2026-06-07T20:51:37+00:00

My app should find the current location using GPS , Cellular network or WiFi

  • 0

My app should find the current location using GPS,Cellular network orWiFi.I can easily find out the current location by GPS

LocationManager locationmanager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
LocationListener locationlistener = new mylocationlistener();
locationmanager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationlistener);

where mylocationlistener()function is like below

private class mylocationlistener implements LocationListener {
  @Override
  public void onLocationChanged(Location location) {
      if (location != null) {
      Toast.makeText(LocationActivity.this,"latitude: "+
          location.getLatitude() + "longitude: " + location.getLongitude(),
          Toast.LENGTH_LONG).show();
      }
  }

It is working properly.I can use celluler network to find out the current location by the above code where i need to change locationmanager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationlistener);

it is okey but my challenge is

  1. I need to find the GPS signal strength in order to activate GPS.If GPS signal strength is poor then i can’t activate GPS because it will drain battery.
  2. If GPS signal is poor i have to find out the current location by cellular network or WiFi.

So,my question is that if there any way to determine the GPS signal strength without turning on GPS?
Thank you advance for any kind of help.

  • 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-07T20:51:39+00:00Added an answer on June 7, 2026 at 8:51 pm

    No, you cannot determine the signal strength of a sensor that is not turned on.

    To determine the strength of a signal between a satellite and a GPS unit such as a phone, the two need to send and receive GPS signals, which naturally requires that GPS on the phone be turned on.

    It’s the same logic that says you can’t list the available nearby WiFi networks without turning on WiFi.

    Your best option is to briefly turn it on, then turn it off if you decide not to use it.

    The easiest way to determine whether or not to use GPS would be to turn it on, then use the LocationManager’s getBestProvider method. If the best provider is NOT GPS, then turn it off again. You can also use the getGpsStatus method to get a GpsStatus object with metrics such as max number of satellites and the time it took to to receive a fix.

    See Enable GPS programatically like Tasker for how to enable/disable GPS. Sadly, you can only programmatically do so on pre-2.3 phones, and then only through an exploit. The “correct” way is to prompt the user to enable or disable it.

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

Sidebar

Related Questions

I'm trying to figure out how my new app should handle data. In previous
So I'm working on this site web app that should let users easily chat
I am writing an app that requires the user's current location (lastknownlocation won't be
I have recently been advised that for my current rails app relationships I should
In my current iOS app, I need to perform several network operation when the
I am using: datetime.now() to get the current time in an Event app that
In the Apple documentation you can find the following sentence : An application should
My app should render html, to answer when a user clicks ajax-link. My controller:
I have some data (Student info), and my app should be able to read
within my App it should be forbidden to edit (customize) the TabBar. This means

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.