Android :: To Get Accurate Device Location From GPS Or Network In Android
Mar 11, 2010
I am trying to determine the most accurate location of a device, in the shortest time possible.I am storing the data as a geopoint, and have it displayed on a mapview.The last time I activated the GPS on my device and let it get a location lock, i was approx 80 miles from where I am now.I have a location manager setup and a location listener.If I do this, I get NULL. myLocOverlay = new MyLocationOverlay(this, mapView); GeoPoint test = myLocOverlay.getMyLocation(); but in the next couple of lines; myLocOverlay. enableMyLocation(); mapView.getOverlays().add(myLocOverlay);With this, the overlay on the map shows the current location. It is using the Network provider, but is also attempting to get a GPS fix (it can't as I am indoors and no where near the top floor).If I construct the geopoint like this Short of getting the geopoints from both GPS and Network and then comparing them, and disregarding the GPS result if it is say 1 mile out of the Network location - i'm a bit stuck. why doesn't getMyLocation() work, shouldnt that return the GeoPoint of what myLocOverlay is showing on the mapview?
View 2 Replies
Aug 8, 2010
While using network provider for location updates, I found that it is the same time that I set on my device. Can it not be that provided by network as it goes when it is GPS. Or if network provider cannot provide time , then atleast location.getTime() should return 0 instead of device time. Is there any way to avoid device time, as I want to distinguish it.
View 1 Replies
View Related
Aug 2, 2010
I'm trying to get my current location and show it on a map. Class com.google.android.maps.MyLocationOverlay.MyLocationOverlay does most of the work for you. But it's coming back with a very coarse result that's off by a couple of clicks. I'm listening for onAccuracyChanged() but that never gets called.
How can I get a more accurate location, when using MyLocationOverlay ?
PS. manifest has
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true">
<uses-library android:name="com.google.android.maps" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
View 1 Replies
View Related
May 30, 2010
I'm writing my first location based android app, but got confused about some of the GPS service api. Here are some questions I have:
1) To get my current location, I called requestLocationUpdates() with a listener in the onCreate() method of one activity. But what happens when another activity starts and the current activity goes invisible? Is the GPS location update going to stop? If so, how do I keep it on after the activity is switched?
2) how accurate is the Location.getSpeed()? How is it computed? Can it tell the difference between on bicycle and on foot?
3) not really a question about android. How to calculate the coordinates of a location, say, 100m away from my current location?
4) To stop the GPS, I only need to remove all the listeners that have been registered to locationmanager?
View 2 Replies
View Related
Jan 2, 2010
I recently posted this question on stackoverflow (http://tinyurl.com/ yzrofne), but maybe someone here can help me. I am using the location manager's requestLocationUpdates() method to receive an intent to my broadcast receiver periodically. The system is correctly firing the intent to my broadcast receiver, and I have been able to use it correctly. The only problem is that the GPS location provider only stays active for a few seconds after the initial location acquisition, and I need it to stay on a little longer so that the location estimates are more accurate. For example, if I tell the location manager that I want an update every 5 minutes, it correctly fires the intent with location information from the GPS. However, the GPS only stays active for about 5 seconds, so it doesn't give much time for the location to reach a high accuracy (say, less than 10-20 meters). My question is how to make the GPS location provider stay active for each periodic request that comes from the LocationManager requestLocationUpdates. Does anyone know how to do this?
View 2 Replies
View Related
Sep 19, 2010
What should I have my GPS settings on to get best location? I think I changed them and now it shows me like 10 blocks from where I am?
View 8 Replies
View Related
Jan 2, 2010
I am using the location manager's requestLocationUpdates() method to receive an intent to my broadcast receiver periodically. The system is correctly firing the intent to my receiver, and I have been able to use it correctly. The only problem is that the GPS location provider only stays active for a few seconds after the initial location acquisition, and I need it to stay on a little longer so that the location estimates are more accurate.My question is how to make the GPS location provider stay active for each periodic request that comes from the LocationManager requestLocationUpdates. Does anyone know how to do this?
View 3 Replies
View Related
Jan 27, 2010
I have an application which uses the network as the location provider (rather than GPS eg.), however I can't seem to figure out how to send the emulator test coordinates. In DDMS I would usually send coordinates in the Emulator Control tab.Is there a place to simulate coordinates derived from the cell phone network provider?
View 6 Replies
View Related
Jan 22, 2010
I opened google maps and my location is not accurate at all. I understand that if I turn on gps options it becomes much more accurate, but it's a real battery eater. coming from a 2 year old samsung mysto on Helio network that ran google maps down to the meter for me (and only needed to be recharged every 4 days) it seems like this should work better.Am I missing something? That little mysto couldn't have been running active GPS pinging the whole time. What made it so much better at locating?
View 1 Replies
View Related
Nov 22, 2010
I have used this code
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
500, 50, this);
to get my location using GPS. From what I understood, this code updates the GPS every 500milliseconds until the accuracy is about 50ms. Right? Now how do I know when it has achieved this accuracy? So that I can send the most accurate location in a text message.
View 1 Replies
View Related
Mar 2, 2010
i am implementing gps provider getting langitude and longitude from device i am already get the information in device i can implemented network provider that is the problem how can implemented using network provider
View 1 Replies
View Related
May 3, 2010
I'd like to write a simple widget that toggles GPS and network location on and off. I've read that it's not possible to do that normally, but presumably on a rooted phone it must be doable. Does anyone know what the code would be? (I only need the code to toggle the location providers, I know how to make the widget.) It doesn't matter that this isn't a 'good' solution, I don't plan to distribute the widget. If it matters, this would be on an HTC Hero, still running v1.5.
View 1 Replies
View Related
Jan 19, 2010
how does "location accuracy" use a wifi network?
View 7 Replies
View Related
Mar 16, 2009
I am unable to get the location updates when i use Network location provider. From the older posts i understood that to use NW location provider we need to do the following. code...
View 2 Replies
View Related
Mar 11, 2010
Is it possible to activate the network location provider on the android emulator? Maybe with a fake cell id?
View 1 Replies
View Related
Nov 29, 2012
having problems with my phone not showing the right location in google maps and other apps, this only happens on the mobile network really and in new areas i goto. It always fixes to one location i have never been to,
What files can i change or check for errors ? i have replaced the network location apk in the system/app directory with one that worked on my old phone, should i run and install this apk ?
View 3 Replies
View Related
Aug 27, 2010
My application needs to perform some activities in background (like interacting with the network and check the location and some other stuff), having or not the main activity visible. Which is the best way to achieve this? Should I write a service for each kind of job? Or just one service that performs everything? I am aware that I will need to launch threads / asynctasks in any case because the service runs on the same thread of the UI, but maybe having several services is a more clear and readable structure.
View 7 Replies
View Related
Dec 19, 2009
We see the bigger font for Agree and disagree buttons for the Alert dialog when the network provider is selected in the location settings menu. Any pointers or suggestions which part of the framework code need to take a look. This dialog is controlled by Networklocation.apk which is not open source.
View 3 Replies
View Related
May 29, 2009
I know this has been discussed over and over now but I just got it workign and it works perfectly on the emulator when I mock the location with long and lat however, I am still getting NULL in the location when I run the code on my phone.
here's the main code...
View 15 Replies
View Related
Sep 28, 2010
I developed an application that use the current location. Testing on local I can send the Latitude and Longitude by the DDM5 and I didn't have problem. When I tried to do the same thing on debugging device, didn't work and on DDM5 I can't send this information. Is there any setup to try this ? Here is the code <code> //manifest <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name ="android.permission.ACCESS_COARSE_LOC ATION" /> <uses-permission android:name= "android.permission.ACCESS_FINE_LOCAT ION" /> //view.java -> widget configure private Location location; private LocationManager lm; private LocationListener locationListener; //onCreate lm = (LocationManager) getSystemService (Context.LOCATION_SERVICE) ; locationListener = new MyLocationListener(); lm.request Location Updates (LocationManager.GPS_PROV IDER, 0, 0, locationListener); //action *location.distanceTo private class MyLocationListener implements LocationListener
View 3 Replies
View Related
Mar 31, 2010
I have Samsung Galaxy. I want to find my latitude and longitude programatically. I can get the location on emulator using eclips Emulator Controlbut, but not able to get the latitude and longitude in device. Is there any settings in mobile which I have to do?
View 16 Replies
View Related
May 8, 2010
I have a few questions regarding the usage of localization in android applications: Are there any interfaces available to find out when an application uses location information? Is it possible to know if the application is using coarse or fine grained location information? Is it possible to detect which type of localization is being provided, i.e. gps vs. wifi? And if the answer to any of the above question is yes, how? You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
View 2 Replies
View Related
Jun 7, 2010
I've read this post about mocking location with custom provider, but I am looking for a way to mock the location during a presentation, is that possible?
View 1 Replies
View Related
Jan 11, 2010
I have the problem like this. Basically i want to find my present location's latitude and longitude .It is showing in emulator which is default one which points to Sanjose,usa.But it is not finding my current location(i am in Hyderabad,India).When i try to run the same application in My HTC magic (Android os 1.5) it is showing NULL.It is Not finding my present location. hat i have to do.is there need of Network provider like Mobile network(Vodafone,airtel etc) I am sending my code,Please check it and send me the working code if any body have,Please i need it urgently. Please Help me regarding this.
View 3 Replies
View Related
Jul 16, 2010
my android device supports both wifi and 3g. At particular time which network is available on this device. Because my requirement is when 3g is available I have to upload small amount of data. when wifi is available entire data have to upload. So, I have to check connection is wifi or 3g.
View 2 Replies
View Related
Sep 13, 2010
I am new android development. My new requirement is location details. I need to find, device current location in the form of latitude and longitude.
View 3 Replies
View Related
Oct 1, 2009
I developer a android app. Today I get the HTC hero for testing. I installed the driver and can start the app on the device. The problem is that I need a network connection. I am connect via usb to my desktop computer. Can the device that is on usb connect use my i-net connection to send a request?
View 2 Replies
View Related
Jul 1, 2010
I am developing a context aware mobile application. I need to have information about the capabilities of terminal devices and network characteristics such as current bandwidth. My question is, are there APIs in android to access this information?
View 1 Replies
View Related
Oct 24, 2010
Based on what I've been reading, leaving GPS on won't drain more battery. It's just merely allowing apps to use the GPS.That said, if you have GPS on and have apps that use GPS, you will drain more battery.I want to leave my GPS on for "Where's my Droid." My question is this: how do I make it so that apps (weather widget, etc.) only use network location and not GPS? Is there a way to block all apps except those I choose from using GPS ?
View 7 Replies
View Related
May 15, 2010
It keeps telling me I'm in the town across the river. Maybe according to the network location I am in that town but when I go to maps and it uses GPS it realizes the proper city. The weather app often makes this mistake. I thought when I setup my device it may have asked if I want to use GPS or just network location for something but I can't find that setting anymore. Any ideas on how to get more accurate current location for the weather widget?
View 5 Replies
View Related