android - 使用 Azure 数据库的 Android Azure 移动服务

标签 android wcf mobile azure

我已经使用 Windows Azure 构建了一个数据库,当前的目标是使用移动服务在 Android 应用程序中查询该数据库。

我构建了一个 WCF 服务,它给了我想要的结果,然后意识到您可以直接在 Azure 站点上创建移动服务。在 Azure 上创建移动服务并告诉它使用我的 Azure 数据库后,我没有看到任何地方可以编写该服务用于返回数据的查询。我还需要 WCF 服务吗?我是否以某种方式将其上传到 Azure 移动服务中?我可能在这里遗漏了一些简单的东西。

最佳答案

检查this出去。请参阅“更新应用以使用移动服务访问数据”部分。

private MobileServiceClient mClient;
private private MobileServiceTable<ToDoItem> mToDoTable;

mClient = new MobileServiceClient("MobileServiceUrl", "AppKey", this)
                                      .withFilter(new ProgressFilter());
mToDoTable = mClient.getTable(ToDoItem.class);

mToDoTable.where().field("complete").eq(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");
            }
    }
});

另外,请参阅此 blog post .

关于android - 使用 Azure 数据库的 Android Azure 移动服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17516650/

相关文章:

java - 在 Android Studio 中将 "java"目录重命名为 "kotlin"

.net - WCF Web 服务请求 : Add a Reference tag instead of KeyIdentifier tag in SecurityTokenReference

AngularJS 设置 SSL header

javascript - 如何将网站上的图片保存到手机相册?

jQuery 移动 : Changing button text when the button is clicked

android - Flutter-将数据从 child 传递到 parent 和另一个 child

java - 如何检查字符串中的逻辑运算符或将字符串转换为Java中的代码

android - 在针对 Android 1.6 SDK 的同时为 Android 1.5 设备构建应用程序有多安全?

java - Chris Banes实现ActionBar-PulltoRefresh,库错误等

.net - 没有端点监听 net.pipe ://localhost/