首页 文章

在进行Azure SQL查询时,Android应用程序崩溃

提问于
浏览
-1

任何帮助是极大的赞赏 . 我使用适用于Android Studio的Microsoft Azure Mobile SDK为我的Android应用程序创建了一个后端 . 但是当我尝试使用查询从服务器获取数据时,应用程序会挂起并崩溃 . 我的代码如下:

//The variables
private MobileServiceClient mClient;
private MobileServiceTable<Item> table;

//In onCreate method
try {
    mClient = new MobileServiceClient("https://myapp.azurewebsites.net", this);
} catch (MalformedURLException e) {
    e.printStackTrace();
}
table = mClient.getTable("MyTable",Item.class);
try {
    final List<Item> result =  table.execute().get();//----App crashes here
} catch (MobileServiceException e) {
    e.printStackTrace();
}

1 回答

相关问题