本文整理汇总了Java中com.github.javiersantos.appupdater.AppUpdater类的典型用法代码示例。如果您正苦于以下问题:Java AppUpdater类的具体用法?Java AppUpdater怎么用?Java AppUpdater使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AppUpdater类属于com.github.javiersantos.appupdater包,在下文中一共展示了AppUpdater类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkForUpdate
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
public void checkForUpdate() {
//Check for update
new AppUpdater(this)
.setUpdateFrom(UpdateFrom.XML)
.setUpdateXML("https://raw.githubusercontent.com/Bella-Assistant/Bella-Android/alpha/update-changelog.xml")
.setTitleOnUpdateNotAvailable("Update not available")
.setContentOnUpdateNotAvailable("No update available. Check for updates again later!")
.setDisplay(com.github.javiersantos.appupdater.enums.Display.DIALOG)
.showAppUpdated(true)
.start();
}
示例2: onCreate
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);
Preference prefCheckForUpdates = findPreference("prefCheckForUpdates");
prefCheckForUpdates.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
new AppUpdater(SettingsActivity.this)
//.setUpdateFrom(UpdateFrom.GITHUB)
//.setGitHubUserAndRepo("javiersantos", "AppUpdater")
.setUpdateFrom(UpdateFrom.XML)
.setUpdateXML("https://raw.githubusercontent.com/javiersantos/AppUpdater/master/app/update-changelog.xml")
.setDisplay(Display.DIALOG)
.showAppUpdated(true)
.start();
return true;
}
});
}
示例3: appCheckNotification
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
public static void appCheckNotification(Context context){
if (Prefs.getBoolean("show_update_notif", true, context)) {
new AppUpdater(context)
.setDisplay(Display.NOTIFICATION)
.setUpdateFrom(UpdateFrom.JSON)
.setIcon(R.drawable.logo)
.setUpdateJSON(context.getString(R.string.appupdater_json))
.start();
}
}
示例4: appCheckDialog
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
public static void appCheckDialog(Context context){
if (Prefs.getBoolean("show_update_notif", true, context)) {
new AppUpdater(context)
.setDisplay(Display.DIALOG)
.setUpdateFrom(UpdateFrom.JSON)
.setUpdateJSON(context.getString(R.string.appupdater_json))
.start();
}
}
示例5: appCheckDialogAllways
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
public static void appCheckDialogAllways(Context context){
new AppUpdater(context)
.setDisplay(Display.DIALOG)
.setUpdateFrom(UpdateFrom.JSON)
.setUpdateJSON(context.getString(R.string.appupdater_json))
.showAppUpdated(true)
.start();
}
示例6: onPostCreate
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
new AppUpdater(this.getApplicationContext())
.setUpdateFrom(UpdateFrom.GITHUB)
.setGitHubUserAndRepo("deletescape", "Control_Box_Android")
.setDisplay(Display.NOTIFICATION)
.showAppUpdated(false)
.start();
}
示例7: checkForUpdateNow
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
private void checkForUpdateNow() {
new AppUpdater(this)
.setUpdateFrom(UpdateFrom.JSON)
.setUpdateJSON("https://raw.githubusercontent.com/pazaan/600SeriesAndroidUploader/master/app/update.json")
.showAppUpdated(true) // Show a dialog, even if there isn't an update
.start();
}
示例8: checkForUpdateBackground
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
private void checkForUpdateBackground(int checkEvery) {
new AppUpdater(this)
.setUpdateFrom(UpdateFrom.JSON)
.setUpdateJSON("https://raw.githubusercontent.com/pazaan/600SeriesAndroidUploader/master/app/update.json")
.showEvery(checkEvery) // Only check for an update every `checkEvery` invocations
.start();
}
示例9: updatesCheck
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
@DebugLog
public void updatesCheck(Context context) {
appUpdater = new AppUpdater(context)
.setUpdateFrom(UpdateFrom.GITHUB)
.setGitHubUserAndRepo("out386", "AndroidFileHost_Browser")
.showAppUpdated(false)
.setDisplay(Display.DIALOG);
appUpdater.start();
}
示例10: checkLatestVersion
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
private void checkLatestVersion() {
AppUpdater appUpdater = new AppUpdater(this)
.setTitleOnUpdateAvailable(R.string.update_available)
.setContentOnUpdateAvailable(R.string.update_available_description)
.setButtonUpdate(R.string.ok)
.setButtonDismiss(R.string.cancel)
.setButtonDoNotShowAgain(R.string.never)
.showEvery(1)
.setIcon(R.mipmap.ic_launcher);
appUpdater.start();
}
示例11: checkForUpdates
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
private void checkForUpdates() {
// Remove this for store builds!
// UpdateManager.register(this, ImApp.HOCKEY_APP_ID);
//only check github for updates if there is no Google Play
if (!hasGooglePlay()) {
try {
String version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
//if this is a full release, without -beta -rc etc, then check the appupdater!
if (version.indexOf("-") == -1) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
long timeNow = new Date().getTime();
long timeSinceLastCheck = prefs.getLong("updatetime", -1);
//only check for updates once per day
if (timeSinceLastCheck == -1 || (timeNow - timeSinceLastCheck) > 86400) {
AppUpdater appUpdater = new AppUpdater(this);
appUpdater.setDisplay(Display.DIALOG);
appUpdater.setUpdateFrom(UpdateFrom.XML);
appUpdater.setUpdateXML(ImApp.URL_UPDATER);
// appUpdater.showAppUpdated(true);
appUpdater.start();
prefs.edit().putLong("updatetime", timeNow).commit();
}
}
} catch (Exception e) {
Log.d("AppUpdater", "error checking app updates", e);
}
}
}
示例12: onCreate
import com.github.javiersantos.appupdater.AppUpdater; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int mUIFlag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
getWindow().getDecorView().setSystemUiVisibility(mUIFlag);
setContentView(R.layout.activity_home);
ButterKnife.bind(this);
new LocalJSONSource(this);
new RemoteJSONSource(this);
DisplayMetrics displayMetrics = this.getResources().getDisplayMetrics();
logo.bringToFront();
List<Map.Entry<String, Integer>> entries = new ArrayList<>(6);
for (int i = 0; i < 6; i++) {
Map.Entry<String, Integer> entry = new AbstractMap.SimpleEntry<>("", 0x0);
entries.add(entry);
}
wheelView.setWheelRadius(displayMetrics.widthPixels / 2);
wheelView.setWheelItemRadius(displayMetrics.widthPixels / 6);
wheelView.setOnWheelItemClickListener(new WheelView.OnWheelItemClickListener() {
@Override
public void onWheelItemClick(WheelView parent, int position, boolean isSelected) {
switch (position) {
case 0:
startActivity(new Intent(HomeActivity.this, SponsorsActivity.class));
break;
case 1:
startActivity(new Intent(HomeActivity.this, GalleryActivity.class));
break;
case 2:
startActivity(new Intent(HomeActivity.this, HospitalityActivity.class));
break;
case 3:
if (firebaseUser == null)
startActivity(new Intent(HomeActivity.this, LoginActivity.class));
else
startActivity(new Intent(HomeActivity.this, ProfileActivity.class));
break;
case 4:
startActivity(new Intent(HomeActivity.this, EventsActivity.class));
break;
case 5:
startActivity(new Intent(HomeActivity.this, ScheduleActivity.class));
break;
}
}
});
wheelView.setAdapter(new WheelAdapter(entries));
moveClouds();
spinArrow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
wheelView.setSelected(ThreadLocalRandom.current().nextInt(0, 5 + 1));
}
});
AppUpdater appUpdater = new AppUpdater(this);
appUpdater.setUpdateFrom(UpdateFrom.GITHUB)
.setGitHubUserAndRepo("adithya321", "Instincts")
.start();
}