Giter Site home page Giter Site logo

alemic / androidsmartupdates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from specialcyci/androidsmartupdates

0.0 3.0 0.0 360 KB

Android Smart Updates is an Open Source library that makes patch way update in android easily. And server is base on Ruby on Rails.

License: MIT License

Makefile 0.22% C 72.78% Java 27.01%

androidsmartupdates's Introduction

[Overview] AndroidSmartUpdates

Android Smart Updates is an Open Source library that makes patch way update(using bsdiff) in android easily.
And server is base on Ruby on Rails.
Link to server source code AndroidSmartUpdatesServer

Demo

Link to AndroidSmartUpdatesDemo

How to Install

Using IntelliJ:

  1. import the AndroidSmartUpdates as a module into your project.
  2. add AndroidSmartUpdates into module dependency for your main module.

Usage

  1. create an application in AndroidSmartUpdatesServer,and mark down the App ID.
  2. copy the files in the folder libs your main module directory.
  3. add below permission in your AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

4、add these codes to your activity's entrance.

    smartUpdates = new SmartUpdates(this);
    smartUpdates.setServerAddress("http://www.xxx.com/");
    smartUpdates.setApplicationId(YOUR_APP_ID);
    smartUpdates.checkForUpdate();

fill YOUR_APP_ID with App Id in step 1

Listen the Update Status

You can use the UpdateListener

smartUpdates.setShowUpdateDialog(false);
smartUpdates.setUpdateListener(updateListener);
smartUpdates.checkForUpdate();
private UpdateListener updateListener = new UpdateListener() {

    @Override
    public void hasUpdate(PatchInformation information) {
        Toast.makeText(context, "has update, version:" + information.getVersionName(),
                Toast.LENGTH_LONG).show();
        // start to update.
        smartUpdates.startUpdate();
    }

    @Override
    public void hasNoUpdate() {
        Toast.makeText(context, "no update", Toast.LENGTH_LONG).show();
    }
};

About Author

A student from SCAU China.
Email: specialcyci#gmail.com

androidsmartupdates's People

Contributors

specialcyci avatar

Watchers

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