开发者

How to override a package in android source code at boot-time?

I want the android source to check at boot time if sdcard is inserted and if yes then override the default crypto package in the android source code with th开发者_如何学JAVAe one in sd card, else it does nothing.

Now I have 2 questions: 1. How can i override a default package? 2. How to check the status of sdcard at boot time?

I know how to check the status of sdcard in an application, which i got from one of the posts here, but how to utilize this boot time

if(android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))

Regards, Yogesh


  1. How can i override a default package?

You don't. You can create your own firmware that uses a different crypto package, and hope you don't break anything.

  1. How to check the status of sdcard at boot time?

The SD card is not usable until very late in the boot process, after the home screen has launched. The snippet of source code you show should work -- the question is timing. For example, you can register a BroadcastReceiver to get control at "boot time" via the BOOT_COMPLETED broadcast, but it may get control before the SD card is mounted.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜