tizentizen-web-apptizen-wearable-sdktizen-native-apptizen-emulator

How to get IMEI number on Tizen native wearable?


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?


Solution

  • 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.

    https://developer.tizen.org/development/api-references/native-application?redirect=https://developer.tizen.org/dev-guide/5.5.0/org.tizen.native.mobile.apireference/group__CAPI__TELEPHONY__INFORMATION__MODEM.html

    https://developer.tizen.org/development/api-references/native-application?redirect=https://developer.tizen.org/dev-guide/5.5.0/org.tizen.native.mobile.apireference/group__CAPI__TELEPHONY__INFORMATION__MODEM.html#ga7e0c134af4fe12c9074f5feaccf9f5cc