私はAndroidの世界で初めてです。私は多くのチュートリアルを参照して、最終的にGoogleシートからデータにアクセスするアプリケーションを作成してきました。私は多くのスレッドを通過したが、誰もが私のコードで使用したのと同じフォーマットを提案していますが、値を返すことはありません。私のコードがあるGoogleスプレッドシートのAPI row.getCustomElements()。getTags()は値を返しません。
..
ます。private voidのgetData()を含むAuthenticationException、MalformedURLExceptionと、 にIOException、はServiceException、URISyntaxException {
SpreadsheetService service = new SpreadsheetService("MySpreadsheetIntegration-v1");
service.setProtocolVersion(SpreadsheetService.Versions.V3);
URL SPREADSHEET_URL = new URL("https://spreadsheets.google.com/feeds/worksheets/14-oj9z-Z6_sGtrOdL9nqvV604yZxAUw33bAJY8tcYyw/public/basic");
WorksheetFeed feed = service.getFeed(SPREADSHEET_URL,WorksheetFeed.class);
List<WorksheetEntry> worksheets = feed.getEntries();
WorksheetEntry worksheet = worksheets.get(0);
Log.d("hello","Worksheet Title is "+worksheet.getTitle().getPlainText());
Log.d("hello","Worksheet Row Count is "+Integer.toString(worksheet.getRowCount()));
Log.d("hello","Worksheet Column Count is "+Integer.toString(worksheet.getColCount()));
//URL listFeedURL = new URI(worksheet.getListFeedUrl().toString()).toURL();
URL listFeedURL = worksheet.getListFeedUrl();
Log.d("hello","URL is \n"+ listFeedURL.toString());
ListFeed listFeed = service.getFeed(listFeedURL,ListFeed.class);
for (ListEntry row: listFeed.getEntries()){
Log.d("hello","Title "+row.getTitle().getPlainText());
Log.d("hello","Size "+Integer.toString(row.getCustomElements().getTags().size()));
for (String tag: row.getCustomElements().getTags()){
//Log.d("hello",ProperValue(row.getCustomElements().getValue(tag)));
Log.d("hello d",row.getCustomElements().getValue(tag).toString());
}
}
をスローし、私のログは示しています
D /こんにちは:ワークシートのタイトルは連絡先です D/hello:ワークシートの行数は1000です D/hello:ワークシートの列数は26 D/hello:URLは https://spreadsheets.google.com/feeds/list/14-oj9z-Z6_sGtrOdL9nqvV604yZxAUw33bAJY8tcYyw/od6/public/basic D /こんにちは:タイトル100 D /こんにちは:サイズ0 D /こんにちは:タイトル101 D /こんにちは:サイズ0 D /こんにちは:タイトル190 D /こんにちは:タイトル:0 D /ハローサイズ192 D /こんにちは:サイズ0 D /こんにちは:タイトル145 D /こんにちは:サイズ0 D /こんにちは:タイトル103 D /こんにちは:サイズ0 D /こんにちは:タイトル923 D /こんにちは:サイズ0 D/hello:タイトル34 D/hello:サイズ0 D/hello:タイトル23 D/hello:サイズ0
listfeedのURLが取得されても、何が失われているかわかりません。
ご協力いただければ幸いです。