Skip to content

Android Library for checking the current uploaded version on the Google Play

License

Notifications You must be signed in to change notification settings

morristech/gpversionchecker

 
 

Repository files navigation

GPVersionChecker

Android Arsenal

Android Library for checking the current uploaded version on the Google Play

#Quick start

  1. Just add this dependency into your build.gradle
compile 'com.robohorse.gpversionchecker:gpversionchecker:1.0.8'

or

add it to your build.gradle with:

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

and:

 compile 'com.github.robohorse:gpversionchecker:1.0.8'
  1. Add
  new GPVersionChecker.Builder(this).create();

into your Activity.java

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        new GPVersionChecker.Builder(this).create();
    }

Now you can see this awesome dialog window:

This library does not produce memory leaks - all context usages are leak-safe.

#Customization

• Dialog window customization

You can override string resource, that you want:

    <string name="app_name">GPVersionChecker</string>

    <string name="gpvch_header">New version is available!</string>
    <string name="gpvch_button_positive">Update current version</string>
    <string name="gpvch_button_negative">Remind me later</string>
    <string name="gpvch_new_version_info_title">Whats new:</string>

also, you can override dimensions for default dialog window

    <dimen name="gpvch_app_icon_margin">10dp</dimen>

    <dimen name="gpvch_tv_version_code_margin_left">5dp</dimen>
    <dimen name="gpvch_tv_version_code_margin_right">5dp</dimen>
    <dimen name="gpvch_tv_version_code_margin_top">10dp</dimen>

    <dimen name="gpvch_tv_header_whats_new">5dp</dimen>

    <dimen name="gpvch_tv_changes_margin_left">5dp</dimen>
    <dimen name="gpvch_tv_changes_margin_right">5dp</dimen>
    <dimen name="gpvch_tv_changes_margin_bottom">10dp</dimen>

    <integer name="gpvch_tv_changes_max_lines">4</integer>

image by overriding gpvch_app_icon.xml

   <?xml version="1.0" encoding="utf-8"?>
   <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/ic_launcher" />

or colors

    <color name="gpvch_dialog_text_color">@color/gpvch_black</color>

• Version checking strategy

Add this to builder, and dialog will be shown once in day

.setCheckingStrategy(CheckingStrategy.ONE_PER_DAY)

• Usage info response only

The following code will block showing of the default dialog window, but gives information about current uploaded version

 new GPVersionChecker.Builder(this)
                .setVersionInfoListener(new VersionInfoListener() {
                   
                    @Override
                    public void onResulted(Version version) {
                        
                    }
                })
                .create();

#ProGuard Add the following to proguard-project.txt:

-keep public class org.jsoup.** {
public *;
}

#About Copyright 2016 Vadim Shchenev, and licensed under the MIT license. No attribution is necessary but it's very much appreciated. Star this project if you like it.

About

Android Library for checking the current uploaded version on the Google Play

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 98.4%
  • HTML 1.6%