Skip to content

Commit 69a3dc4

Browse files
authored
Update README.md
1 parent 07f080a commit 69a3dc4

1 file changed

Lines changed: 70 additions & 31 deletions

File tree

README.md

Lines changed: 70 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,78 @@ To access the serial number and IMEI file on Zebra Android devices running Andro
1010

1111
```xml
1212
<uses-permission android:name="com.zebra.provider.READ"/>
13+
<uses-permission android:name="com.symbol.emdk.permission.EMDK" />
1314
```
1415

15-
Then use the [MX access manager](https://techdocs.zebra.com/mx/accessmgr/) to allow your application to call the service identifiers associated with the serial number and IMEI
16+
Then add the uses-library element to your application
1617

17-
The MX access manager settings to enable this are as follows:
18-
- Service Access Action: "AllowCaller" (or 'Allow Caller to Call Service')
19-
- Service Identifier: For the serial number use content://oem_info/oem.zebra.secure/build_serial. For the IMEI use content://oem_info/wan/imei. If you want to allow your app access to both, you will need to declare two different instances of the AccessManager.
20-
- Caller Package Name: Your package name, in the case of this sample it is com.zebra.emdk_deviceidentifiers_sample.
21-
- Caller Signature: The signing certificate of your application. For more information on generating this see https://github.com/darryncampbell/MX-SignatureAuthentication-Demo.
22-
23-
You can apply the MX access manager settings in one of three ways:
24-
1. Via StageNow
25-
2. Via your EMM
26-
3. Via your application, using the EMDK Profile Manager.
27-
28-
For example, StageNow will look as follows to enable access to the serial number:
29-
30-
![StageNow](https://github.com/darryncampbell/EMDK-DeviceIdentifiers-Sample/raw/master/screenshots/stagenow.png)
31-
32-
You can then run this sample app and should see something like the below:
33-
34-
![Working](https://github.com/darryncampbell/EMDK-DeviceIdentifiers-Sample/raw/master/screenshots/working.jpg)
35-
36-
Or, on a device that does not have WAN capabilities, i.e. no SIM card or data connection:
37-
38-
![Non-WAN](https://github.com/darryncampbell/EMDK-DeviceIdentifiers-Sample/raw/master/screenshots/non_wan.jpg)
39-
40-
## Handling errors:
41-
42-
If you failed to correctly allow your application access to oem_info service, you will see an error stating so against each property you did not assign access to, as shown below:
43-
44-
![no_service_access](https://github.com/darryncampbell/EMDK-DeviceIdentifiers-Sample/raw/master/screenshots/no_service_access.jpg)
45-
46-
Assign access to your device and re-run the application.
18+
```xml
19+
<application
20+
android:allowBackup="true"
21+
android:icon="@mipmap/ic_launcher"
22+
android:label="@string/app_name"
23+
android:roundIcon="@mipmap/ic_launcher_round"
24+
android:supportsRtl="true"
25+
android:theme="@style/AppTheme">
26+
<uses-library android:name="com.symbol.emdk" />
27+
<activity android:name=".MainActivity">
28+
<intent-filter>
29+
<action android:name="android.intent.action.MAIN" />
30+
31+
<category android:name="android.intent.category.LAUNCHER" />
32+
</intent-filter>
33+
</activity>
34+
</application>
35+
```
4736

37+
Snippet code to use to retrieve the Serial Number of the device:
38+
39+
```java
40+
private void getSerialNumber()
41+
{
42+
DIHelper.getSerialNumber(this, new IDIResultCallbacks() {
43+
@Override
44+
public void onSuccess(String message) {
45+
// The message contains the serial number
46+
String mySerialNumber = message
47+
}
48+
49+
@Override
50+
public void onError(String message) {
51+
// An error occured
52+
}
53+
54+
@Override
55+
public void onDebugStatus(String message) {
56+
// You can use this method to get verbose information
57+
// about what's happening behing the curtain
58+
}
59+
});
60+
}
61+
```
4862

63+
Snippet code to use to retrieve the Serial Number of the device:
64+
65+
```java
66+
private void getIMEINumber()
67+
{
68+
DIHelper.getIMEINumber(this, new IDIResultCallbacks() {
69+
@Override
70+
public void onSuccess(String message) {
71+
// We've got an EMEI number
72+
String myIMEI = message;
73+
}
74+
75+
@Override
76+
public void onError(String message) {
77+
// An error occured
78+
}
79+
80+
@Override
81+
public void onDebugStatus(String message) {
82+
// You can use this method to get verbose information
83+
// about what's happening behing the curtain
84+
}
85+
});
86+
}
87+
```

0 commit comments

Comments
 (0)