MC18 Cradle Lock/unlock

// Expert user has replied.
F Fernando García 3 years 6 months ago
11 2 0

Hello
 
I'm looking for any property to know when the device is inserting on cradle.
Somebody know how do it for with Android emdk.
 
Thanks

Please Register or Login to post a reply

2 Replies

P Pietro Francesco Maggi

Hi Fernando,
with MC18 Android, you can use the Cradle API included in our EMDK v3.1u1 (and now in the EMDK v3.2 released in December).

I don't have a device to test this myself, by following the documentation it should be straightforward to get this info using this API getting the info you need with just these three methods:
public void enable() //This method enables the communication to interact with the cradle.public void disable() //This disables communication to interact with the cradle.public CradleInfo getCradleInfo() // This method gets the information of cradle.
Best regards,
~Pietro

Y Yanis Dalabiras

Hello Fernando,  With the EMDK we make it a point not to duplicate functionality that is already exposed though the standard Android APIs.  To get notification when the MC18 has been placed in the cradle you will need to make use of the BatteryManager API http://developer.android.com/reference/android/os/BatteryManager.html. With this API you can get a notification via an intent to know when the MC18 is charging/charged.

CONTACT
Can’t find what you’re looking for?