私がAzureテーブルのAzureテーブル(Azureテーブルの列)をクエリすると、nullが返されます。 log.i(TAG、 "ID" + item.id + "" + item.SEEDNAMEのオブジェクトを読み取る)のように、logcatに必要なデータを格納します。私は適切なIDと名前のnullを取得します。 私がリストビューにデータを追加すると、パッケージ名のように見えます。AzureテーブルがAzureテーブルのデータの代わりにListViewにパッケージ情報を与えました
public class Azuretbl {
public String id;
public String SEEDNAME;
public String SEEDTYPE;
public int SEED_AMOUNT;
} これはAzureのテーブルと一致するクライアントテーブルです。照会のための
コード:
public void viewFromAzure(){
button_view_from_azure = (Button)findViewById(R.id.btnViewDataFromAzure);
button_view_from_azure.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
final ArrayAdapter<Azuretbl> myAdapter = new ArrayAdapter<Azuretbl>
(getApplicationContext(), android.R.layout.simple_list_item_activated_1);
azure_list_view = (ListView) findViewById(R.id.listViewAzure);
azure_list_view.setAdapter(myAdapter);
new AsyncTask<Void, Void, MobileServiceList<Azuretbl>>(){
MobileServiceTable<Azuretbl> myTestAzuretbl = mClient.getTable(Azuretbl.class);
@Override
protected MobileServiceList<Azuretbl> doInBackground(Void... params) {
MobileServiceList<Azuretbl> result;
try {
result = myTestAzuretbl.where().field("SEEDNAME").eq("Tomato").execute().get();
/*where().field("SEEDNAME").eq("tomato").*/
final MobileServiceList<Azuretbl> finalResult = result;
runOnUiThread(new Runnable() {
@Override
public void run() {
myAdapter.clear();
for (Azuretbl item : finalResult) {
Log.i(TAG, "Read object with ID " + item.id + " " + item.SEEDNAME);
System.out.println("Item is " + finalResult);
myAdapter.add(item);
}
}
});
} catch (Exception exception) {
}
return null;
}
}.execute();
}
}
);
}
と私はlogcatでこれを取得する:クラウド Azure snapshot of table上Azureのテーブルのアプリのリストビューの
04-09 13:21:29.232 3029-3029/? I/JonnysMessage: Read object with ID a822b906-5f84-4345-86d2-3031247e380a null
04-09 13:21:29.232 3029-3029/? I/System.out: Item is [[email protected], [email protected]]
スナップショット Result of the listview on app
スナップショット
私は紺碧の上に新しいポータルを使用しています。私は匿名アクセスを許可するために、読み取り等のために設定されたアクセス許可を持っています。私はアプリケーションキーを使用していない、私は1つが必要ですか?