How can I programatically read the SD Card\'s CID register, which contains a Serial Number and other information? Can I do it through Android Java, or Native code?
You can get it with the StorageManager.
Here is a sample-code:
final StorageManager storageManager = (StorageManager) activity.getSystemService(Context.STORAGE_SERVICE);
final List storageVolumes = storageManager.getStorageVolumes();
final UserHandle user = android.os.Process.myUserHandle();
for (StorageVolume storageVolume : storageVolumes) {
// "SDCARD" must be your sd-card name
if (storageVolume.getDescription(activity).equals("SDCARD")){
// the SD Card ID number
return storageVolume.getUuid();
}
}