UpdateFunfir.im 的 Android 更新下載模塊
UpdateFun更新庫
UpdateFun是一個fir.im的Android更新下載模塊,在fir.im上上傳自己的APP后接入該庫即可實現(xiàn)檢查更新下載
用法
Step 1
在gradle文件中加入下面的依賴:
dependencies {
compile 'cn.hugeterry.updatefun:updatefun:1.6.6'
}
如果你使用Maven,那么加入下面的依賴:
<dependency> <groupId>cn.hugeterry.updatefun</groupId> <artifactId>updatefun</artifactId> <version>1.6.6</version> <type>pom</type> </dependency>
Step 2
在Application(或者主界面activity中)的onCreate()中加上以下語句進行初始化:
UpdateKey.API_TOKEN = "寫上你fir.im賬號的API_TOKEN"; UpdateKey.APP_ID = "寫上APP的應(yīng)用ID"; //下載方式: //UpdateKey.DialogOrNotification=UpdateKey.WITH_DIALOG;通過Dialog來進行下載 //UpdateKey.DialogOrNotification=UpdateKey.WITH_NOTIFITION;通過通知欄來進行下載(默認) UpdateFunGO.init(this);
Step 3
在主界面Activity中加上以下語句:
@Override
protected void onResume() {
super.onResume();
UpdateFunGO.onResume(this);
}
@Override
protected void onStop() {
super.onStop();
UpdateFunGO.onStop(this);
}
大功告成,好好享用吧
評論
圖片
表情
