The MACH Registration API requires that I send the device's unique ID. How do I generate a unique Device ID for each installation of my Android app?
Date
Votes
1 comment
-
CommzGate Support Here's a sample method you can use to generate a unique ID within Android.
public static String getDeviceID()
{
return "65" + //give a prefix code of your choosing
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
}
Please sign in to leave a comment.