GPVersionChecker


Source link: https://github.com/robohorse/gpversionchecker

GPVersionChecker

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.4.0'

or

add it to your build.gradle with:

allprojects {

  repositories {

jcenter()

maven {
 url "https://jitpack.io" 
}

  
}
 
}

and:

 compile 'com.github.robohorse:gpversionchecker:1.4.0'
  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>

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" />

• 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.

Resources

RoboAspectJ is a Gradle plugin to introduce AspectJ (Aspect-Orient Programming) to Android project. It compiles aspects(if needed) and weave them all together in FULL-PROJECT scope. This means project (or subproject) sources, external libraries and local dependencies will all be dealt with by default.

Lightweight thrift client code generator and runtime library for Android and Java.

ListView with a sticky header.

Simple tool which help you to implement A/B Test.

A Gradle plugin that allows you to use Facebook's Redex tool as part of your build process.

Live Audio Equalizer with wave effect.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes