location

How to find degree from the latitude value in android?

随声附和 提交于 2019-12-12 08:09:37
问题 I have a latitude and longitude values as a double value(37.33168900, -122.03073100). I want to convert it to the degree value like (37 19' 54 ,48 11' 52 ). Any Idea? Thanx in advance. 回答1: Should be some math: (int)37.33168 => 37 37.33168 % 1 = 0.33168 0.33168 * 60 = 19,905 => 19 19.905 % 1 = 0.905 0.905 * 60 => 54 same with -122 (add 360 if nagative value) EDIT: May be there is some API, which I don't know. 回答2: This will give you Strings in degrees, minutes and seconds of arc: String

App permissions on Android Marshmallow in PhoneGap

余生颓废 提交于 2019-12-12 07:26:57
问题 In Android Marshmallow we need to give access to Location, File etc separately in Apps. Is there any wan in PhoneGap app that I can check is permissions are available or not and prompt the user to provide the permissions. 回答1: UPDATE 16/02/2016 Phonegap Build now supports API 23 - hoooray! Or if you build locally, just Cordova/Phonegap CLI 6+ and you'll get cordova-android@5+ platform by default. ORIGINAL ANSWER Currently, this is certainly possible using the Cordova/Phonegap CLI, but

Writing realm from service class causing UI block

限于喜欢 提交于 2019-12-12 07:01:49
问题 I am writing realm db from my LocationService class on every location change listener and listing this change in Activity to update the UI. Initially it works fine, however when number of entries in realm db exceeds 2K, it is started blocking the UI. Anyone please suggest. 回答1: Yes, the problem is that Service run in MainThread (UI thread by default). you need to write data asynchronously on background thread. Notice, that Realm instance is thread dependent and it has to be obrained and

Trying to center my map on user location (Says location is null)

ε祈祈猫儿з 提交于 2019-12-12 06:59:45
问题 ive been trying to center a map on the users location, but it keeps saying the latLng variable is null. I have read that that happens because i am using the getLastKnownLocation, but I cant find any other way to do it (I am new to programing). I am working with the google api on Jellybean. Here is the code that i am using. if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { mMap.setMyLocationEnabled(true);

ASP .Net C# - Get File location after downloaded

一世执手 提交于 2019-12-12 06:09:54
问题 I'm currently developing a simple program (using ASP.Net C#) to populate data from GridView into Excel file. the Excel file will be need to downloaded into client computer. For some reasons, I need to manipulate the Excel file quickly after it downloaded into client local computer. The problem is I can't get the file location where the file was downloaded. How can I get the file location after it downloaded into client computer ? This is the screenshot: Download Code: private void Create

In TFS, how can I share source files in different location, in same machine, without sharing the full project

梦想的初衷 提交于 2019-12-12 05:39:35
问题 I want to publish some sample code for peoples, for example in CodeProject. But some source files (.cs files) are part of a large library that I don't want to publish completely. How I can, in TFS 2012, share source files (.cs files) between 2 different projects (different location). That would let me update source as it would be updated by 2 different users, kind of. I heard about Workspace but I'm not sure if it is the way to go and how I should do that? I do not want to branch in order to

Android service with always on GPS

浪尽此生 提交于 2019-12-12 05:39:32
问题 I've created an android app that is so far working quite well. It contains a local service which is responsible for getting the users location every couple of minutes and relaying that via UDP to a collection server which is in turned displayed on a web application map. The app needs to be constantly running unless the user explicitly signs out of the application. Currently, it seems the OS is shutting down the service and restarting it as needed. I can see this because normally it would

How to start service again when App Restarts and User already Granted Location access

丶灬走出姿态 提交于 2019-12-12 05:28:17
问题 I am able to implement a simple gpsTracker using a service that runs on background like this: public class MyService extends Service { private static final String TAG = "BOOMBOOMTESTGPS"; private LocationManager mLocationManager = null; private static final int LOCATION_INTERVAL = 1000; private static final float LOCATION_DISTANCE = 10f; private final IBinder mBinder = new LocalBinder(); private Intent intent; Context context; Location mLastLocation; public class LocalBinder extends Binder {

How get location by COARSE location

旧巷老猫 提交于 2019-12-12 05:27:58
问题 I'm trying to develo an app that get location by COARSE location. This app must run on Android 6 too than i've implemented permission request on run time, start the map but i can't get my current location... any tips? This is my main activity: package com.luca.fontanelle; import com.google.android.gms.appindexing.AppIndex; import com.google.android.gms.location.LocationListener; import android.Manifest; import android.content.Intent; import android.content.IntentSender; import android.content

How can I rotate on Google Maps API(android) with only 1 finger?

久未见 提交于 2019-12-12 05:18:28
问题 I'm developing an app that will lock on a users location, much like in the new Pokemon go app, and I need to find a way to rotate with only one finger. I thought there might be some 'drag' functionality, but I have yet to find anything that will work. Any ideas? 回答1: I had the same issue. what I did was I've added a custom view that extends FrameLayout on top of the map and added a "onTouchEvent" method to it. I calculated the angle between two lines- first line is between first touch point