本文整理汇总了Java中com.microsoft.windowsazure.mobileservices.ServiceFilterResponse类的典型用法代码示例。如果您正苦于以下问题:Java ServiceFilterResponse类的具体用法?Java ServiceFilterResponse怎么用?Java ServiceFilterResponse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServiceFilterResponse类属于com.microsoft.windowsazure.mobileservices包,在下文中一共展示了ServiceFilterResponse类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkItem
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的package包/类
/**
* Mark an item as completed
*
* @param item
* The item to mark
*/
public void checkItem(ToDoItem item) {
if (mClient == null) {
return;
}
// Set the item as completed and update it in the table
item.setComplete(true);
mToDoTable.update(item, new TableOperationCallback<ToDoItem>() {
public void onCompleted(ToDoItem entity, Exception exception, ServiceFilterResponse response) {
if (exception == null) {
if (entity.isComplete()) {
mAdapter.remove(entity);
}
} else {
createAndShowDialog(exception, "Error");
}
}
});
}
示例2: refreshItemsFromTable
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的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");
}
}
});
}
示例3: authenticate
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的package包/类
private void authenticate() {
// Login using the Google provider.
mClient.login(MobileServiceAuthenticationProvider.Google,
new UserAuthenticationCallback() {
@Override
public void onCompleted(MobileServiceUser user,
Exception exception, ServiceFilterResponse response) {
if (exception == null) {
createAndShowDialog(String.format(
"You are now logged in - %1$2s",
user.getUserId()), "Success");
createTable();
} else {
createAndShowDialog("You must log in. Login Required", "Error");
}
}
});
}
示例4: load
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的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
示例5: delete
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的package包/类
@Override
public void delete(E object, final ChangeOperationCallback<E> callback) {
table.delete(object, new TableDeleteCallback() {
@Override
public void onCompleted(Exception exception,
ServiceFilterResponse arg1) {
if (exception == null) {
callback.onComplete();
} else {
operations.onException(exception,
StorageOperation.EXTERNAL_DELETE);
}
}
});
}
开发者ID:Fuxingloh,项目名称:Internal-External-Storage-Synchronization,代码行数:20,代码来源:AzureMobileServiceStorage.java
示例6: getFriends
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的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);
}
}
});
}
示例7: getRockets
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的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);
}
});
}
示例8: tappedAddFriend
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的package包/类
public void tappedAddFriend(View view) {
LensRocketAlert.showToast(this, "Adding " + mCurrentName +"...");
mBtnAddFriend.setEnabled(false);
mLensRocketService.requestFriend(mCurrentName, new ApiOperationCallback<LensRocketRegisterResponse>() {
@Override
public void onCompleted(LensRocketRegisterResponse response, Exception ex,
ServiceFilterResponse arg2) {
LensRocketLogger.i(TAG, "Response received");
if (ex != null || response.Error != null) {
mBtnAddFriend.setEnabled(true);
if (ex != null) {
if (NoNetworkConnectivityException.class.isInstance(ex))
return;
LensRocketAlert.showSimpleErrorDialog(mActivity, ex.getCause().getMessage());
}
else
LensRocketAlert.showToast(mActivity, response.Error);
} else {
LensRocketAlert.showToast(mActivity, response.Status);
mBtnAddFriend.setVisibility(View.GONE);
mLensRocketService.getFriends();
}
}
});
}
示例9: addItem
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的package包/类
/**
* Add a new item
*
* @param view
* The view that originated the call
*/
public void addItem(View view) {
if (mClient == null) {
return;
}
// Create a new item
ToDoItem item = new ToDoItem();
item.setText(mTextNewToDo.getText().toString());
item.setComplete(false);
item.setHandle(MyHandler.getHandle());
// Insert the new item
mToDoTable.insert(item, new TableOperationCallback<ToDoItem>() {
public void onCompleted(ToDoItem entity, Exception exception, ServiceFilterResponse response) {
if (exception == null) {
if (!entity.isComplete()) {
mAdapter.add(entity);
}
} else {
createAndShowDialog(exception, "Error");
}
}
});
mTextNewToDo.setText("");
}
示例10: handleRequest
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的package包/类
@Override
public void handleRequest(ServiceFilterRequest request, NextServiceFilterCallback nextServiceFilterCallback,
final ServiceFilterResponseCallback responseCallback) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (mProgressBar != null) mProgressBar.setVisibility(ProgressBar.VISIBLE);
}
});
nextServiceFilterCallback.onNext(request, new ServiceFilterResponseCallback() {
@Override
public void onResponse(ServiceFilterResponse response, Exception exception) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (mProgressBar != null) mProgressBar.setVisibility(ProgressBar.GONE);
}
});
if (responseCallback != null) responseCallback.onResponse(response, exception);
}
});
}
示例11: addItem
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的package包/类
/**
* Add a new item
*
* @param view
* The view that originated the call
*/
public void addItem(View view) {
if (mClient == null) {
return;
}
// Create a new item
ToDoItem item = new ToDoItem();
item.setText(mTextNewToDo.getText().toString());
item.setComplete(false);
// Insert the new item
mToDoTable.insert(item, new TableOperationCallback<ToDoItem>() {
public void onCompleted(ToDoItem entity, Exception exception, ServiceFilterResponse response) {
if (exception == null) {
if (!entity.isComplete()) {
mAdapter.add(entity);
}
} else {
createAndShowDialog(exception, "Error");
}
}
});
mTextNewToDo.setText("");
}
示例12: getPreferences
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的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);
}
}
}
});
}
示例13: onClick
import com.microsoft.windowsazure.mobileservices.ServiceFilterResponse; //导入依赖的package包/类
@Override
public void onClick(View v) {
mBtnLogin.setVisibility(View.GONE);
mProgressLogin.setVisibility(View.VISIBLE);
mLensRocketService.loginUser(mTxtUsername.getText().toString(),
mTxtPassword.getText().toString(), new ApiOperationCallback<LensRocketRegisterResponse>() {
@Override
public void onCompleted(LensRocketRegisterResponse response, Exception exc,
ServiceFilterResponse arg2) {
LensRocketLogger.i(TAG, "onCompleted login");
if (exc != null || response.Error != null) {
mBtnLogin.setVisibility(View.VISIBLE);
mProgressLogin.setVisibility(View.GONE);
if (exc != null) {
if (NoNetworkConnectivityException.class.isInstance(exc))
return;
LensRocketAlert.showSimpleErrorDialog(mActivity, exc.getCause().getMessage());
}
else
LensRocketAlert.showSimpleErrorDialog(mActivity, response.Error);
} else {
mLensRocketService.setUserAndSaveData(response);
finish();
Intent intent = new Intent(mActivity, RecordActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}
}
});
}