Skip to content

Android Library for Force User to Update The Application

Notifications You must be signed in to change notification settings

Harin-Kaklotar/ForceUpdateApp

Repository files navigation

  1. To add this library to your app, initially download the ForceUpdate library to the root folder of your app.
  2. Add the following line to your settings.gradle file
    include ':app',':forceupdate'
  3. Now go to app build.gradle and add the following line.
    implementation project(':forceupdate')
  4. Sync library and you're good to go.

Initiate ForceUpate class in your MainActivity

ForceUpdate forceUpdate = new ForceUpdate(MainActivity.this);
        forceUpdate.setCanceledOnTouchOutside(false);
        forceUpdate.setTitle("New Update Available");
        forceUpdate.setMessage("Download this Update for New Features");
        forceUpdate.build();

Available Methods in this ForceUpdate Class:

Upadte Dialog dismiss when user touches the ui other than dialog.

setCanceledOnTouchOutside(boolean canceledOnTouchOutside)

Dialog will dismiss only if user taps any one of the button.

setCanceled(boolean canceled)

Set custom title for the Update Dialog.

setTitle(String title)

Set Custom Message to show to the user.

setMessage(String message)

Sample Screenshot:

AndroidAppForceUpdate

Note:

  1. This library will work only when the application is connected to the internet.
  2. Internet permissions are already added to the library manifest file.

About

Android Library for Force User to Update The Application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages