public class VersionHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION_MAX |
Constructor and Description |
---|
VersionHelper(android.content.Context context,
java.lang.String infoJSON,
UpdateInfoListener listener) |
Modifier and Type | Method and Description |
---|---|
static int |
compareVersionStrings(java.lang.String left,
java.lang.String right)
Compare two versions strings with each other by splitting at the .
|
java.lang.String |
getFileDateString() |
long |
getFileSizeBytes() |
java.lang.String |
getReleaseNotes(boolean showRestore) |
java.lang.String |
getVersionString() |
static boolean |
isNewerThanLastUpdateTime(android.content.Context context,
long timestamp)
Returns true of the given timestamp is larger / newer than the last modified timestamp of
the APK file of the app.
|
static java.lang.String |
mapGoogleVersion(java.lang.String version)
Map internal Google version letter to a semantic version (currently L to 5.0, M to 6.0).
|
public static final java.lang.String VERSION_MAX
public VersionHelper(android.content.Context context, java.lang.String infoJSON, UpdateInfoListener listener)
public java.lang.String getVersionString()
public java.lang.String getFileDateString()
public long getFileSizeBytes()
public java.lang.String getReleaseNotes(boolean showRestore)
public static int compareVersionStrings(java.lang.String left, java.lang.String right)
left
- A version string, e.g. "2.1".right
- A version string, e.g. "4.2.2".public static boolean isNewerThanLastUpdateTime(android.content.Context context, long timestamp)
context
- the context to usetimestamp
- a Unix-style timestamppublic static java.lang.String mapGoogleVersion(java.lang.String version)
version
- value of Build.VERSION.RELEASE