android - react-native android 应用程序从 google-spreadsheet 获取和显示数据

标签 android react-native google-sheets

正在将一些数据(例如:温度)存储在谷歌电子表格中。所以现在我想从我的谷歌电子表格中获取数据并将其显示在我的 native android 应用程序中。有人可以给我一些想法或例子吗?

最佳答案

如果您的数据是公开的:

1 - 发布文件(文件菜单,发布)

更多细节在这里: https://support.google.com/docs/answer/37579?hl=en

2 - 发出 GET 请求

https://spreadsheets.google.com/feeds/list/<SPREAD_SHEET_ID>/od6/public/values?alt=json

或到

https://spreadsheets.google.com/feeds/cells/<SPREAD_SHEET_ID>/<SHEET_NUMBER>/public/basic?hl=en_US&alt=json

来源: https://developers.google.com/gdata/samples/spreadsheet_sample

注意事项:

<强>3。从响应中提取您需要的数据,并根据您的需要对其进行格式化。

如果您的数据不公开,您必须授权请求: https://developers.google.com/sheets/api/guides/authorizing .

我可能会考虑使用节点包来处理私有(private)数据的情况 https://stackoverflow.com/a/42765674/1979861

关于android - react-native android 应用程序从 google-spreadsheet 获取和显示数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42765542/

相关文章:

android - 如何检测设备是否有 3.5 毫米音频插孔?

android - 使用倾斜传感器的 Arduino 程序中的正确功能顺序

android - 文本可组合项在 jetpack 撰写中更改为焦点文本字段

javascript - React Native 无法返回数组

java - 安卓:java.lang.IllegalArgumentException:服务未注册

ios - 签名 "appnameTest"需要一个开发团队。在项目编辑器中选择一个开发团队。 (在目标 'appnameTest' 中)

android - react 原生 : Crop image on Android

javascript - 谷歌脚本电子表格未在执行时更新

sorting - 谷歌应用脚​​本 : Remove blank rows from range selection for sorting

Android 应用程序未发布到谷歌表格