4

Well one of my apps on the play store have a BOOT_COMPLETED receiver and it have never got any issue until the S4, I have received multiple emails from S4 users saying that the app isn't working and after some troubleshooting the BOOT_COMPLETED receiver is not getting called.

Does anyone here know how to fix this for this particular device?

Here's the main code of it:

public class BootCompletedIntentReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
    if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
        ...
        ...
        //ALL MY CODE IS HERE
        ...
        ...
    }
}
}

Manifest :

    <receiver android:name=".BootCompletedIntentReceiver" >
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>

Of course I have the correct permission:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Rotary Heart
  • 1,859
  • 3
  • 27
  • 44
  • 1
    Did the users run an activity of yours? Remember that, until something manually runs a component of your app, manifest-registered receivers will not work, on Android 3.1+. – CommonsWare Jun 21 '13 at 16:52
  • Yes they did, they opened it and made some troubleshooting that I was asking them to do. All the results end with the same result, the receiver isn't being called at boot so the user have to open the app again to enable the services. – Rotary Heart Jun 21 '13 at 17:03
  • 1
    You might also take a peek at http://stackoverflow.com/questions/17221679/boot-completed-intent-not-received-on-all-devices/17221917#17221917 where I was discussing this sort of thing with somebody else yesterday, in case it gives you any clues. I don't have an S4 at present, so I don't know if there are any other specifics for it with regards to `BOOT_COMPLETED`. – CommonsWare Jun 21 '13 at 17:14
  • Interesting, will try with this one to see if I got something. Thanks. – Rotary Heart Jun 21 '13 at 17:49
  • FWIW, I just picked up an S4, and I had no problem with `BOOT_COMPLETED`, using this test project: https://github.com/commonsguy/cw-omnibus/tree/master/SystemEvents/OnBoot Note, though, that there are several device models marketed as the Galaxy S4. – CommonsWare Jul 02 '13 at 19:59
  • Could you try out my app? https://play.google.com/store/apps/details?id=com.rotaryheart.su.root.tools you can email me so that I can tell you what to do to test it (you don't need to be rooted). – Rotary Heart Jul 03 '13 at 21:26

1 Answers1

0

BOOT_COMPLETE is sent before external storage is mounted. if app is installed to external storage it won't receive BOOT_COMPLETE broadcast message. To prevent this you can install your application in internal storage. you can do this just adding this line in menifest.xml.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   android:installLocation="internalOnly"
    ... >

Some HTC devices can enable a "fast boot" feature that is more like a deep hibernation and not a real reboot and therefore should not give the BOOT_COMPLETE intent. To recover this your receiver will like this:

        <receiver
            android:name="YOUR_FULL_PACKAGE_NAME.BootStartUpReciever"
            android:enabled="true"
            android:exported="true" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.QUICKBOOT_POWERON" />
            </intent-filter>
        </receiver>

This process is working on my Samsung Galaxy SM-T235Y Tab4 but don't worked on Samsung GT-S7852 phone. Related Thread is here

Community
  • 1
  • 1
Md. Sajedul Karim
  • 7,031
  • 3
  • 56
  • 81