Thanks Guys, This error was driving me crazy.... :P
Gustavo Avila http://www.androidforum.com.br On 16 fev, 21:10, jalopy <[EMAIL PROTECTED]> wrote: > I believe they can be placed anywhere in the manifest file. > Do you have the following permissions set? > > <uses-permission android:name="android.permission.ACCESS_LOCATION"></ > uses-permission> > <uses-permission android:name="android.permission.ACCESS_GPS"></uses- > permission> > <uses-permission > android:name="android.permission.ACCESS_ASSISTED_GPS"></uses- > permission> > <uses-permission android:name="android.permission.ACCESS_CELL_ID"></ > uses-permission> > > On Feb 16, 4:03 pm, James <[EMAIL PROTECTED]> wrote: > > > I added the proper permissions to my Android Manifest and yet I am > > still getting a null reference when I call > > LocationManager.getCurrentLocation("gps"). Are permissions supposed to > > go right below the <manifest> tag? > > > On Feb 16, 3:38 pm, "Dan U." <[EMAIL PROTECTED]> wrote: > > > > Yes, it is still supported. Do you have proper permissions granted to > > > use gps? They added this requirement in m5, and as I recall, it won't > > > pop up any exception dialog like it does for most exceptions, but an > > > exception will be in logcat. I'm not sure on other providers. I guess > > > write your own maybe. > > > > On Feb 16, 3:35 pm, James <[EMAIL PROTECTED]> wrote: > > > > > I tried deleting userdata.img, but the same NullPointerException > > > > continued to come up. Do you know if "gps" is still supported in m5? > > > > Also, do you have any idea if there is another provider that exposes > > > > the same functionality as "gps"? All I need is a simple setup that > > > > will enable me to get random latitude/longitude coordinates that > > > > correspond with urban locations. > > > > > On Feb 16, 3:24 pm, "Dan U." <[EMAIL PROTECTED]> wrote: > > > > > > In the previous sdk, I noticed at times the emulator would not > > > > > correctly create the mock gps data and it caused the > > > > > NullPointerException. You could try deleting userdata.img to make it > > > > > reload everything. > > > > > > On Feb 16, 3:10 pm, James <[EMAIL PROTECTED]> wrote: > > > > > > > The mock location provider "gps" that simulates a walk around > > > > > > Mountain > > > > > > View seems to no longer be present in m5. When using the following > > > > > > code I get a NullPointerException: > > > > > > > LocationManager lm = > > > > > > (LocationManager)getSystemService(LOCATION_SERVICE); > > > > > > Location l = lm.getCurrentLocation("gps"); // l is a null reference > > > > > > Log.d("BUSINESSRATE", "BEFORE RETRIEVAL OF > > > > > > LAT AND LONG"); > > > > > > String longitude = l.getLongitude() + ""; > > > > > > // throws exception > > > > > > String latitude = l.getLatitude() + ""; > > > > > > > Does anyone know of a mock location provider present in m5 that I > > > > > > could use in place of "gps"? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---