google maps - How to extract the present Latitude and Longitude values from Emulator in android -


what trying do::

i trying log present location(latitude,longitude) using android emulator testing


what have done:: have opened ddms , manually pushed latitude & longitude co-ordinates emulator , pressed send button


my question :: how can extract values emulator , print log

add following permissions.

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

make class implement locationlistener , add following code.

locationmanager = (locationmanager) getsystemservice(context.location_service); locationmanager.requestlocationupdates(locationmanager.gps_provider, 0, 0, this);  @override public void onlocationchanged(location location)  {     log.d("latlng", "latitude:" + location.getlatitude() + " longitude:" +     location.getlongitude()); } 

Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -