Hello every body
I am going to develop an app which is a security app like locker apps
By using this app we can lock each place of our phone such as gallery,file manager,etc...
Now i want to Get package name for every app which is started by user and must be unlocked after user entered correct pass or pattern ,...
Here is my code
B4X:
Dim R As Reflector
R.Target=R.GetContext
ActMan = R.RunMethod2("getSystemService","activity","java.lang.String")
Dim TaskInfo As JavaObject = ActMan.RunMethod("getRunningTasks",Array As Object(1))
Dim CompInfo As JavaObject = TaskInfo.RunMethodJO("get",Array As Object(0)).GetField("topActivity")
Dim PackageName As String = CompInfo.RunMethod("getPackageName",Null)
Log(PackageName)
By using this code we can get package name for each running app but not worked on android +5 without any error and just return luncher package name
Tnx all
Have u the corect code which is working on android +5?
If is possible please correct my code for android +5
I'm not so much familar with java and reflection methods
It seems like Google really really doesn't want you getting other application's information, such as this.
I couldn't get the UsageStatsManager way of getting package names working, only the getRunningAppProcesses. This works on Android L, but does not work on Android M.