0

My Android app needs to start when the device boots up. I used ACTION_BOOT_COMPLETED with a Broadcast Receiver to handle this. However, Google has placed a limitation on this. If the app is installed on an SD card, the Broadcast Receiver will not receive the ACTION_BOOT_COMPLETED message. They must be installed on internal memory to start at boot time. That really sucks. Some devices simply don't ship with enough internal memory. Hopefully Google implements a way to install boot apps on SD cards.

In the meantime, is there any other workaround where I can get my app to boot but have it installed on the SD card?

4

2 に答える 2

2

これが本当の問題です。BOOT_COMPLETE が送信された時点では、SD カードはまだマウントされていません。レシーバーで getExternalStorageDir を呼び出すと、実際には失敗します。まだドライブを読み取ることができません。彼らがそれを行うことを決定しない限り (起動完了イベントが大幅に遅くなります)、SD カード アプリで機能させることはできません。

@Luciferが提案したように、内部ストレージに移動し、外部ストレージがマウントされるのを待ってから、サービス/アクティビティを開始してアプリを実行するブートローダータイプのアプリを構築できます。その最善の策です。

于 2013-04-02T05:32:52.233 に答える
0

Google Play で入手できるこのアプリを使用して、起動時にアプリを起動できます: https://play.google.com/store/apps/details?id=info.niwota.start

于 2013-04-02T06:13:20.080 に答える