rhomobilerhodes

How can i generate device specific unique number in Rhomobile


I need to send a unique number per device to server to trace the application install and create its specific device number.

When i use to generate the unique number by some logic, and make it to store in the local db, but on uninstalling and again installing the application, the generated number is different. So i'm not able to get the data for that device been used previously.

Do we have some way to make/generate this unique number ?


Solution

  • You should be using the System property to get some unique number rather than generating unique number by some complex logic.

    You can use the System.get_property() and get the phone_id which will be unique for all device even after uninstalling and reinstalling.

    System.get_property("phone_id")
    

    Check the whole list of properties here http://docs.rhomobile.com/rhodesapi/system-api#getproperty