Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9204283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:40:32+00:00 2026-06-17T23:40:32+00:00

So, I am working on the database architecture of a web application which would

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:40:34+00:00Added an answer on June 17, 2026 at 11:40 pm

    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…

    TelephonyManager TelephonyMgr = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
    String szImei = TelephonyMgr.getDeviceId(); // Requires READ_PHONE_STATE
    
    String m_szDevIDShort = "35" + //we make this look like a valid IMEI
    Build.BOARD.length()%10+ Build.BRAND.length()%10 +
    Build.CPU_ABI.length()%10 + Build.DEVICE.length()%10 +
    Build.DISPLAY.length()%10 + Build.HOST.length()%10 +
    Build.ID.length()%10 + Build.MANUFACTURER.length()%10 +
    Build.MODEL.length()%10 + Build.PRODUCT.length()%10 +
    Build.TAGS.length()%10 + Build.TYPE.length()%10 +
    Build.USER.length()%10 ; //13 digits
    
    
    WifiManager wm = (WifiManager)getSystemService(Context.WIFI_SERVICE);
    
    BluetoothAdapter m_BluetoothAdapter = null; // Local Bluetooth adapter
    m_BluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    String m_szBTMAC = m_BluetoothAdapter.getAddress();
    String m_szWLANMAC = wm.getConnectionInfo().getMacAddress();
    
    
    String m_szLongID = m_szImei + m_szDevIDShort + m_szWLANMAC + m_szBTMAC;
    // compute md5
    MessageDigest m = null;
    try {
         m = MessageDigest.getInstance("MD5");
    } catch (NoSuchAlgorithmException e) {
    e.printStackTrace();
    }
    
    m.update(m_szLongID.getBytes(),0,m_szLongID.length());
    // get md5 bytes
    byte p_md5Data[] = m.digest();
    // create a hex string
    String m_szUniqueID = new String();
    
    for (int i=0;i<p_md5Data.length;i++) {
            int b = (0xFF & p_md5Data[i]);
    // if it is a single digit, make sure it have 0 in front (proper padding)
    if (b <= 0xF) m_szUniqueID+="0";
    // add number to string
         m_szUniqueID+=Integer.toHexString(b);
    }
    
    // hex string to uppercase
    m_szUniqueID = m_szUniqueID.toUpperCase();
    

    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:

    • Its not vary on consecutive generation on same device which mean one device will have only one ID and i.e. Unique.
    • Even work with non registered device i.e. device without IMEI numbers.
    • works with Tablet too.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a web application (ASP.NET) game that would consist of a
I'm currently working on a database-heavy, line-of-business Rails application for insurance brokers that is
I'm working with an application which uses wcf and sharp architecture, I'm trying to
I am working on architecture of mid sized web application & for my DAL
I'm working on a web application project using ASP.NET MVC3 and database in SQL
I am working on an ASP.Net MVC application, and its architecture consists of the
My question is related to Architecture of the Application on which am working right
I am working on a SOA Architecture. So I donot have access to database.
I have a database working in my local sql server 2005 express edition. I
Does anybody have an example of working with database using Visual C++ and OLEDB?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.