Issue
how to get an android device id in android 12
THIS is MY CODE
@SuppressLint("HardwareIds") String android_id = Secure.getString(getContext().getContentResolver(),
Secure.ANDROID_ID);
Solution
Here is my function.
@SuppressLint("HardwareIds")
public static String getDeviceId(Context context) {
return Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
}
Answered By - MA0225
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.