本文整理匯總了Java中com.microsoft.windowsazure.mobileservices.TableQueryCallback類的典型用法代碼示例。如果您正苦於以下問題:Java TableQueryCallback類的具體用法?Java TableQueryCallback怎麽用?Java TableQueryCallback使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TableQueryCallback類屬於com.microsoft.windowsazure.mobileservices包,在下文中一共展示了TableQueryCallback類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: refreshItemsFromTable
import com.microsoft.windowsazure.mobileservices.TableQueryCallback; //導入依賴的package包/類
/**
* Refresh the list with the items in the Mobile Service Table
*/
private void refreshItemsFromTable() {
// Get the items that weren't marked as completed and add them in the
// adapter
mToDoTable.where().field("complete").eq(val(false)).execute(new TableQueryCallback<ToDoItem>() {
public void onCompleted(List<ToDoItem> result, int count, Exception exception, ServiceFilterResponse response) {
if (exception == null) {
mAdapter.clear();
for (ToDoItem item : result) {
mAdapter.add(item);
}
} else {
createAndShowDialog(exception, "Error");
}
}
});
}
示例2: load
import com.microsoft.windowsazure.mobileservices.TableQueryCallback; //導入依賴的package包/類
@Override
public void load(final QueryOperationCallback<E> callback) {
table.execute(new TableQueryCallback<E>() {
@Override
public void onCompleted(List<E> dataList, int arg1,
Exception exception, ServiceFilterResponse arg3) {
if (exception == null) {
callback.onQueryComplete(dataList);
} else {
operations.onException(exception,
StorageOperation.EXTERNAL_LOAD);
}
}
});
}
開發者ID:Fuxingloh,項目名稱:Internal-External-Storage-Synchronization,代碼行數:17,代碼來源:AzureMobileServiceStorage.java
示例3: getFriends
import com.microsoft.windowsazure.mobileservices.TableQueryCallback; //導入依賴的package包/類
public void getFriends() {
mFriendTable.where().execute(new TableQueryCallback<Friend>() {
@Override
public void onCompleted(List<Friend> results, int count, Exception ex,
ServiceFilterResponse response) {
boolean wasSuccess = false;
if (ex != null) {
if (NoNetworkConnectivityException.class.isInstance(ex))
return;
LensRocketLogger.e(TAG, "Error getting friends: " + ex.getCause().getMessage());
} else {
LensRocketLogger.i(TAG, "Friends received");
wasSuccess = true;
mFriends = results;
//Insert self as friend
Friend self = Friend.getSelfFriend(mUsername, mClient.getCurrentUser().getUserId());
mFriends.add(0, self);
//Broadcast that we've updated our friends list
Intent broadcast = new Intent();
broadcast.putExtra(Constants.FRIENDS_UPDATE_STATUS, wasSuccess);
broadcast.setAction(Constants.BROADCAST_FRIENDS_UPDATED);
mContext.sendBroadcast(broadcast);
}
}
});
}
示例4: getRockets
import com.microsoft.windowsazure.mobileservices.TableQueryCallback; //導入依賴的package包/類
public void getRockets() {
LensRocketLogger.i(TAG, "Getting rockets from server");
mRocketTable.where().execute(new TableQueryCallback<Rocket>() {
@Override
public void onCompleted(List<Rocket> results, int count, Exception ex,
ServiceFilterResponse response) {
boolean wasSuccess = false;
if (ex != null) {
if (NoNetworkConnectivityException.class.isInstance(ex))
return;
LensRocketLogger.e(TAG, "Error getting rocket: " + ex.getCause().getMessage());
} else {
LensRocketLogger.i(TAG, "Rockets received");
wasSuccess = true;
mRockets = results;
}
LensRocketLogger.i(TAG, "Sending broadcast");
Intent broadcast = new Intent();
broadcast.putExtra(Constants.ROCKETS_UPDATE_STATUS, wasSuccess);
broadcast.setAction(Constants.BROADCAST_ROCKETS_UPDATED);
mContext.sendBroadcast(broadcast);
}
});
}
示例5: getPreferences
import com.microsoft.windowsazure.mobileservices.TableQueryCallback; //導入依賴的package包/類
/***************************************************************/
public void getPreferences() {
mUserPreferencesTable.where().execute(new TableQueryCallback<UserPreferences>() {
@Override
public void onCompleted(List<UserPreferences> results, int count,
Exception ex, ServiceFilterResponse serverFilterResponse) {
if (ex != null) {
if (NoNetworkConnectivityException.class.isInstance(ex))
return;
LensRocketLogger.e(TAG, "Error getting user preferences: " + ex.getCause().getMessage());
} else {
if (results == null || results.size() == 0) {
LensRocketLogger.e(TAG, "Error getting user preferences: No results returned");
return;
} else {
mUserPrefs = results.get(0);
mBackupPrefs = mUserPrefs.getCopy();
//Update local shared preferences with preferences pulled down
SharedPreferences settingsPrefs = PreferenceManager.getDefaultSharedPreferences(mContext);
SharedPreferences.Editor preferencesEditor = settingsPrefs.edit();
preferencesEditor.putString(mContext.getResources().getString(R.string.email_address), mUserPrefs.getEmail());
preferencesEditor.commit();
//Broadcast that we've updated our user preferences
LensRocketLogger.i(TAG, "Preferences downloaded");
Intent broadcast = new Intent();
broadcast.setAction(Constants.BROADCAST_USER_PREFERENCES_UPDATED);
mContext.sendBroadcast(broadcast);
}
}
}
});
}