-2

I have build a website which provide a lot of data and based on some rules of company, I can't directly get the data from database for my app version. The only way to do it is to use a webview to show the previous website, but I want to get some data reference to the website for my app processing.

I would like to get an values call productID from the website and use it to save as a record into the mobile local database. This saving move will run in the Android app. Is there a way to do this?

It there a way to get data from the website? Is JavaScript possible for this case?

4

1 回答 1

0

只需对 Google 说几句话。只需为您的服务器寻找一个REST API(您可以用PHP编写它)以将 JSON 中的数据提供给您的应用程序。

在您的应用程序中使用 GSON 将 JSON 对象转换为 Java 对象。请记住在线程/异步任务中执行所有网络调用。你可以看看谷歌提供的 Volley 库。

玩得开心你的项目;)一步一步,你会得到它!

教程

于 2013-09-24T08:58:22.613 回答