Android Question Trying to listen for package installs/uninstalls

NeoTechni

Well-Known Member
Licensed User
Longtime User
I have added this to the manifest:
HTML:
AddReceiverText(stimer,
<intent-filter>
    <action android:name="android.intent.action.PACKAGE_ADDED" />
    <action android:name="android.intent.action.PACKAGE_INSTALL" />
    <action android:name="android.intent.action.PACKAGE_REMOVED" />
</intent-filter>)

And this is the sTimer service:
B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim BCR As BroadCastReceiver
End Sub
Sub Service_Create
    BCR.Initialize("BroadcastReceiver")
End Sub

Sub Service_Start (StartingIntent As Intent)
    Log(StartingIntent.Action)
   
    BCR.addCategory("android.intent.category.DEFAULT")
    BCR.addAction("android.intent.action.PACKAGE_ADDED")
    BCR.addAction("android.intent.action.PACKAGE_INSTALL")
    BCR.addAction("android.intent.action.PACKAGE_REMOVED")
    BCR.SetPriority(2147483647)
    BCR.registerReceiver("")
End Sub

Sub Service_Destroy

End Sub

Sub BroadcastReceiver_OnReceive(Action As String, i As Object)
    Log("BCR: " & Action)
End Sub

From what I've read, I need access to the broadcastreceiver method addDataScheme("package") though
 
Top