[android-developers] Re: LocationManager crashes app, every time
No, only one emulator, but thanks for asking. After wiping emulator data and launching in debug mode from eclipse a few times, I was finally able to see logcat output. Ultimately it was a permission typo causing the crash. Still no idea why I couldn't get log info before. For anyone who is curious, LocationMananger.requestUpdates(Criteria...) will die internally every time. You have to explicitly tell it the provider to use via the other overloaded method. This is pretty silly--it should just use best/closest provider available to your criteria. It actually dies even if you just pass it a new empty Criteria object. Bottom line: this API is pretty flaky. On Apr 2, 5:09 pm, "Harsh Jain" <[EMAIL PROTECTED]> wrote: > are you running this in a second emulator by any chance ? > > On Thu, Apr 3, 2008 at 5:35 AM, JoeB <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Any advice on this would help--I can never get a provider from > > LocationManager (there is supposed to be a mock one at least, and I > > can see the data for it by using "adb shell"). I also can't get > > locations or anything else. Any of the following statements crash the > > application, every time (take your pick, they all crash it). > > >LocationProvider mockProvider = locMgr.getProvider("gps"); > >locMgr.getBestProvider(CRITERIA); > >locMgr.requestUpdates(CRITERIA, LOCATION_PERIOD, > > LOCATION_ACCURACY, notifyIntent); > > > Oh, and this > > List providers = locMgr.getProviders(); > > ...doesn't crash, but returns an empty list. > > > This is the Criteria setup btw: > > >private static final Criteria CRITERIA; > >static{ > >CRITERIA = new Criteria(); > >CRITERIA.setSpeedRequired(false); > >CRITERIA.setAltitudeRequired(false); > >CRITERIA.setBearingRequired(false); > >CRITERIA.setCostAllowed(false); > >} > > > I also have the following permissions defined in my manifest (I added > > all the location-related ones, just in case that was the issue): > > > > > > android:name="android.permission.ACCESS_ASSISTED_GPS" /> > > > > > > > > > I don't get any kind of error message in the console, but I also can't > > run "adb debug" from command line anymore since moving to m5-rc15 for > > unknown reason. It always just displays "error: closed", whether I > > run the emulator stand-alone or from eclipse. I know the > > LocationManager calls are causing the crash by tracing w/ debugger. > > > Any tips on why this is happening, or why I can no longer get any > > debug information, would be greatly appreciated. By the way, > > everything described above behaves exactly the same way with either m5- > > rc14 or m5-rc15 (I tried switching back to no avail). --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: LocationManager crashes app, every time
On Apr 3, 7:09 am, "Harsh Jain" <[EMAIL PROTECTED]> wrote: > are you running this in a second emulator by any chance ? > > > > On Thu, Apr 3, 2008 at 5:35 AM, JoeB <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Any advice on this would help--I can never get a provider from > > LocationManager (there is supposed to be a mock one at least, and I > > can see the data for it by using "adb shell"). I also can't get > > locations or anything else. Any of the following statements crash the > > application, every time (take your pick, they all crash it). > > > LocationProvider mockProvider = locMgr.getProvider("gps"); > > locMgr.getBestProvider(CRITERIA); > > locMgr.requestUpdates(CRITERIA, LOCATION_PERIOD, > > LOCATION_ACCURACY, notifyIntent); > > > Oh, and this > > List providers = locMgr.getProviders(); > > ...doesn't crash, but returns an empty list. > > > This is the Criteria setup btw: > > > private static final Criteria CRITERIA; > > static{ > > CRITERIA = new Criteria(); > > CRITERIA.setSpeedRequired(false); > > CRITERIA.setAltitudeRequired(false); > > CRITERIA.setBearingRequired(false); > > CRITERIA.setCostAllowed(false); > > } > > > I also have the following permissions defined in my manifest (I added > > all the location-related ones, just in case that was the issue): > > > > > > android:name="android.permission.ACCESS_ASSISTED_GPS" /> > > > > > > > > > I don't get any kind of error message in the console, but I also can't > > run "adb debug" from command line anymore since moving to m5-rc15 for > > unknown reason. It always just displays "error: closed", whether I > > run the emulator stand-alone or from eclipse. I know the > > LocationManager calls are causing the crash by tracing w/ debugger. > > > Any tips on why this is happening, or why I can no longer get any > > debug information, would be greatly appreciated. By the way, > > everything described above behaves exactly the same way with either m5- > > rc14 or m5-rc15 (I tried switching back to no avail).- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: LocationManager crashes app, every time
On Apr 3, 7:05 am, JoeB <[EMAIL PROTECTED]> wrote: > Hi, > > Any advice on this would help--I can never get a provider from > LocationManager (there is supposed to be a mock one at least, and I > can see the data for it by using "adb shell"). I also can't get > locations or anything else. Any of the following statements crash the > application, every time (take your pick, they all crash it). > > LocationProvider mockProvider = locMgr.getProvider("gps"); > locMgr.getBestProvider(CRITERIA); > locMgr.requestUpdates(CRITERIA, LOCATION_PERIOD, > LOCATION_ACCURACY, notifyIntent); > > Oh, and this > List providers = locMgr.getProviders(); > ...doesn't crash, but returns an empty list. > > This is the Criteria setup btw: > > private static final Criteria CRITERIA; > static{ > CRITERIA = new Criteria(); > CRITERIA.setSpeedRequired(false); > CRITERIA.setAltitudeRequired(false); > CRITERIA.setBearingRequired(false); > CRITERIA.setCostAllowed(false); > } > > I also have the following permissions defined in my manifest (I added > all the location-related ones, just in case that was the issue): > > > android:name="android.permission.ACCESS_ASSISTED_GPS" /> > > > > > I don't get any kind of error message in the console, but I also can't > run "adb debug" from command line anymore since moving to m5-rc15 for > unknown reason. It always just displays "error: closed", whether I > run the emulator stand-alone or from eclipse. I know the > LocationManager calls are causing the crash by tracing w/ debugger. > > Any tips on why this is happening, or why I can no longer get any > debug information, would be greatly appreciated. By the way, > everything described above behaves exactly the same way with either m5- > rc14 or m5-rc15 (I tried switching back to no avail). --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: LocationManager crashes app, every time
are you running this in a second emulator by any chance ? On Thu, Apr 3, 2008 at 5:35 AM, JoeB <[EMAIL PROTECTED]> wrote: > > Hi, > > Any advice on this would help--I can never get a provider from > LocationManager (there is supposed to be a mock one at least, and I > can see the data for it by using "adb shell"). I also can't get > locations or anything else. Any of the following statements crash the > application, every time (take your pick, they all crash it). > >LocationProvider mockProvider = locMgr.getProvider("gps"); >locMgr.getBestProvider(CRITERIA); >locMgr.requestUpdates(CRITERIA, LOCATION_PERIOD, > LOCATION_ACCURACY, notifyIntent); > > Oh, and this > List providers = locMgr.getProviders(); > ...doesn't crash, but returns an empty list. > > > This is the Criteria setup btw: > >private static final Criteria CRITERIA; >static{ >CRITERIA = new Criteria(); >CRITERIA.setSpeedRequired(false); >CRITERIA.setAltitudeRequired(false); >CRITERIA.setBearingRequired(false); >CRITERIA.setCostAllowed(false); >} > > I also have the following permissions defined in my manifest (I added > all the location-related ones, just in case that was the issue): > > > android:name="android.permission.ACCESS_ASSISTED_GPS" /> > > > > > > I don't get any kind of error message in the console, but I also can't > run "adb debug" from command line anymore since moving to m5-rc15 for > unknown reason. It always just displays "error: closed", whether I > run the emulator stand-alone or from eclipse. I know the > LocationManager calls are causing the crash by tracing w/ debugger. > > Any tips on why this is happening, or why I can no longer get any > debug information, would be greatly appreciated. By the way, > everything described above behaves exactly the same way with either m5- > rc14 or m5-rc15 (I tried switching back to no avail). > > > > > > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---