本文整理汇总了Java中com.google.samples.apps.iosched.sync.userdata.UserDataSyncHelperFactory.buildSyncHelper方法的典型用法代码示例。如果您正苦于以下问题:Java UserDataSyncHelperFactory.buildSyncHelper方法的具体用法?Java UserDataSyncHelperFactory.buildSyncHelper怎么用?Java UserDataSyncHelperFactory.buildSyncHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.samples.apps.iosched.sync.userdata.UserDataSyncHelperFactory
的用法示例。
在下文中一共展示了UserDataSyncHelperFactory.buildSyncHelper方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doUserDataSync
import com.google.samples.apps.iosched.sync.userdata.UserDataSyncHelperFactory; //导入方法依赖的package包/类
/**
* Checks if there are changes on User's Data to sync with/from remote AppData folder.
*
* @return Whether or not data was changed.
* @throws IOException if there is a problem uploading the data.
*/
private boolean doUserDataSync(String accountName) throws IOException {
if (!isOnline()) {
LOGD(TAG, "Not attempting userdata sync because device is OFFLINE");
return false;
}
LOGD(TAG, "Starting user data sync.");
AbstractUserDataSyncHelper helper = UserDataSyncHelperFactory.buildSyncHelper(
mContext, accountName);
boolean modified = helper.sync();
if (modified) {
// Schedule notifications for the starred sessions.
Intent scheduleIntent = new Intent(
SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS,
null, mContext, SessionAlarmService.class);
mContext.startService(scheduleIntent);
}
return modified;
}
示例2: doUserScheduleSync
import com.google.samples.apps.iosched.sync.userdata.UserDataSyncHelperFactory; //导入方法依赖的package包/类
/**
* Checks if there are changes on MySchedule to sync with/from remote AppData folder.
*
* @return Whether or not data was changed.
* @throws IOException if there is a problem uploading the data.
*/
private boolean doUserScheduleSync(String accountName) throws IOException {
if (!isOnline()) {
LOGD(TAG, "Not attempting myschedule sync because device is OFFLINE");
return false;
}
LOGD(TAG, "Starting user data (myschedule) sync.");
AbstractUserDataSyncHelper helper = UserDataSyncHelperFactory.buildSyncHelper(
mContext, accountName);
boolean modified = helper.sync();
if (modified) {
// schedule notifications for the starred sessions
Intent scheduleIntent = new Intent(
SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS,
null, mContext, SessionAlarmService.class);
mContext.startService(scheduleIntent);
}
return modified;
}
示例3: doUserDataSync
import com.google.samples.apps.iosched.sync.userdata.UserDataSyncHelperFactory; //导入方法依赖的package包/类
/**
* Checks if there are changes on User's Data to sync with/from remote AppData folder.
*
* @return Whether or not data was changed.
* @throws IOException if there is a problem uploading the data.
*/
private boolean doUserDataSync(SyncResult syncResult) throws IOException {
if (!ConnectivityUtils.isConnected(mContext)) {
LOGD(TAG, "Not attempting userdata sync because device is OFFLINE");
return false;
}
String accountName = AccountUtils.getActiveAccountName(mContext);
if (TextUtils.isEmpty(accountName)) {
LOGD(TAG, "Not attempting userdata sync because user is not signed in");
return false;
}
LOGD(TAG, "Starting user data sync.");
AbstractUserDataSyncHelper helper = UserDataSyncHelperFactory.buildSyncHelper(
mContext, accountName);
boolean modified = helper.sync();
if (modified) {
// Schedule notifications for the starred sessions.
Intent scheduleIntent = new Intent(
SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS,
null, mContext, SessionAlarmService.class);
mContext.startService(scheduleIntent);
}
syncResult.stats.numIoExceptions += helper.getIoExcpetions();
return modified;
}