ddahan Member Licensed User Longtime User May 25, 2014 #1 Hi, I'm looking for a way to get indication that an application (any app) has been installed/uninstalled in the device. Scanning Installed Apps with PackageManager is too slow and intensive. I'll appreciate your advice. thanks, David.
Hi, I'm looking for a way to get indication that an application (any app) has been installed/uninstalled in the device. Scanning Installed Apps with PackageManager is too slow and intensive. I'll appreciate your advice. thanks, David.
Erel B4X founder Staff member Licensed User Longtime User May 25, 2014 #2 This code takes 60ms here: Code: Copy Sub Activity_Create(FirstTime As Boolean) Dim p As PackageManager Dim t As Long = DateTime.Now Dim all As List = p.GetInstalledPackages Log(DateTime.Now - t) End Sub You only need to do it once so it shouldn't be too slow. Upvote 0
This code takes 60ms here: Code: Copy Sub Activity_Create(FirstTime As Boolean) Dim p As PackageManager Dim t As Long = DateTime.Now Dim all As List = p.GetInstalledPackages Log(DateTime.Now - t) End Sub You only need to do it once so it shouldn't be too slow.
ddahan Member Licensed User Longtime User May 25, 2014 #3 Thanks Erel. I'm looking for changes , so I'll have to compare this list to a previous one to see what has been changed. Upvote 0
Thanks Erel. I'm looking for changes , so I'll have to compare this list to a previous one to see what has been changed.
Erel B4X founder Staff member Licensed User Longtime User May 25, 2014 #4 Comparing two lists should be a very quick operation. Upvote 0
ddahan Member Licensed User Longtime User May 25, 2014 #5 OK. seems that there is no better way. Thanks. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User May 25, 2014 #6 You can use PhoneEvents to listen to the PackageAdded / Removed events (it will probably better to handle these events with static intent filters). Upvote 0
You can use PhoneEvents to listen to the PackageAdded / Removed events (it will probably better to handle these events with static intent filters).
ddahan Member Licensed User Longtime User May 31, 2014 #8 PackageAdded / Removed works perfect. No need to scan and compare ... Thanks Erel. Upvote 0