Battery Intent API Reference

EMDK For Android 5.0

Overview

The purpose of this document is to describe the functionality of the Battery Intent API Interface. Its intended audience are Android developers.

Requirements

Knowledge of Android programming and familiarity with the Android intent mechanism are assumed.

  • Android Versions:
    • 4.4 and later.

Features

On Symbol devices, extra battery information can be retrieved using the standard Android Battery Intent. Setting up to receive this information is the same as with consumer Android devices. However, the data that is returned to your application includes some extra information provided by power precision and power precision plus batteries:

Battery Type Devices
Power Precision MC40, MC92, TC55, TC75, TC70, MC67
Power Precision Plus MC18, TC8000, WT6000
Backup Battery TC8000, MC92, MC40, MC67, WT6000

Battery Extras:

# Data Definitions Constant name Data type Format Power Precision Power Precision Plus Backup Battery
1 Battery Manufacture Date mfd String yyyy-mm-dd X X
2 Part Number for Battery Prefix is ’21-” or “82-”. Sample: 21-xxxxx-01 Rev. X partnumber String Prefix-5 or 6 #s-suffix revision X X
3 Battery Serial Number This value shall match the value showing on the physical label of the battery. serialnumber String Alpha followed by 4 numbers X X
4 Backup battery voltage bkvoltage Int Units=mV X
5 Rated Capacity of the Battery ratedcapacity Int Units=mAh X X
6 Decommission status of the battery battery_decommission Int 0=Battery good 1=Decommissioned Battery 2=Status Unknown X X
7 Cumulative charge using Zebra charging equipment only base_cumulative_charge Int Units=mAh X
8 No of charge cycles battery_usage_numb Int X
9 Cumulative charge using ALL (Zebra or Non-Zebra) charging equipment total_cumulative_charge Int Units=mAh X
10 Number of seconds passed since the battery was placed in a charger/terminal for the first time seconds_since_first_use Int Units=secs X
11 Maximum amount of charge that could be pulled from the battery under the present discharge conditions if the battery is fully charged present_capacity Int Units=mAh X
12 Battery health indicator in percentage (0 to 100). health_percentage Int Units=% X
13 Remaining time until the device becomes unusable under current discharge conditions. If the returned value is 65535, then time_to_empty is considered to be unknown time_to_empty Int Units=mins X
14 Time until battery is fully charged under present charging conditions. If the returned value is 65535, then time_to_empty is considered to be unknown time_to_full Int Units=mins X
15 Amount of usable charge remaining in the battery under current discharge conditions present_charge Int Units=mAh X

Programming Interface

Function Prototype


mIntent_Receiver = new Intent_Receiver();  
mIntentFilter = new IntentFilter();  
mIntentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);  
registerReceiver(mIntent_Receiver,mIntentFilter); 

Parameters

Please reference the Android Battery Manager API.

Return Values

In addition to the battery information Android returns by default, which can be found here, Symbol devices return the following additional parameters:

  • bkvoltage
  • mfd
  • serialnumber
  • partnumber
  • ratedcapacity
  • battery_decommission
  • battery_usage_numb   
  • health_percentage 
  • present_capacity 
  • base_cumulative_charge        
  • total_cumulative_charge       
  • present_charge      
  • time_to_empty        
  • time_to_full     
  • seconds_since_first_use      

Example


public void onReceive(Context context, Intent intent) {      
    if (BATTERY_STATE_CHANGED_INTENT.equals(intent.getAction())) {          

        int bkvoltage = intent.getExtras().getInt("bkvoltage");  
        String mfd = intent.getExtras().getString("mfd");  
        String serialnumber = intent.getExtras().getString("serialnumber");  
        String partnumber = intent.getExtras().getString("partnumber");   
        int ratedcapacity = intent.getExtras().getInt("ratedcapacity");  
        int cycle = intent.getExtras().getInt("cycle");  

    }  
}