Wednesday, April 9, 2014

Sd installed in the boot of how


If the program is installed in memory, after setting android.intent.action.BOOT_COMPLETED to boot, but the program can not be moved to sd card boot, and ask whether the procedure can be done sd how to boot
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Android is not restricted unachievable ah
Reply:
It should be no problem!
As long as the program registered android.intent.action.BOOT_COMPLETED to the system, you can achieve boot ah

May be a problem in other areas it

Have a look at the program permission to access SDcard so other problems

Landlord look and see!
Reply:
I do not know too boot upstairs practice does not start on the sd card, 360 mounted on sd card, boot traffic monitoring also can not play the
Reply:
if (Environment.getExternalStorageState (). equals (Environment.MEDIA_MOUNTED))
{
/ * SD card can be used for normal operation * /
} Else {
/ * SD SD card can not be used to re-examine the available delay may be repeated several times until the SD card is available * /;
}
Reply:
You can determine whether SDCard already mounted, if you mount a successful re-start the program.
That set up a listener method BroadcastReceiver IntentFilter to:
Intent.ACTION_MEDIA_MOUNTED
Intent.ACTION_MEDIA_EJECT
Intent.ACTION_MEDIA_REMOVED
Then you start to realize the logic startActivity
further public void onReceive (Context context, Intent intent) in
Online people's code, reference:
private final BroadcastReceiver broadcastRec = new BroadcastReceiver ()

{

@ Override

public void onReceive (Context context, Intent intent) {

if (intent.getAction (). equals ("android.intent.action.MEDIA_MOUNTED")) / / SD

Card has been successfully mounted

{

imagepath =

android.os.Environment.getExternalStorageDirectory () ;/ / your SD card path

} Else

if (intent.getAction (). equals ("android.intent.action.MEDIA_REMOVED") / / various unmounted state

| |. Intent.getAction () equals ("android.intent.action.ACTION_MEDIA_UNMOUNTED")

| |. Intent.getAction () equals ("android.intent.action.ACTION_MEDIA_BAD_REMOVAL"))

{

imagepath = android.os.Environment.getDataDirectory () ;/ / your local path

}

}

};

/ / Select the behavior you want to listen in IntentFilter in

IntentFilter intentFilter = new

IntentFilter (Intent.ACTION_MEDIA_MOUNTED);

intentFilter.addAction (Intent.ACTION_MEDIA_UNMOUNTED);

intentFilter.addAction (Intent.ACTION_MEDIA_REMOVED);

/ / IntentFilter.addAction (Intent.ACTION_MEDIA_SHARED);

intentFilter.addAction (Intent.ACTION_MEDIA_BAD_REMOVAL);

/ / IntentFilter.addAction (Intent.ACTION_MEDIA_SCANNER_STARTED);

/ / IntentFilter.addAction (Intent.ACTION_MEDIA_SCANNER_FINISHED);

intentFilter.addDataScheme ("file");

registerReceiver (broadcastRec, intentFilter) ;/ / Register listener function

unregisterReceiver (broadcastRec) ;/ / finished using radio listener function
canceled

Reply:
If the program is installed inside the store, after setting android.intent.action.BOOT_COMPLETED to boot. You put the program in what format sd card? You said the program is moved to SD operation in specific how to do?

At present, I can think of is to write a script to sd card program resources installed.

        


Reply:
"Move to SD in the operation of the program is specifically how to do"
One way
mounted directly onto the sd card with 91Another way you can use the system moved to sd card
Reply:
Learning the ~ ~ ~
Reply:
App Install Location
Broadcast Receivers listening for "boot completed"
The system delivers the ACTION_BOOT_COMPLETED broadcast before the external storage is mounted to the device. If your application is installed on the external storage, it can never receive this broadcast.
http://www.ideasandroid.com/android/sdk / docs / guide / appendix / install-location.html
android explicitly stated, the application is installed on the sd card is not receiving ACTION_BOOT_COMPLETED message before mount sd card has been issued this message.
Reply:
references, 5th Floor haosimentu reply:
you can determine whether SDCard already mounted, if you mount a successful re-start the program.
That set up a listener method BroadcastReceiver IntentFilter to:
Intent.ACTION_MEDIA_MOUNTED
Intent.ACTION_MEDIA_EJECT
Intent.ACTION_MEDIA_REMOVED
Then you start to realize the logic startActivity
further public void onReceive (Context context, Intent intent) in
Online people's code, reference:
private final BroadcastReceiver broadcastRec = new BroadcastReceiver ()

{

@ Override

public void onReceive (Context context, Intent intent) {

if (intent.getAction (). equals ("android.intent.action.MEDIA_MOUNTED")) / / SD

Card has been successfully mounted

{

imagepath =

android.os.Environment.getExternalStorageDirectory () ;/ / your SD card path

} Else

if (intent.getAction (). equals ("android.intent.action.MEDIA_REMOVED") / / various unmounted state

| |. Intent.getAction () equals ("android.intent.action.ACTION_MEDIA_UNMOUNTED")

| |. Intent.getAction () equals ("android.intent.action.ACTION_MEDIA_BAD_REMOVAL"))

{

imagepath = android.os.Environment.getDataDirectory () ;/ / your local path

}

}

};

/ / Select the behavior you want to listen in IntentFilter in

IntentFilter intentFilter = new

IntentFilter (Intent.ACTION_MEDIA_MOUNTED);

intentFilter.addAction (Intent.ACTION_MEDIA_UNMOUNTED);

intentFilter.addAction (Intent.ACTION_MEDIA_REMOVED);

/ / IntentFilter.addAction (Intent.ACTION_MEDIA_SHARED);

intentFilter.addAction (Intent.ACTION_MEDIA_BAD_REMOVAL);

/ / IntentFilter.addAction (Intent.ACTION_MEDIA_SCANNER_STARTED);

/ / IntentFilter.addAction (Intent.ACTION_MEDIA_SCANNER_FINISHED);

intentFilter.addDataScheme ("file");

registerReceiver (broadcastRec, intentFilter) ;/ / Register listener function

unregisterReceiver (broadcastRec) ;/ / logout broadcast listeners have finished using the function




You simply do not understand the meaning of the landlord, and mount the sd card there any relationship. Application installed in the external sd is unable to receive the broadcast.

No comments:

Post a Comment