开发者

how to design android project using custom view?

this is not a question that has an exact answer but I need some advice how to develop my applicatio开发者_如何学运维n.

I have a web service that sends me all the application information (fonts, styles etc). the purpose is to use the service in multiple devices. I created the data model for my application. Thus I have everything I needed. Now I need to visualise my app upon data coming from server. I thought about custom view, or perhaps multiple custom views to visualise the data upon what kind of view it needs. is that a right choice? or can you give me better advices? thanks


I'd say that's a good way to do it. You can create a Library project where you implement those views so you can use them in multiple apps. Just remember you need to specify the full package name in the layout xml.


The WebView is maybe what you're looking for. It is possible to build complete apps using the WebView, without the user ever noticing that all he sees is made up of HTML and CSS. It can feel pretty native.

If your server not only provides data but also appearance details such as styles, etc.. Then really, the most natural solution seems to be the WebView. You can actually build HTML pages (or fragments) server side, and deliver them to the devices.

The WebView is very customizable. You can deactivate zooming, etc... and with the right CSS rules, your UI will render consistently across devices.

And with WebView.addJavascriptInterface(), you can easily interact with your Java classes and thus the data model.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜