Академический Документы
Профессиональный Документы
Культура Документы
Summary
The Battery Swap Intent API allows applications to receive broadcast intents and handle battery swap
transitions. Applications may save the application context and release resources before swapping the
battery and resume operations after the battery swap is completed.
This API is available on Honeywell Android handheld computers that support the hot-swap battery
feature. Applications may receive the battery swap intents using an Android broadcast receiver without
a Honeywell SDK.
To see if your Android computer supports the hot-swap battery feature, you may press and hold the
power button until it displays a popup menu. You shall see a menu option for battery swap. Please
follow the onscreen instructions to properly activate the hot-swap battery feature before removing the
battery. For more information regarding the hot-swap battery feature, please refer to the Android
computer’s user manual.
Interface Details
Battery Swap Started Intent
This intent is broadcasted immediately after the user confirms the start of hot-swap battery operation.
This intent is an ordered broadcast.
Action: "com.honeywell.batteryswap.STARTED"
Action: "com.honeywell.batteryswap.COMPLETED"
Extras
"EXTRA_UNCONTROLLED" (boolean): Set to true if the user removed the battery without first
activating the how-swap battery feature on the Android computer; otherwise, set to false.
using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Content;
using Android.OS;
namespace BatterySwapDemo.Droid
{
[Activity(Label = "BatterySwapDemo", Icon = "@drawable/icon", Theme = "@style/MainTheme",
MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize |
ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
public const string BatterySwapStarted = "com.honeywell.batteryswap.STARTED";
public const string BatterySwapCompleted = "com.honeywell.batteryswap.COMPLETED";
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new BatterySwapDemo.App());