Is it possible to get the current location of user without using GPS or the internet? I mean with the help of mobile network provider.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
What you are looking to do is get the position using the
LocationManager.NETWORK_PROVIDERinstead ofLocationManager.GPS_PROVIDER. TheNETWORK_PROVIDERwill resolve on the GSM or wifi, which ever available. Obviously with wifi off, GSM will be used. Keep in mind that using the cell network is accurate to basically 500m.http://developer.android.com/guide/topics/location/obtaining-user-location.html has some really great information and sample code.
After you get done with most of the code in
OnCreate(), add this:You could also have your activity implement the
LocationListenerclass and thus implementonLocationChanged()in your activity.