I'm working on a sports application where I have to constantly get accurate live location from user and send it to the server, even when the application is minimized. The official android developer page says background location access is only possible when a user selects 'Allow all the time' on a settings page.
Android Developers > Docs > Guides > Request background location
This, I find, is programmatically impossible. At the same time, there are multiple apps (Strava , Map runner, runkeeper) which are able to get GPS coordinates when the app is minimized without getting the permission.
If anyone happened to dabble in this sort of thing, I would like to have your inputs. Thank you.
Related
I'm developing an app that aims to monitor the usage time of apps and their type.
and I'm having difficulty finding the solution to know which application is open to the user at certain times...
I would like to know if there is any way to apply this...
example in practice:
my monitor app is always running in the background, and it has some alarms that go off at certain times of the day and raises a broadcast. at that moment that my broadcast that got up I would like to put some code snippet that shows which application at that moment is active for the user, for example if at that moment the instagram is being displayed, I want my app to find its package on the device which would be: com.instagram.android or if it was facebook it would find the package com.facebook.katana
technically I'm building an app that will be system and with admin privileges, and that won't go to the playstore so if there is any code for it I can implement it.
I'm currently working on an app that requires users to have background location turned on as it is a core element.
Currently the app requests location and functions properly, but the user must manually go into settings to change to allow always. However, our users are generally not technically-savvy individuals, so I would like to make it so they can click allow always right when prompted for location.
I have been researching this topic for a few hours now and I cannot find a simple solution that doesn't require use of a library. According to Google's documentation, https://developer.android.com/training/location/permissions#request-background-location, this should be simple using the function getBackgroundPermissionOptionLabel(). I am unsure of the context to use this, and searching the function itself has not yielded any results.
I have also found their sample project,https://github.com/android/location-samples/tree/master, which includes LocationUpdatesPendingIntent that prompts the user for permissions but only shows a link to go to the location permissions settings page.
Currently here is exactly what we use for requesting the location permission, which is identical to what the example uses.
ActivityCompat.requestPermissions(MainActivity.this,
new String[] {
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_BACKGROUND_LOCATION
},
REQUEST_PERMISSIONS_REQUEST_CODE);
I have an app for a customer (refer to it as "their" app). When "their" app is open they do not want users of the device to use any other apps.
The only way they want to get round this, is if i create a login page within the app, and from there you can go to the android settings page. If the android settings are accessed, then the user should be able to go anywhere they want, until "their" app is in the foreground again, then the device should be locked into using just that app.
If this makes any difference, "their" app is a cordova app. I dont think it will, but thought i would mention it anyway. Needs to work in android 5.0
Is this possible at all? What would i need to implement for this? A service and timer?
UPDATE
It is a tablet, so it will never ring.
If the user presses the Home button, nothing should happen as the app should stay in the foreground
I have an app I'm currently working on based on the HTC Open Sense SDK for android. However my biggest problem is keeping up with the device checker through the Google Play dev console to only allow certain devices to download the app. My biggest reason is that people will rate my app so low on the scale and say it sucks, but the problem is that they don't read the requirements - if you use an Lg G2 to try and launch an app made for an HTC ONE that requires Sense, it's going to crash.
So, how would i go about building a helper class that would check the device's model via build.prop (without needing root privileges) before opening/starting the main activity, and give the user a notification if the device was incapable of launching the app, and with devices that are capable of launching it, just continue the process of opening the app?
I've been looking around for a while to find out what happens when a user fails to unlock the phone.
Basically I'm trying to take a picture if a user fails to authenticate. But all I can find is ACTION_USER_PRESENT - Does anyone know if this is possible?
Thanks
You can't access the login attempts of the android lockscreen.
If you want to build an app that does that you have to create your own lockscreen. However, this is not a "real" lockscreen you can't edit in the android settings. This would be an App which acts like a lockscreen and has the same permissions. Because you can check if a phone is locked, that way the app would activate its own "lockscreen" (which is basically a normal form with many permissions) whenever the phone gets locked (you probably have to deactivate the original lockscreen).
Look into this link, there you have all options regarding the original lockscreen.