Yes, of course it is possible. The easiest way is the native way, the way which Android apps use to know which app has been installed in the system. They get to know that information by listening to a broadcast intent with action android.intent.action.PACKAGE_ADDED
. The data it carries has the package name.
Provided that you've adb setup in PC, you can check this info on your own by installing a new app in your system followed by executing
adb shell dumpsys activity
Look for the string android.intent.action.PACKAGE_ADDED
under Historical broadcasts [background]. Example:
#7: BroadcastRecord{426162e8 u0 android.intent.action.PACKAGE_ADDED}
act=android.intent.action.PACKAGE_ADDED dat=package:de.defim.apk.protectedapps flg=0x8000010 (has extras)
extras: Bundle[{android.intent.extra.UID=10150, android.intent.extra.user_handle=0}]
As for the Tasker, it allows listening to broadcasts as a trigger. Setup Tasker like this:
Profile: Event → System → Intent Received
- Action:
android.intent.action.PACKAGE_ADDED
- Scheme:
package
- leave the rest untouched
Task: (Actions):
In order to get the app label, you can either use Tasker's inbuilt functionality or use aapt
(requires root access)
See Accessing Intent Data for more info on intent handling in Tasker.