Discussion Forums  >  Uncategorized

Replies: 15    Views: 582

luzifer666
Lost but trying
Profile
Posts: 26
Reg: Mar 04, 2011
España
260
03/23/11 01:13 PM (14 years ago)

Driving directions cannot be determined because your device is not reporting it`s location

I still do not run my application. No where is the error for more than try. No GPS located my position where I am. The phone's GPS icon is activated when the application starts, but when I enter the map location (single location map or multiple location map), the icon turns off GPS in my phone. The error is: Driving directions cannot be determined because your device is not reporting it`s location If you need any further information ... Any help please? I'm desperate. Thanks (sorry for my english)
 
luzifer666
Lost but trying
Profile
Posts: 26
Reg: Mar 04, 2011
España
260
like
03/23/11 01:17 PM (14 years ago)
Android 1.6
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/23/11 09:23 PM (14 years ago)
The GPS is suppossed to turn off after it finds the location. Or, it turns off if it cannot find the location. Either way, the behavior you describe (the GPS turns off) is expected. Why it cannot determine your location is unknown and not something we'll be able to help you with? If your device isn't able to save the location information you'll need to do some digging in the code to find out why. Start by looking at Act_ActivityBase.java, find the getLastLocation() method. That is were ALL the location processing is done.
 
luzifer666
Lost but trying
Profile
Posts: 26
Reg: Mar 04, 2011
España
260
like
03/24/11 01:57 AM (14 years ago)
Hello I found, but it is very difficult to understand for me. Could activate the GPS but not always save battery? As a first step would be important. The strange thing is that the first time I compiled the application if it worked perfectly, and without making major changes now does not work. Uffff, killing me
 
luzifer666
Lost but trying
Profile
Posts: 26
Reg: Mar 04, 2011
España
260
like
03/24/11 02:00 PM (14 years ago)
The only changes I make is what comes in the README.TXT. They are the only changes I make in eclipse. AndroidManifest.xml edit the file, removing the symbols <-- and -> Act_ActivityBase.java edit the file, removing the symbols / * and * / Edit the file res / layout / screen_locationmap.xml by @ string / googleMapsAPIKeyRelease String.xml edit the file by entering key API release. Do not change anything else, so my confusion, it should work without problems. A greeting for the work you do. Thanks
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
05/20/11 03:34 PM (14 years ago)
Im having this problem as well on Android. iPhone works perfect. Any ideas on what I should look for? b
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/23/11 03:54 AM (14 years ago)
Anyone look at Act_ActivityBase.java, find the getLastLocation() method. That is were ALL the location processing is done. There should be a few trace-statements in there to print some info to the log.
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
05/23/11 04:02 PM (14 years ago)
If I had to rename my project (because of screwing up the upload to Market) to com.v1_4.B5F64A6950B99593.com2 would that screw this part up?
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
05/23/11 04:40 PM (14 years ago)
This stuff? public void getLastLocation(){ try{ //only ask for location info once when app launches (saves battery) if(appDelegate.foundUpdatedLocation == 0){ locationUpdateCount = 0; if(this.locationManager == null){ this.locationUpdateCount = 0; this.locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); } if(this.locationManager != null){ Location lastLocation = this.locationManager.getLastKnownLocation(gps); if(lastLocation != null){ //remember in delegate appDelegate.currentDevice.deviceLatitude = String.valueOf(lastLocation.getLatitude()); appDelegate.currentDevice.deviceLongitude = String.valueOf(lastLocation.getLongitude()); appDelegate.currentDevice.deviceAccuracy = String.valueOf(lastLocation.getAccuracy()); String s = ; s += -Last Location Time: + lastLocation.getTime(); s += Last Location Latitude: + lastLocation.getLatitude(); s += Last Location Longitude: + lastLocation.getLongitude(); s += Last Location Accuracy: + lastLocation.getAccuracy(); //Log.i(ZZ, s); } //start listening for location updates if we have GPS enabled... if(this.locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){ startListening(); }else{ Log.i(ZZ, thisActivityName + :getLastLocation: GPS not available); } } } }catch (Exception je){ Log.i(ZZ, thisActivityName + :getLastLocation: ERROR: + je.getMessage()); } } //LocationListener must implement these methods public void onProviderDisabled(String theProvider){}; public void onProviderEnabled(String theProvider){}; public void onLocationChanged(Location location){ this.locationUpdateCount++; //Log.i(ZZ, thisActivityName + :onLocationChanged); //remember in delegate appDelegate.currentDevice.deviceLatitude = String.valueOf(location.getLatitude()); appDelegate.currentDevice.deviceLongitude = String.valueOf(location.getLongitude()); appDelegate.currentDevice.deviceAccuracy = String.valueOf(location.getAccuracy()); String s = ; s += -Updated Location Time: + location.getTime(); s += Updated Location Latitude: + location.getLatitude(); s += Updated Location Longitude: + location.getLongitude(); s += Updated Location Accuracy: + location.getAccuracy(); //Log.i(ZZ, s); //stop listening to save battery if... //we have been listenign for about 5 seconds //accurate up to 30 meters.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/24/11 01:01 AM (14 years ago)
This stuff - too funny. Made me laugh. So.. yes, this is the method. Everywhere it says 'Log' can be uncommented. When you uncomment these lines (the ones that log the output) open the console and see the output to see if the location is being reported.
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
06/01/11 05:29 PM (14 years ago)
How do you uncomment? Remove the forward slashes? Does anyone know someone I could hire to troubleshoot this? I just don't know how and between working on this, creating a new app and trying to make cash to live on I can't be spending days trying to figure it all out. Thanks, b
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
06/01/11 05:55 PM (14 years ago)
I don't know what is going on but now the maps work on my phone (it didn't last week). I'm still getting the error on the emulator???? How is this possible? I haven't changed a thing. Bruce
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/03/11 12:29 AM (14 years ago)
I'll believe you for fun ;-) Emulator maps almost never work like expected, wouldn't worry too much about the emulator, not much you can do about it.
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
06/08/11 01:57 PM (14 years ago)
Buzztouch guys, I hope you don't mind this post just thought I may be able to help a fellow Apper. @luzifer666 Did you ever fix? May be an obvious question but... Are you inside a building when testing this? I have used GPS successfully in a few apps now. Try downloading a GPS testing app (GPS Status&Tools) from the market to confirm your device is reporting location. Go outside turn on GPS and run the GPS Status app, make sure it shows your lat and long, then you know device is working. Also be aware some devices have GPS problems due to OS updates so verify your device is reporting correctly. I had a lot of trouble with GPS on my HTC Desire for a while until going through some reboots without sim and sd etc.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/08/11 10:48 PM (14 years ago)
@ appsolutely: Mind? Of course not, we rely on generous offers to help! Thanks tons for the support.
 
Warren Evans
Apple Fan
Profile
Posts: 277
Reg: Jan 28, 2012
Effingham IL
17,400
like
02/11/12 07:24 PM (14 years ago)
Hi everyone - I'm new to this forum and app development as well. However, I'm far enough along to have a running and working iPhone and Android app. I have a map / driving directions page that works very well on the iPhone, but not on the Android phone. I get the same message as above: We can't find you? Driving directions cannot be determined because your device is not reporting it's location. I got the same message in the simulator, but kind of expected that. I did look in the same section of code that trailman listed above, and mine basically looks the same. The phone's GPS appears to be working; the Google Maps app shows my current location (although it is one house off). I am a novice at this, so any help would be appreciated. Thanks - Warren
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.