dongsui0929 2013-04-04 14:28
浏览 39
已采纳

使用php后端在Android应用中显示数据[关闭]

I have question about structuring applications. I'm making, for example, a Twitter-like app. This application must make a query on a url (it's done by asynctask) and gets a reply (it can be Json, serialized array, or even html).

In next step app outputs data. For example, latest news. I don't know in which ways it can be done. I tried to make it with html data from the backend and viewing it through the web-view, then I added click listener on links. With this I can control the app and navigate. After that I turned on JavaScript in web-view and can control the DOM. In the web-view, drawing images is easier.

Am I going in right direction or do I need to use something like list-view to output? And what future problems may there be using this?

  • 写回答

1条回答 默认 最新

  • dongyu2764 2013-04-04 14:37
    关注

    Ok, your question is very confused, but I'll try to ask. As you sayed you have 2 alternatives, one is to built your interface natively and retrieve the data from a Web Service via an asyncTask, the other is to use a WebView.

    Both approach are valid, but think that is you use a WebView you are building an non-native application (in fact is an hybrid application) so you need to simulate the native behaviour (this can cause you problems in the future)

    I prefer to use a WS and build the interface with native widgets, for comunication you can use JSON.

    If you prefer to use a WebView, I recommend you to use a framework like Sencha or phonegap

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?