location-services

After enable gps from an app prompt how to refresh and get the current location?

别说谁变了你拦得住时间么 提交于 2019-12-22 10:46:21
问题 I am currently developing an Android app which prompts the user to enable GPS if it's not on and I have used Alert Dialog for this purpose. After I enable the GPS from settings and come back to my app by pressing back button, the toast message display 0.00,0.00. Although If I have my GPS on before running the app, the app properly displays my location. I want to know to which method to use for this refresh user location after enabling GPS purpose. Any relevant article would really help. This

cannot resolve symbol 'LocationServices'

柔情痞子 提交于 2019-12-22 01:34:05
问题 I am trying to build an android app using android studio that uses the userlocation. I am trying to import the google play services LocationServices api, but it says it can't resolve symbol 'LocationServices'. I tried searching for an answer but I can't figure out what the problem is. here is a picture of my error and code: Thanks in advance 回答1: You need to import: import com.google.android.gms.location.LocationServices; And in build.gradle : implementation 'com.google.android.gms:play

Android Fake GPS location apps do not work anymore

╄→гoц情女王★ 提交于 2019-12-21 04:19:10
问题 I used to work with this application: https://play.google.com/store/apps/details?id=com.fakegps.mock&hl=en And before this with this one: https://play.google.com/store/apps/details?id=com.incorporateapps.fakegps.fre&hl=en Am working on a LG G3 and a Nexus 5, but in the last couple of days, the fake location doesn't work as it should. It doesn't always modify my location and sets in where I want. Or many times, it sets my location where I want for a couple of seconds and then resets to my real

How to get Current Location using seperate class in Android

别等时光非礼了梦想. 提交于 2019-12-17 19:54:52
问题 I need to get current location using seperate class which not in the Activity. This is my code and it doesnt't work. Anyone have idea to fix this.This application is always crash when I try to get location details. package com.example.ishanfx.departmentapp.network; import android.content.Context; import android.location.Criteria; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import com.google

Web service call in background mode - iOS

跟風遠走 提交于 2019-12-13 18:59:15
问题 I need to call a web service in every minute and parse the data when app is in background state. Since the APP uses location service I have enabled background mode for update Location. I tried calling location update by using a timer background task, but it not working. - (void)applicationDidEnterBackground:(UIApplication *)application { self.bgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ NSLog(@"ending background task"); [[UIApplication

Get iPhone location in iOS without preference Location Services set to ON

一笑奈何 提交于 2019-12-13 14:33:28
问题 I'm writing a daemon similar to Chris Alvares daemon. I want to get the divice location in background without users permission. If the Location Services preference in Settings is set to ON then I have no problem getting location. For this I'm adding to my executable entitlements com.apple.locationd.preauthorized key with boolean value set to true. The problem is when the Location Services is off. In this case when I want to get the device location a UIAlertView pops up telling the user that

getLastLocation() always null in GoogleApiClient

我的梦境 提交于 2019-12-13 14:16:46
问题 Am trying to build an application that requests the current location using the GoogleClientApi and LocationServices, but the Location is always null even that I enabled the WiFi,Mobile Data and GPS , tested it on several devices all the same the permissions from the manifest.xml : <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android

Location is always null after coming from foreground to background?

半世苍凉 提交于 2019-12-13 07:38:27
问题 I am having this issue where my Android's location is always null, but it seems like it only happens when my app goes from the background to the foreground. Here is my code: Public.java: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { String userId = AccessToken.getCurrentAccessToken().getUserId(); //Open DB and get freinds from db & posts. datasource = new FriendsDataSource(getContext()); datasource.open(); postsDataSource = new

tvos Location Services prompt never prompted

假如想象 提交于 2019-12-13 07:24:34
问题 Have anyone gotten CLLocationManager to prompt for permission on tvos? I'm using the following code (that works on other platforms) to get a user's location and prompt for permissions. self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers; self.locationManager.delegate = self; [self.locationManager requestWhenInUseAuthorization]; [self.locationManager requestLocation]; However, the authorization delegate is called

Does Google Location Services return old locations?

本小妞迷上赌 提交于 2019-12-13 04:37:43
问题 I am trying to track my location every 2 mins to check the distance from me to my house. However the results I have been getting have been odd. When I would travel about 700 meters away (to another building) and stay there for 2 hours the results would say that I was always within 40 meters of my home. They would change but the distance never got bigger than that. private void locationSetup(){ int interval = 120000; // Create the LocationRequest object mLocationRequest = LocationRequest