Giter Site home page Giter Site logo

msoftware / android-device-identification Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thomashaertel/android-device-identification

0.0 2.0 0.0 308 KB

Library for unique identification of an Android device. Provides also a backup solution

License: Apache License 2.0

Java 100.00%

android-device-identification's Introduction

Android Device Identification

Download Build Status

Library for unique identification of an Android device. Provides also a backup solution

Overview

TBD

Release Notes:

0.0.2

  • A secure preference store is used for holding the device specific data.
  • Backup manager helper added for backing up preferences and sqlite databases.

0.0.1

  • Initial import to github. I've added several ways to identify an android device.
  • device specific data is written to shared preferences.

Usage

To make use of the device identification you only need to add an DeviceIdentityProvider to your activity:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ...

    identityProvider = DeviceIdentityProvider.getInstance(this);

    // force backup for new device immediately
    if (identityProvider.isNewDevice()) {
        BackupManager backupManager = new BackupManager(this);
        backupManager.dataChanged();
    }

    ...
}

If you want automatically backup your application data to android backup service you need to add some snippets to the applications manifest an an activity:

<application android:backupAgent="com.thomashaertel.device.backup.SimpleBackupAgent" android:allowBackup="true" ...>
    <meta-data android:name="com.google.android.backup.api_key" android:value="your-api-key" />
    ...
</application>
@Override
protected void onStop() {
    // allow backup authorized devices only
    if (identityProvider.isAuthorizedDevice()) {
        BackupManager backupManager = new BackupManager(this);
        backupManager.dataChanged();
    }

    super.onStop();
}

Building

Gradle

From Bintray

Add maven central to your build.gradle:

buildscript {
  repositories {
    jcenter()
  }
}

repositories {
  jcenter()
}

From maven central

Add maven central to your build.gradle:

buildscript {
  repositories {
    mavenCentral()
  }
}

repositories {
  mavenCentral()
}

Then declare android-device-identification within your dependencies:

dependencies {
  ...
  compile('com.thomashaertel:android-device-identification :0.0.2@aar') {
  }
  ...
}

Maven

From maven central

To use android-device-identification within your maven build simply add

<dependency>
  <artifactId>android-device-identification </artifactId>
  <version>${android-device-identification .version}</version>
  <groupId>com.thomashaertel</groupId>
</dependency>

to your pom.xml

If you also want the sources or javadoc add the respective classifier

  <classifier>sources</classifier>

or

  <classifier>javadoc</classifier>

to the dependency.

Contributing

For making contributions please send me pull requests, but also bugs and enhancement requests are welcome. Although no guarantees on when I can review them.

License

android-device-identification's People

Contributors

thomashaertel avatar

Watchers

Michael jentsch avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.