Skip to content

Commit 1219784

Browse files
committed
2 parents b11dc42 + 567d077 commit 1219784

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

README.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ https://github.com/ltrudu/DeviceIdentifiersWrapper-Sample
2323
You can use the sample as a copy/paste source.
2424
```
2525

26-
26+
## Important !!
27+
```text
28+
Due to usage of the EMDK and the need to register the application, it is strongly advised to call the methods in your application class
29+
Check https://github.com/ltrudu/DeviceIdentifiersWrapper-Sample implementation.
30+
It's a basic implementation using static members.
31+
Feel free to remove statics and replace them with a better code in terms of architecture.
32+
The goal was to pass the idea that theses number should be retrieved only once, and the best place for it is the Application class.
33+
Note that a mechanism has been added in V0.4 to wait for the EMDK in case it would not be available (the classic use case is when your app respond to the BOOT_COMPLETED event that occurs way before the EMDK finishes its initialization)
34+
```
2735

2836
## Description
2937
A wrapper to easily retrieve the Serial Number and the IMEI number of an Android 10+ Zebra device.
@@ -211,7 +219,24 @@ Sample code if you need to get both device identifiers:
211219
// The message contains the serial number
212220
String mySerialNumber = message;
213221
// We've got the serial number, now we can ask for the IMEINumber
214-
getIMEINumber(context);
222+
DIHelper.getIMEINumber(context, new IDIResultCallbacks() {
223+
@Override
224+
public void onSuccess(String message) {
225+
// We've got an EMEI number
226+
String myIMEI = message;
227+
}
228+
229+
@Override
230+
public void onError(String message) {
231+
// An error occurred
232+
}
233+
234+
@Override
235+
public void onDebugStatus(String message) {
236+
// You can use this method to get verbose information
237+
// about what's happening behind the curtain
238+
}
239+
});
215240
}
216241

217242
@Override
@@ -220,7 +245,23 @@ Sample code if you need to get both device identifiers:
220245
// Do something here with the error message
221246
// We had an error with the Serial Number, but it
222247
// doesn't prevent us from calling the getIMEINumber method
223-
getIMEINumber(context);
248+
DIHelper.getIMEINumber(context, new IDIResultCallbacks() {
249+
@Override
250+
public void onSuccess(String message) {
251+
// We've got an EMEI number
252+
String myIMEI = message;
253+
}
254+
255+
@Override
256+
public void onError(String message) {
257+
// An error occurred
258+
}
259+
260+
@Override
261+
public void onDebugStatus(String message) {
262+
// You can use this method to get verbose information
263+
// about what's happening behind the curtain }
264+
});
224265
}
225266

226267
@Override

0 commit comments

Comments
 (0)