Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use android app to track user activities?

Tags:

android

I wish to know is it possible to write an android app that when it runs at the background, it can track user activities?(Such as what other app did the user used, what phone number did user dial, the GPS location for user, etc) Cause I am not sure can a single android app react to other application, does anyone know the answer? Thanks

like image 401
JLTChiu Avatar asked Nov 21 '12 18:11

JLTChiu


People also ask

Can Android apps track?

An Oxford University study of nearly 1 million free Android apps in 2018 revealed that the majority of mobile apps contain utilities from companies — including Alphabet, Facebook, Twitter, Verizon, Microsoft and Amazon — that enable them to track and send data about users to these companies.


3 Answers

In the general case, no, you can't. And users would probably prefer it so.

Once this has been said, there are certain partial solutions. Sometimes the system is so helpful that it will publish Intents reflecting user actions: for example when the user uninstalls an app -- with the caveat that you don't get that intent on the app itself being uninstalled.

It used to be the case that before Jelly Bean (4.1) apps could read the log that other applications publish and try to extract info from there, but it was a cumbersome, error prone, ungrateful task. For example, the browser shows nothing when it navigates to a certain page. You may read the logs for a while with adb logcat to get a feeling of what was possible and what isn't. This action requires the relevant permission, which cannot be held by regular apps now.

Thanks to @WebnetMobile for the heads up about logs and to @CommonsWare for the link, see the comments below.

like image 60
alexfernandez Avatar answered Oct 03 '22 20:10

alexfernandez


Fortunately spying users at that level should not be possible. Certain features can be achieved with abusing bugs in android which sooner than later will be fixed. I see absolutely no reason for you to know what number I am calling and where I've been lately. It's basically none of your business.

like image 32
Marcin Orlowski Avatar answered Oct 03 '22 21:10

Marcin Orlowski


Yes you can.

You can look here for instance about phone info: Track a phone call duration

or

http://www.anddev.org/video-tut_-_querying_and_displaying_the_calllog-t169.html

There is a way to let Android and users know you are using and accessing their data for them to determine if they will allow it.

I am unsure you can simply access any app, but in theory if you know how to read the saved files that might be possible.

For instance Runtime.getRuntime().exec("ls -l /proc"); will get you the "proc" root folder with lots of data you might need there. This might have been changed, I am not sure, and I also don't know what you need.

Perhaps to get running process try:

public static boolean getApplications(final Context context) {
   ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
   List<RunningTaskInfo> tasks = am.getRunningTasks(1);
}

For this to work you should include this in your AndroidManifest.xml

<uses-permission android:name="android.permission.GET_TASKS" />

See more about it: http://developer.android.com/reference/android/app/ActivityManager.html#getRunningAppProcesses%28%29

like image 22
msj121 Avatar answered Oct 03 '22 21:10

msj121