There is api in android for getting sd card serial id. The method is called getFatVolumeId(String mountPoint), where "mountPoint" is sd card name (you can get this name by calling Environment.getExternalStorageDirectory()). But getFatVolumeId is kindof hidden function (or forgotten), so you want to create package in your project named android.os and the class in it to reference the native method, to be able to call it:
package android.os;
public class FileUtils {
public static native int getFatVolumeId(String mountPoint);
}
And the code is:
File SdCard = Environment.getExternalStorageDirectory();
int Serial = FileUtils.getFatVolumeId(SdCard.getName());
package android.os;
public class FileUtils {
public static native int getFatVolumeId(String mountPoint);
}
And the code is:
File SdCard = Environment.getExternalStorageDirectory();
int Serial = FileUtils.getFatVolumeId(SdCard.getName());