语言

Menu
Sites
Language
Getting MSISDN ,IMEI Number

i want MSISDN number DeviceuniqueId,imei ,Model, how i can get it ?

 and location of device ?

编辑者为: appdaily 27 4月, 2015

响应

23 回复
Vikram

Hello,

I found Apis to get this information and please check below functions.

MSISDN

     telephony_sim_get_subscriber_number()
Gets the subscriber number embedded in the SIM card. This value contains the MSISDN related to the subscriber. You get the subscriber number as a string, which needs to be freed by the application.

 

IMEI

   int  telephony_modem_get_imei (telephony_h handle, char **imei)
        Gets the IMEI (International Mobile Station Equipment Identity) of a mobile phone. 
 

Model name

   ret = system_info_get_platform_string("tizen.org/system/model_name", &value);

    dlog_print(DLOG_INFO, LOG_TAG, "Model name: %s", value);

 

and regarding location of device, you can use location function as below.

   double altitude, latitude, longitude, climb, direction, speed;
   double horizontal, vertical;
   location_accuracy_level_e level;
   time_t timestamp;
   ret = location_manager_get_last_location(manager, &altitude, &latitude, &longitude,
                                         &climb, &direction, &speed, &level, &horizontal, &vertical, &timestamp);

 Hope this help you.

appdaily

ReferenceError: Can't find variable: telephony_sim_get_subscriber_number

 

is this for web api ?

Vikram

In case of web api, there is a systeminfo to get it from device.

I suggest you to visit help page of IDE.

  Tizen Mobile Web App Programming > API References > Device API Reference > System >system info API

 

MSISDN   

This property reflects the information of the SIM card information.
     [NoInterfaceObject] interface SystemInfoSIM : SystemInfoProperty {

      readonly attribute DOMString msisdn raises(WebAPIException);

  };

 

IMEI

This property reflects the information of the Cellular network in this system.
  [NoInterfaceObject] interface SystemInfoCellularNetwork : SystemInfoProperty {

    readonly attribute DOMString imei raises(WebAPIException);
  };

 

Model name 

 This property reflects the information of the current device.
  [NoInterfaceObject] interface SystemInfoBuild : SystemInfoProperty {
    readonly attribute DOMString model;

    
  };

Regarding location of device, this link has the API guide.

  https://developer.tizen.org/documentation/guides/web-application/w3chtml5supplementary-features/location/geolocation-api-specification

Hope this help you.

 

appdaily

i am getting not supported:failed to get sim info .. u it showing error ?

 

tizen.systeminfo.getPropertyValue("SIM", onSuccessCallback,
                onErrorCallback);

 

function onSuccessCallback(sim) {
        alert("State: " + sim.state + "Operator Name: " + sim.operatorName
                + "  SIM card subscriber number: " + sim.msisdn
                + "\nIntegrated Circuit Card ID: " + sim.iccid
                + "   Mobile Country Code (MCC): " + sim.mcc
                + "\nMobile Network Code (MNC): " + sim.mnc
                + "   Mobile Subscription Identification Number (MSIN): "
                + sim.msin + "\nService Provider Name (SPN): " + sim.spn);
    }

    function onErrorCallback(error) {
        alert("Not supported: " + error.message);
    }

AVSukhov

Hello,

In Web app you can use System Info API:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.web.apireference/html/device_api/mobile/tizen/systeminfo.html

appdaily

i am getting not supported:failed to get sim info .. u it showing error ?

 

tizen.systeminfo.getPropertyValue("SIM", onSuccessCallback,
                onErrorCallback);

 

function onSuccessCallback(sim) {
        alert("State: " + sim.state + "Operator Name: " + sim.operatorName
                + "  SIM card subscriber number: " + sim.msisdn
                + "\nIntegrated Circuit Card ID: " + sim.iccid
                + "   Mobile Country Code (MCC): " + sim.mcc
                + "\nMobile Network Code (MNC): " + sim.mnc
                + "   Mobile Subscription Identification Number (MSIN): "
                + sim.msin + "\nService Provider Name (SPN): " + sim.spn);
    }

    function onErrorCallback(error) {
        alert("Not supported: " + error.message);
    }

Marco Buettner

Did you setup the config.xml with the required privileg? http://tizen.org/privilege/system

Marco Buettner

And dont forget that MSIN and MSISDN are only available for partners ;)

appdaily

process to become partners ? for imei also it needed?

AVSukhov

Hello,

imei, msisdn and msin require partner level privilege.

You can find more info in System info API references:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.web.apireference/html/device_api/mobile/tizen/systeminfo.html

Partner-level privileges can only be accessed by developers who are registered as partners on Tizen Store., while public privileges are open to all developers.

 

Marco Buettner

The location you can find out with

function success(position)
{
    //TODO: Write what ever you want to do
}

navigator.geolocation.getCurrentPosition(success, error, options)

 

appdaily

getting position error

Marco Buettner

do you setup the config.xml for location privileg?

appdaily

Done Thanks , to get partner i have to upload it to store ?

Marco Buettner

As far I know Samsung select developers for Partnership.

appdaily

after doing https://developer.tizen.org/dev-guide/2.2.0/?topic=%2Forg.tizen.gettingstarted%2Fhtml%2Ftizen_overview%2Fsecurity.htm

while running i am getting Error code: PRIVILEGE_LEVEL_VIOLATION

AVSukhov

Hello,

Do you mean "Partner Level Privileges in the IDE"?

If yes, this patch granted you partner level privilege only for Emulator and Reference devices but not for commercial device like Z1.

You cannot install app with partner privileges on commercial device.

If you want use partner level privileges you need register as partner on Tizen Store.

what device you are using for testing?

 

appdaily

z1

appdaily

in Emulator  not i am getting red screen

appdaily

in Emulator  now* i am getting red screen

Marco Buettner

Which command do u use?

appdaily

can i get any unique value of phone without partner Privileges

Marco Buettner

on native apps you can use TizenID, on WebApps I didnt find a similar API. 

Maybe u can use iccid? It integrated circut card id