Skip to content

Commit 9a023a9

Browse files
authored
Update README.md
1 parent f1d1f7c commit 9a023a9

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ Android 10 limited access to device identifiers for all apps running on the plat
66

77
**Zebra mobile computers running Android 10 are able to access both the serial number and IMEI** however applications need to be **explicitly granted the ability** to do so and use a proprietary API.
88

9-
To access the serial number and IMEI file on Zebra Android devices running Android 10 or higher, first declare a new permission in your AndroidManifest.xml
9+
To access to this API, you must first register your application using the AccessMgr MX's CSP.
10+
You can do it using StageNow, more details here: https://github.com/darryncampbell/EMDK-DeviceIdentifiers-Sample
11+
Or you can use this wrapper that will automatically register your application if it is necessary.
12+
13+
To use this helper on Zebra Android devices running Android 10 or higher, first declare a new permission in your AndroidManifest.xml
1014

1115
```xml
1216
<uses-permission android:name="com.zebra.provider.READ"/>
@@ -54,6 +58,10 @@ dependencies {
5458
}
5559
```
5660

61+
Add the module DeviceIdentifierWrapper as a dependency to your application.
62+
63+
Now you can use the following snippet codes to retrieve IMEI number and Serial Number information.
64+
5765
Snippet code to use to retrieve the Serial Number of the device:
5866

5967
```java
@@ -105,3 +113,34 @@ Snippet code to use to retrieve the Serial Number of the device:
105113
});
106114
}
107115
```
116+
117+
As the previous methods are asynchronous, if you need both information, it is strongly recommended to call the second request inside the onSuccess or onError of the first request.
118+
119+
Sample code if you need to get both device identifiers:
120+
```java
121+
private void getSerialNumber()
122+
{
123+
DIHelper.getSerialNumber(this, new IDIResultCallbacks() {
124+
@Override
125+
public void onSuccess(String message) {
126+
// The message contains the serial number
127+
String mySerialNumber = message;
128+
getIMEINumber();
129+
}
130+
131+
@Override
132+
public void onError(String message) {
133+
// An error occured
134+
// Do something here with the error message
135+
// Then call the getIMEINumber method
136+
getIMEINumber();
137+
}
138+
139+
@Override
140+
public void onDebugStatus(String message) {
141+
// You can use this method to get verbose information
142+
// about what's happening behing the curtain
143+
}
144+
});
145+
}
146+
```

0 commit comments

Comments
 (0)