Created
June 8, 2016 07:11
-
-
Save s0h4m/cd0610ac835d8e0a979262fd2c9f6be2 to your computer and use it in GitHub Desktop.
Generates an anonymous id for analytics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import java.util.UUID; | |
/** | |
* This generates an anonymous user id for analytics | |
*/ | |
public abstract class Id { | |
abstract public String getId(final Context context); | |
/** | |
* Returns a UUID powered Id, works on all android devices | |
* @return a UUID powered Id | |
*/ | |
protected String getUUIDPoweredId() { | |
return UUID.randomUUID().toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment