Coder Social home page Coder Social logo

trendingtechnology / androidappupdater Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sirlordpouya/androidappupdater

0.0 1.0 0.0 1.47 MB

Android App Updater [specially for Iranian App Markets]

Home Page: https://heydarii.ir

License: Apache License 2.0

Kotlin 95.84% Java 4.16%

androidappupdater's Introduction

Android App Updater (specially for Iranian App markets)

Android Arsenal API Build Status

App Updater is a library to show update dialog to your users, whenever a new version of your application is available. It is really easy-to-use and fully customizable.

It is fully integrated with Kotlin and androidX

Releases

Current release:

Usage

Stores

you can show users as many stores as you need, to download your application from there. to make a new store :

    val list = ArrayList<UpdaterStoreList>()

    list.add(UpdaterStoreList(Store.DIRECT_URL, "Store Title", R.mipmap.ic_launcher , "https://url/app.apk", BuildConfig.APPLICATION_ID))

parameters of UpdaterStoreList, as the order you see in above line :

  1. Store type
  2. Store title that user sees
  3. Icon of store that user sees
  4. An url to show the user if the store is not installed in user's device
  5. Package name of your application
or you can omit adding some properties in Kotlin
    list.add(UpdaterStoreList(Store.GOOGLE_PLAY, "Download From Google Play", packageName = BuildConfig.APPLICATION_ID))

Available stores

this library currently supports only these markets :

Google Play

CafeBazaar

IranApps

Myket

To Select an Store you should use :

    Store.GOOGLE_PLAY
    Store.CAFE_BAZAAR
    Store.MYKET
    Store.IRAN_APPS

Direct Download

you can also make as many direct APK download links as you need. Users can download that APK directly on their phone, and after downloading finishes, the install page will be shown to the user.

Remember to get WRITE_EXTERNAL_STORAGE permission in runtime (the library tries to get it if you forget ;) )
    list.add(UpdaterStoreList(Store.DIRECT_URL, "Direct Download",R.mipmap.ic_launcher , "https://cafebazaar.ir/download/bazaar.apk", BuildConfig.APPLICATION_ID))

To Show UpdateDialog

    AppUpdaterDialog.getInstance("New Update!!!!", "Lots of new features!! upgrade yo the new version.", list, true, font).show(supportFragmentManager, "TAG")

parameters as the order you see in above line :

  1. Update dialog title
  2. Update dialog description
  3. List of stores you created in last step
  4. Is it a force update? (should dialog be cancelable or not)
  5. Typeface to customize font style

To change library's texts

In strings file, add these lines :

    <string name="please_wait">Please wait</string>
    <string name="downloading_new_version">Downloading new version...</string>
    <string name="download_notification_title">Downloading...</string>
    <string name="download_notification_description">Downloading new version</string>
    <string name="please_install">Please install</string>
    <string name="or">or</string>
    <string name="download_from_store">Download from store</string>

To use default icons

I have added default icons of Iranian stores in the app. if you like to use them, you can find them like :

    R.drawable.appupdater_ic_google_play
    R.drawable.appupdater_ic_bazar
    R.drawable.appupdater_ic_myket
    R.drawable.appupdater_ic_iran_apps

Download

Adding the dependency

Add this to your root build.gradle file:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Now add the dependency to your app build.gradle file:

    implementation 'com.github.SirLordPouya:AndroidAppUpdater:3.0.0'

License

LoadingFragment is released under the Apache License 2.0. See LICENSE for details.

Copyright (c) 2018 Pouya Heydari

Library's icon and style has designed by Amir Gerdakane

androidappupdater's People

Contributors

sirlordpouya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.