助けが必要です。単純な問題のように思えますが、数日で立ち往生しています。Android アプリからのデータを永続化するために Azure Mobile サービスを使用しようとしています。私が今抱えている問題は、Azure データベース テーブルの列に対応するいくつかのフィールドを持つデータ転送オブジェクトがあることです。これは単純なテーブルで、すべての手順を実行しています...何が間違っていますか?
package com.bn7.rotabn7;
import java.net.MalformedURLException;
import com.microsoft.windowsazure.mobileservices.*;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
public class MainActivity extends Activity {
private MobileServiceClient mClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try {
mClient = new MobileServiceClient(
"https://ocamorana.azure-mobile.net/",
"hCzcrsFYhkGmxPvQDNxyqBXjZwjXlK99",
this
);
Item item = new Item();
item.IdPhone = "Awesome item";
item.DateTimePhone = "Awesome item";
item.LatitudePhone = -43;
item.LongetudePhone = -23;
item.ActivePhone = false;
mClient.getTable(Item.class).insert(item, new TableOperationCallback<Item>() {
public void onCompleted(Item entity, Exception exception, ServiceFilterResponse response) {
if (exception == null) {
// Insert succeeded
} else {
// Insert failed
Log.d("Insert failed", "*---------------------------------------------------------------*");
Log.d("Insert failed", "Error in activity", exception); // log the error
Log.d("Insert failed", "*---------------------------------------------------------------*");
}
}
});
} catch (MalformedURLException e) {
Log.d("MalformedURLException", e.toString());
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
package com.bn7.rotabn7;
public class Item {
public int Id;
public String IdPhone;
public String DateTimePhone;
public double LatitudePhone;
public double LongetudePhone;
public boolean ActivePhone;
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bn7.rotabn7"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
<uses-permission android:name="INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.bn7.rotabn7.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
アクティビティ om.microsoft.windowsazure.mobileservices.MobileServiceException のエラー: 要求の処理中にエラーが発生しました。com.microsoft.windowsazure.mobileservices.MobileServiceConnection$1.onNext(MobileServiceConnection.java:121) com.microsoft.windowsazure.mobileservices.MobileServiceClient$4.handleRequest(MobileServiceClient.java:429) com.microsoft.windowsazure.mobileservices.MobileServiceConnection.start( MobileServiceConnection.java:92) com.microsoft.windowsazure.mobileservices.RequestAsyncTask.doInBackground(RequestAsyncTask.java:77) com.microsoft.windowsazure.mobileservices.RequestAsyncTask.doInBackground(RequestAsyncTask.java:1) android.os.AsyncTask$2.call (AsyncTask.java:185) java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306) java.util.concurrent.FutureTask.run(FutureTask.java: -------------------------------------------------- -------------