当前位置: 首页>>代码示例>>Java>>正文


Java AppUpdater类代码示例

本文整理汇总了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();
}
 
开发者ID:NullPointersInc,项目名称:Bella-Android,代码行数:12,代码来源:MainActivity.java

示例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;
        }
    });

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:SettingsActivity.java

示例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();
    }
}
 
开发者ID:morogoku,项目名称:MTweaks-KernelAdiutorMOD,代码行数:11,代码来源:AppUpdaterTask.java

示例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();
    }
}
 
开发者ID:morogoku,项目名称:MTweaks-KernelAdiutorMOD,代码行数:10,代码来源:AppUpdaterTask.java

示例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();
}
 
开发者ID:morogoku,项目名称:MTweaks-KernelAdiutorMOD,代码行数:9,代码来源:AppUpdaterTask.java

示例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();
}
 
开发者ID:deletescape,项目名称:Control_Box_Android,代码行数:11,代码来源:ControlBox.java

示例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();
}
 
开发者ID:pazaan,项目名称:600SeriesAndroidUploader,代码行数:8,代码来源:MainActivity.java

示例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();
}
 
开发者ID:pazaan,项目名称:600SeriesAndroidUploader,代码行数:8,代码来源:MainActivity.java

示例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();
}
 
开发者ID:out386,项目名称:AndroidFileHost_Browser,代码行数:10,代码来源:MainActivity.java

示例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();
}
 
开发者ID:juanjecilla,项目名称:FindMeAHome,代码行数:12,代码来源:ListActivity.java

示例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);
        }
    }
}
 
开发者ID:zom,项目名称:Zom-Android,代码行数:37,代码来源:MainActivity.java

示例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();
}
 
开发者ID:adithya321,项目名称:Instincts-2k17,代码行数:76,代码来源:HomeActivity.java


注:本文中的com.github.javiersantos.appupdater.AppUpdater类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。