I have privileges and permission for telephony services. I am trying to retrieve IMEI and cell_id and other numbers. I am testing on emulator.
Code:
char *imei;
/* In the case of a single SIM, you get only one handle */
ret = telephony_init(&handle_list);
if (ret == TELEPHONY_ERROR_NONE) {
for (i = 0; i < handle_list.count; i++) {
snprintf(chars, sizeof(chars),
"<br>telephony handle[%p] for subscription[%d]",
handle_list.handle[i], i);
ret = telephony_modem_get_imei(handle_list.handle[i], &imei);
if (ret == TELEPHONY_ERROR_NONE) {
dlog_print(DLOG_INFO, LOG_TAG, "imei: %s", imei);
snprintf(chars, sizeof(chars), "<br>imei: %s", imei);
} else {
snprintf(chars, sizeof(chars),
"<br>imei: getting error.Code: %d", ret); // I am getting this error always. How to resolve?
}
}
How to successfully retrieve device IMEI number?
Could you let us know your privilege and its level?
For getting proper IMEI via telephony API,
Application should have "http://tizen.org/privilege/securesysteminfo" and its level is partner among public(3rd party)/partner(2nd party)/platform(manufacturer).
Please refer the updated telephony API doxygen as following link.