gps

Can't get location permission for Android app

﹥>﹥吖頭↗ 提交于 2019-12-14 03:49:03
问题 I have the following in my manifest: <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> I also have the location permission set in my phone's settings. Yes, GPS is enabled on the phone. Here, I check for the permission: if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { int hasLocationPermission = mContext.checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION); Log.d(TAG,

Algorithm for determining city name w/o internet access?

南笙酒味 提交于 2019-12-14 03:34:07
问题 I have a database of Cities my application supports. This includes following: Name. Center coordinates. Nearest cities my app support are pretty far away. Algorithm I want to implement is: Get current location Run through center coordinates, if anything is in <(X)Km from the user, then user is in that city. Is this algorithm OK or should I re-think it some other way? My app currently supports 3 cities, however I plan to escalate & support more in some time. Unfortunately, my main audience is

How to learn location of the web user?

有些话、适合烂在心里 提交于 2019-12-14 03:33:56
问题 We have started developing an application for location aware emergency service. The users can connect through computer,smart phone or even through WAP. The problem we are facing is, we don't know how to get the location of the user who is asking for service. If it is GPS enabled smart phone, it can be located though the app. I have seen google map locating the cell phone using BTS tower's location in GPS-less smart phones (Like Nokia E-series). But I couldn't find any API in Nokia site which

How to summarize, group 4000+ GPX Trackpoints as Tracks named for by each days date?

余生长醉 提交于 2019-12-14 02:58:23
问题 the XSLT below extracts all Trackpoints (trkpt) only from a Garmin GPX-file (omiting any Waypoints) and exports the result as one (1) track into a new GPX-file ready for MapSource or Basecamp. Currently the name of that one track is the date of the first Trackpoint. How can I achieve to have one track per day named for by each date (YYYY-MM-DD), where each track includes all its corresponding trackpoints? (I believe that the date change in trkpt/time must be taken into account, but I am lost

Android Cannot resolve symbol OnRequestPermissionsResultCallback

喜你入骨 提交于 2019-12-14 02:56:13
问题 I am new to android and I am trying to build an app to show my current location and I am following the setup in apidemos from google linked here. This is part of an assignment so I do not want to disclose what my ultimate goal is. For now I want to be able to have gps location working on my app. I will post my activity code, xml layout code, manifest code and gradle code. If there is anything else I need to post please let me know. I have tried searching but I couldn't find anything. Also if

How to keep GPS / location service on android always on?

我的梦境 提交于 2019-12-14 02:14:46
问题 How to keep GPS / location service on android always on? If there is code to implement this or any available app on playstore ? I need to track my employees when they are in delivery routes. 回答1: I did something like that before. here is the location service : public class LocationService extends Service { public static final String BROADCAST_ACTION = "Hello World"; private static final int TWO_MINUTES = 1000 * 60 * 2; public LocationManager locationManager; public MyLocationListener listener

What formula to use to calculate a small distance

被刻印的时光 ゝ 提交于 2019-12-14 01:45:42
问题 Hy! I need to calculate the distance between 2 GPS Points. I read this question Formulas to Calculate Geo Proximity but i my english is too bad. My Problem is that the 2 points are at most 1 km away. I need the most excatly formula because of the small distance A example in PHP or pseudo code would be great 回答1: See this page. It contains great-circle distance calculation functions for various programming languages. In PHP: function getDistance($latitude1, $longitude1, $latitude2, $longitude2

Stop location updates when app terminate

邮差的信 提交于 2019-12-14 01:29:50
问题 I'm developing an app which sends notifications when you are nearby of promoted places. My problem is when I go to background and then I quit the app, I don't want the location services working when the app doesn't work (but I want them to work in background). I saw only 3 apps which close the gps when the app is closed and I want to know how they did that, Facebook, Google Maps and Apple Maps, not Foursquare, not FieldTrips... Thank you everybody. 回答1: you can add an observer for

How do I find nearby app users in android?

半腔热情 提交于 2019-12-14 00:17:22
问题 I am making an application which needs to be able to find people nearby, who are users of my app. I looked at many answers of precedent similar questions, and it seems I have no choice but to keep uploading a user's current location to the server, and get nearby users' list when necessary. Then my question is, 1. To get the nearby list, there should be some algorithm or function which calculates the distance. Then doesn't that mean I have to get all distances between my location and the rest

How to convert GPS coordinates into Google map Coordinates [duplicate]

江枫思渺然 提交于 2019-12-14 00:13:08
问题 This question already has answers here : Converting Degree, Minutes, Seconds (DMS) to decimal in PHP (5 answers) Closed 3 years ago . I want to convert GPS coordinates into Google map coordinates so I can use them in Google map in my website. GPS coordinates are lat : 4113.53948N (ddmm.mmmm) long : 00131.89855E (dddmm.mmmm) If there is any formula exist then please I need it so I can use in php. 回答1: Just to show the flexibility of an oft-forgotten PHP function that's actually extremely