Skip to content
Generate a 64-bit hex string as an unique Android ID
Kotlin
Branch: master
Clone or download
Latest commit ea86489 Dec 4, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper renamed class Nov 21, 2019
library small refactor Dec 4, 2019
sample renamed a few folders Nov 21, 2019
.gitignore renamed folders Nov 19, 2019
README.md small refactor Dec 4, 2019
build.gradle renamed class Nov 21, 2019
gradle.properties first commit Nov 19, 2019
gradlew first commit Nov 19, 2019
gradlew.bat first commit Nov 19, 2019
settings.gradle renamed a few folders Nov 21, 2019

README.md

Unique Device Id Provider

It's quite complex to have a way to get an unique identifier on android that's compatible with all android versions as you can see here

Keep in mind

This approach doesn't need any android permissions

if you wipe the app data it will generate a new unique ID

Usage

// create it (or provide it with a DI framework)
val idProvider = UniqueDeviceIdProvider(context) 

idProvider.getUniqueId() 
  // => ca705d9b-0598-4f75-b71a-973934160055

Install

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
  implementation 'com.github.cesarferreira:android-unique-device-id:1.0.1'
}

Licence

Copyright 2019 Cesar Ferreira

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You can’t perform that action at this time.