android - Accessing Gps issue -


i trying access gps in mobile using following code

   locationmanager= (locationmanager)getsystemservice(context.location_service);     boolean isgpsenabled = locationmanager.isproviderenabled(locationmanager.gps_provider);     loc1 =locationmanager.getlastknownlocation(locationmanager.gps_provider); 

till yesterday working fine app not fecthing gps

i have enabled permission in manifest

locationmanager

this class provides access system location services. these services allow applications obtain periodic updates of device's geographical location, or fire application-specified intent when device enters proximity of given geographical location.

you not instantiate class directly; instead, retrieve through context.getsystemservice(context.location_service).

unless noted, location api methods require access_coarse_location or access_fine_location permissions. if application has coarse permission not have access gps or passive location providers. other providers still return location results, update rate throttled , exact location obfuscated coarse level of accuracy.

in manifest file :

<uses-permission android:name="android.permission.access_fine_location" />     <uses-permission android:name="android.permission.internet" /> 

how current gps location programmatically in android?

http://www.androidhive.info/2012/07/android-gps-location-manager-tutorial/


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -