1

I am developing an application in which i want to auto launch the application once it is installed from the Google Play Store.I have searched a bit for this, and found threads and answers indicating this cannot be done. But i also found an app on Play store,Auto Launch when Installed which does this very effectively. Can any one suggest me a logic behind this. any help will be much appreciated.

Sanjay D
  • 265
  • 4
  • 17
  • 1
    It launches other apps automatically after they are installed not itself, right ?? – Sunny Kumar Aditya Nov 02 '12 at 06:38
  • 1
    Refer to this links. It might help. http://stackoverflow.com/questions/1975521/autostart-android-application-after-installation-complete http://stackoverflow.com/questions/2127044/how-to-start-android-service-on-installation – MysticMagicϡ Nov 02 '12 at 07:07
  • You cannot launch your own application as you want , the application you mentioned may be using this http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_ADDED – Sunny Kumar Aditya Nov 02 '12 at 07:15

1 Answers1

2

you need to create a BroadcastReceiver that is bound to the BOOT_COMPLETED action.

Example

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
     package="com.alfray.timeriffic" ...> 
     <application ...> 
      <receiver android:name=".MyBroadcastReceiver"> 
        <intent-filter> 
         <action android:name="android.intent.action.BOOT_COMPLETED" /> 
        </intent-filter> 
      </receiver> 
  </application> 

   <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 
   </manifest>

It may work. Just try out

Varun Vishnoi
  • 980
  • 1
  • 9
  • 32
  • Yes, but for this method to work the phone has to be booted once right? – Sanjay D Nov 02 '12 at 06:39
  • 5
    This method only work for android versions prior to 3.1. Now android requires the application to have been started at least once before it will start receiving any intents. – Gabriel Netto Nov 02 '12 at 07:14