Java源码示例:com.xiaomi.market.sdk.XiaomiUpdateAgent
示例1
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.new_main);
mNoSourceNotified = false;
Fragment f = getSupportFragmentManager().findFragmentByTag(PANEL_TAG);
if(f==null){
mPanel = new PanelFragment();
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_panel, mPanel, PANEL_TAG)
.commit();
}else{
mPanel = (PanelFragment)f;
}
mPanel.setInitListener(this);
mEntries = showDefaultEntries(false);
XiaomiUpdateAgent.update(this);
}
示例2
public static void checkXiaomiApkUpdate(Activity activity, boolean flag, String s)
{
Debug.i("Utils", "checkXiaomiApkUpdate");
XiaomiUpdateAgent.setUpdateAutoPopup(false);
XiaomiUpdateAgent.setUpdateListener(new i(activity, s, flag));
XiaomiUpdateAgent.update(activity);
}
示例3
@Override
public void onCreate() {
super.onCreate();
SoundBarORM.addSetting(this, SoundBarORM.TryConnectCount, "2");
Intent iDataIntent = new Intent("com.xiaomi.mitv.idata.server.INTENT_DATA_COLLECTION");
startService(iDataIntent);
boolean forcescanbluetooth = false;
final String boot_start = SoundBarORM.getSettingValue(getApplicationContext(), "boot_start");
if(boot_start != null && boot_start.equals("1")){
forcescanbluetooth = true;
Log.d("SoundBarApplication", "will start run soundbar service after 60 seconds, if you want change, please change the databases ");
}
//start sound bar service to keep the sound bar connection
final String value = SoundBarORM.getSettingValue(getApplicationContext(), SoundBarORM.supportMultiConnection);
if(forcescanbluetooth || (value != null && value.equals("1"))){
//one minutes later
final int boot_delay_seconds_count = SoundBarORM.getIntValue(getApplicationContext(), SoundBarORM.boot_delay_seconds_count, 80);
}
BTDeviceMonitor.listen(getApplicationContext());
XiaomiUpdateAgent agent = new XiaomiUpdateAgent();
MobclickAgent.openActivityDurationTrack(false);
}