Android: Listen for app installed / upgraded broadcast message

Using Lookout app (, I see every time I install or upgrade app, it’ll automatically scan this app to ensure it’s not malicious.

Follow Lookout, I write a simple app which listen broadcast message whenever each app is installed or upgraded. AFAIK, there are some type of IntentFilter for broadcast message, it is:

  • For Google API Access, can I create multiple Client IDs for the same Android package name?
  • state_checked doesn't toggle imageview on and off
  • Android Can't retain fragments that are nested in other fragments
  • How to handle onContextItemSelected in a multi fragment activity?
  • How to add multiple theme attributes to the same activity on Android Manifest?
  • How to scale a website for mobile devices?

    I hope Intent.ACTION_PACKAGE_ADDED is the answer but it’s wrong (ACTION_PACKAGE_ADDED: A new application package has been installed on the device. The data contains the name of the package. Note that the newly installed package does not receive this broadcast.) while ACTION_PACKAGE_INSTALL is deprecated.

    Can anyone tell me a better way? Any help is welcome.

    Related posts:

    Android: What is better - multiple activities or switching views manually?
    How can you display upside down text with a textview in Android?
    how to use twitter api in android application for send tweet only
    Listen for keyboard show or hide event in android
    How detect long edges of wall to prepare mask and recolor
    Writing hidden file .nomedia fails on internal storage
  • How to make flatMap execute on background thread
  • Disable Button when Edit Text Fields empty
  • wrap a layout with textviews
  • How to get all android contacts but without those which are on SIM
  • Android Studio: Rendering Problems with CoordinatorLayout
  • How to do swipe to delete cardview in android using support library
  • 4 Solutions collect form web for “Android: Listen for app installed / upgraded broadcast message”

    If you are installing an application A, All other applications on the device will get the Intent that application A is the newly installed application but not A itself as it doesnt seem of any use. Now A will get broadcasts if other apps are later installed or changed.

    If you want to find out at when your app was installed or some other app’s the last install or update time, you can always use PackageManager

        PackageManager pm = context.getPackageManager();
     ApplicationInfo appInfo = pm.getApplicationInfo("", 0);
     String appFile = appInfo.sourceDir; 
    long installed = new File(appFile).lastModified();

    here is the package name of the app you want to find out the install time. If you want to use it for your app, pass in your app’s package name.

    You can try this receiver and permission.
    (But this seem only work in /system/app)^^”

        android:exported="true" >
                    <action android:name="android.intent.action.PACKAGE_ADDED" />
                    <action android:name="android.intent.action.PACKAGE_REMOVED" />
                        <data android:scheme="package"/> 
     <uses-permission android:name="android.permission.BROADCAST_PACKAGE_REMOVED" />

    You need to have two applications, one of them monitors the other app’s installation and upgrades.

    Android won’t send your a broadcast that you’re being installed, but Google Play will. This won’t help if your app is loaded through Amazon or through the debugger, but it does allow you to run code if your app is installed through Google Play:

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.