Android User, never miss an Update.
UpdateChecker
is a class that can be used by Android Developers to increase the number of users update their apps by showing a "New Update Available" Notification or Dialog.
It's based on Fragments, It checks for new updates downloadable by parsing the Play Store desktop page of your app.
- Styled Dialogs
- android-support-v4.jar
- Check out the Demos folder
-
Import Styled Dialogs into the library.
-
Import android-support-v4.jar into the library.
-
Import the library into you app.
-
First, add INTERNET and ACCESS_NETWORK_STATE permissions to your app's Manifest:
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
-
So, in the class you want to use the library extend a
FragmentActivity
(or, obviously, aSherlockFragmentActivity
). -
To show a Play-Store-App-like notification if a new update was found:
UpdateChecker.checkForNotification(this);
-
To show a dialog if a new update was found:
UpdateChecker.checkForDialog(this);
##Important!
-
If there is a new update available, when app launched, not every time the Notification / Dialog will be shown. The Notification/Dialog will be shown every 5 times the app ascertain that a new update is available. It's a precaution to make the library not too invasive. To modify this, see Customization.
-
See Issue #1
##Customization
-
You can modify modify the number of checks after the dialog will be shown. Default is 5.
UpdateChecker.checkForNotification(this, 10); UpdateChecker.checkForDialog(this, 10);
-
You can modify the notification Drawable by calling a variant of checkForNotification(...) method:
UpdateChecker.checkForNotification(R.drawable.ic_launcher, this) UpdateChecker.checkForNotification(R.drawable.ic_launcher, this, 10)
- See How to style StyledDialogs, to customize the New update avaialble dialog:
##Contribution
If you have any questions regarding UpdateChecker, create an issue.
To create a new Feature request, open an issue here
I'll try to answer as soon as I find the time.
Feel free to contribute to UpdateChecker.
Either you found a bug or have created a new and awesome feature, just create a pull request.
Please note, if you're working on a pull request, make sure to use the develop branch as your base.
Join in the conversation, check it out the XDA Thread
- Support for apps not published on Google Play
- Stackoverflow tag for more specific code problems
- Preference to disable UpdateChecker
Author: Pietro Rampini - PiKo Technologies
![Follow me on Google+](https://github.com/gabrielemariotti/cardslib/raw/master/demo/images/g+64.png)
![Follow me on Twitter](https://github.com/gabrielemariotti/cardslib/raw/master/demo/images/twitter64.png)