location

I am trying to get location a update it in server in every 30 minutes android

强颜欢笑 提交于 2020-07-23 06:01:30
问题 I am trying to send user location in server. Fast i get the location and save in RoomDatabase and get data from RoomDatabase send to server. but i can't get location every 30 minutes when app in background. //Calling in mainactivity PeriodicWorkRequest periodicWork = new PeriodicWorkRequest.Builder(MyWorker.class, 30, TimeUnit.MINUTES) .addTag(TAG) .build(); WorkManager.getInstance().enqueueUniquePeriodicWork("Location", ExistingPeriodicWorkPolicy.REPLACE, periodicWork); // worker class

Android: Display user location on Map Fragment

狂风中的少年 提交于 2020-07-22 07:23:26
问题 i am developing an app for my final year exam in android studio and i don't know how to show user location on MapFragment. I've already do this but inside an activity, i need it inside the MapFragment. This is my MapFragment: public class MapFragment extends Fragment implements OnMapReadyCallback { GoogleMap mMap; MapView mMapView; View mView; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Nullable @Override public View

Android: Display user location on Map Fragment

纵然是瞬间 提交于 2020-07-22 07:23:09
问题 i am developing an app for my final year exam in android studio and i don't know how to show user location on MapFragment. I've already do this but inside an activity, i need it inside the MapFragment. This is my MapFragment: public class MapFragment extends Fragment implements OnMapReadyCallback { GoogleMap mMap; MapView mMapView; View mView; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Nullable @Override public View

How to display a location of a place in android app

﹥>﹥吖頭↗ 提交于 2020-07-20 06:46:44
问题 I am looking for a way to display a location of a place inside an android application. I have the longitude and Latitude coordinates of the place stored inside a MySQL database, now I want to retrieve them (Longitude and latitude)and display the exact location in the application. thanks 回答1: I am assuming you want it on a map view with a marker. <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="200dp" class="com.google.android.gms.maps.MapFragment" />

How can I get my location with Kotlin dev Android?

旧巷老猫 提交于 2020-07-09 16:07:12
问题 I'm making a Google Maps app. I've put on the API key, and the default code runs without any problems, but I don't know how to localize my position... I looked around and found this document: Kotlin API But still when I try to import: import com.google.android.location.Location the first "location" will appear in red... It looks like this API document is deprecated, so I don't know what to import or use to build my app... How can I fix this? 回答1: Try this code for getting the current location

How can I get my location with Kotlin dev Android?

本小妞迷上赌 提交于 2020-07-09 16:06:18
问题 I'm making a Google Maps app. I've put on the API key, and the default code runs without any problems, but I don't know how to localize my position... I looked around and found this document: Kotlin API But still when I try to import: import com.google.android.location.Location the first "location" will appear in red... It looks like this API document is deprecated, so I don't know what to import or use to build my app... How can I fix this? 回答1: Try this code for getting the current location

How can I get my location with Kotlin dev Android?

て烟熏妆下的殇ゞ 提交于 2020-07-09 16:06:07
问题 I'm making a Google Maps app. I've put on the API key, and the default code runs without any problems, but I don't know how to localize my position... I looked around and found this document: Kotlin API But still when I try to import: import com.google.android.location.Location the first "location" will appear in red... It looks like this API document is deprecated, so I don't know what to import or use to build my app... How can I fix this? 回答1: Try this code for getting the current location

Android : How to use mFusedLocationClient callback (resulting location) in current mainthread

大城市里の小女人 提交于 2020-06-27 19:32:10
问题 Following is my adapter for a RecyclerView where i need to update one of the TextView which shows distance of current location to another location . Now , to get the current location , i am using mFusedLocationClient.requestLocationUpdates(mFusedLocationRquest,mLocationCallback,null); If i am going with the below code and have just enabled gps in app with runtime permission , i face NPE on line : float distance = updatedLoc.distanceTo(des); App does not crash when i open with gps already

location.getlocation() gives casting error on android flutter

橙三吉。 提交于 2020-06-27 10:10:29
问题 First importing and initializing the location package: import 'package:location/location.dart' as locationPackage; locationPackage.Location location = new locationPackage.Location(); On android running the code: try { await location.getLocation().then((pos) { setState(() { print(pos.runtimeType); _center = LatLng(pos.latitude, pos.longitude);; _lastMapPosition = _center; }); }); } catch (e) { print(e); if (e.code == 'PERMISSION_DENIED') { print("Permission Denied"); } } } Gives the error: I

Issues with “Allow always” location in iOS 13

我们两清 提交于 2020-06-25 03:39:47
问题 I've an app which depends on the user's location. Until iOS 13 the app worked correctly but now it doesn' send the user's location. I've tried to choose the option "While using app" and wait to the next prompt in order to choose "Allow always" but it doesn't work. Choosing "While using app" and going to settings for changing the option to "Allow always" doesn't work. (Both cases are the "official" answer of Apple in the documentation) Any idea? Thanks 回答1: From iOS 13 onwards, Apple replace