Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Android Unique Identificatin Numer
WhatsApp
Chintan Rathod
12y
7.8
k
0
0
25
Blog
DevideId.rar
Purpose
Some times, when we are integrate our android application with server, its requirement of server that it can identify every android device uniquely. So to do that, we will learn how to get android id from device.
Android Id
A 64-bit number (as a hex string) that is randomly generated on the device's first boot and should remain constant for the lifetime of the device. (The value may change if a factory reset is performed on the device.)
Code
package com.did;
import android.app.Activity;
import android.os.Bundle;
import android.provider.Settings.Secure;
import android.util.Log;
public class DevideIdActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String android_id = Secure.getString(this.getContentResolver(),
Secure.ANDROID_ID);
Log.d("Android","Android ID : "+android_id);
}
}
Output
Android Unique Identificatin Numer
People also reading
Membership not found