Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I know some permissions(like sdcard_rw,network,etc)is checked by Linux kernel.But other permissions?Like location,receive boot_boardcast, camera,etc. If they're checked by Android framework. Could we write code instead of the framework to use this without permissions?
Can we write code to instead the default Android API.
Should I read the source code of Android?
Sorry,I am a beginner of Android , and my English is poor.
Thank you.
Have a look at the LocationManager Sourcecode. The code is scattered with throws SecurityException statements, every function call that might fail because of permission reasons should check the permission.
VoicemailContentProvider does this too, have a look at it's source to get an idea how it's implemented.
EDIT: my previous statement about checking on bind time is only partially true, this might be the case for older Android versions, current implementations seem to check permission on every access to the secured resources to allow for revoking through the settings application and runtime permission granting (a background process will fail to insert contacts when the permission is revoked, even if it never created a new binding to the ContactsProvider.)
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm making an app like the image below and want to get all running app in the system, currently I use ActivityManager with API>21 and get runningAppProcesses but it just returns only my app in the result list. I try many other ways like: getRunningTasks,... but get the same result. Anyone have a better solution? Thanks so much for helping me!
(Described image here: https://www.howtogeek.com/wp-content/uploads/2016/06/Screenshot_2016-06-07-21-06-00.png)
The methods you mention were deprecated because of privacy concerns.
The only substitute I know of is the UsageStatsManager, which you can query to get events like ACTIVITY_RESUMED (An activity moved to foreground) or ACTIVITY_STOPPED (Activity became invisible).
It requires the PACKAGE_USAGE_STATS
special permission. You can not ask for it, you have to direct the user to the settings using Settings.ACTION_USAGE_ACCESS_SETTINGS.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I have a problem in my Android app. I have a service for geolocalization and I need to save the position on my DB.
When the app is running in the foreground I can to save the position, but when the app is running in the background the information isn't saved.
I used Firebase with Android.
Thanks.
With Android 10 for accessing location in background you need special permisson, or you can do it with a foreground service.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm not very experienced with developing app/tools, but I really want to develop (if practically possible) a tool that would notify the owner of the Google Drive folder of the information related to someone else accessing the folder (assuming that the folder is shared with that someone) such as, Access Date/Time, Accessed By etc. In my opinion, this would only be done if the user/owner has the tool/app opened/switched on.
I was reading the Google Drive API but couldn't find anything useful on this.
I'd like to know how to get started with this project, if this is even possible? I'm not very experienced but I want to learn as I grow.
I recommend going though the Google Drive API. When set up correctly Changes.watch will notify you when ever a file has been changed the trick for you will then be to notify your user.
Alternative would be to just check the file every now and then and see if it had been changed using file.get. However this is probably over kill depending upon how soon after the change you want to know about it.
I am not an android dev so cant help you much more then that. Your question is rather broad so once you start working with it if you have any issues getting it working I recommend you ask a new question directly related to those issues. Welcome to stack
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to create Application which disable other application permission. for example I Don’t want Facebook or Viber to access my location. there are 2 application (in my knowledge) which can do something like this
1.this is a open source application.
https://github.com/slvn/android-appops-launcher
but this is not for all android version.
https://play.google.com/store/apps/details?id=com.gmail.heagoo.pmaster&hl=en
so my question is how can i disable other application permission?
please guide me.
Thank you.
You have source, what else you want?
App Ops were introduced in 4.3 and were disabled/removed in 4.4.3. You can't change permissions in other versions of system, because these options are simply not present there (before 4.3 and above 4.4.2, including 4.4.3 and 4.4.4).
Thats why this linked app is "not for all android version". Some of them (these with root) porting these methods from original App Ops or are using present, hidden in system. In >=4.4.3 it needs root permission level for execution.
This is fairly impossible without rooting, and shouldn't be possible afterwards (though it seems it is)
Basically, when you install an app, you accept the permissions it needs. Something as a terms and conditions.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is it possible to detect when an Android user uses the copy and/or cut functionality?
I have a client who's idea pretty much depends on being able to call a method inside the app whenever a user copies or cuts out a piece of text or an image, no matter whether the user is actually inside the app or not (though the app would be running in the background).
My initial guess would be no, but you never know. I haven't been able to find any clear information about it, so thought I should ask.
Is it possible to detect when an Android user uses the copy and/or cut functionality?
Not exactly. You can listen for changes in the clipboard using ClipboardManager. However:
Changes in the clipboard do not always imply "copy and/or cut" operations
You can only listen for such changes while your process is running