So, I am working on the database architecture of a web application which would have its android and iphone apps developed also.
And for that I want to create a column name device_id in mysql database to track if a user is using the application via web-app or android-app or iphone-app.
Below are a few functional points :
Creation / Sign Up
- Can be done by web-app / android-app / iphone-app.
Log In
- Doesn’t matter where the user creation has been done from , User can login from all based on the central database on web (using a login web service).
Problem Domain
Don’t have any facts but some of my tech team has advised that:
Iphone and Android those would provide a UDID and ANDROID_ID earlier are not going to do so in the future releases.
Now,
The mobile app works even without the internet connection and hence I have developed a sync tool for the same which will sync the data on device to web and web to device on a button click.
Some cases may include same user, who is using the app from various devices and web as well so that the data gets in sync on the device and web seamlessly.
Hence, what would be the best work-around for this, could I auto generate some unique sequence and not rely on the device id’s for the syncing process.
—Edit—
On factory reset and rooted device its sure that the device won’t
return a unique Id and also there are various development firms
working on android customization and hence it is not a guarantee for a
unique device id . So, how could I get a better workaround by some
logic at my end and web also.
Guessing you are done with sync process(@Nishant B’s post), now for Unique ID here is the code snippet which works almost for all Android devices (Tab + Mobile).
Now as you know, there is no guarantee of any Unique ID in Android so its better to create a key which will generate as a combination of multiple key and Unique on every time we generate…
here we had taken IMEI, Manufacturer Board detail, Wifi address and Bluetooth address (not taking ANDROID_ID as its change when factory reset). with combinition of these key one can generate a Unique key(
m_szUniqueID) with the help of MD5.I’m sure with the help of this above you can generate a unique key everytime.
Good points: