Android:哪个adapterview和adapter显示应用程序的动态列表
对于我的论文,我正在尝试做一个类似于 Android 市场的市场。我在mysql中做了数据库,现在我正在考虑android客户端界面。我是初学者,所以我需要你的帮助。 我的数据库上会有很多应用程序,我需要做一个本地应用程序来调用数据库(中间会有php)并显示应用程序列表,就像在android市场中一样,所以有一个标题,一个图标、评级和费用。所有这些信息都在 mysql 数据库上,我认为 php 会让我回到手机上一个包含我需要的所有信息的 xml 文件。
这是我的想法,但如果对你来说应该有所不同,请告诉我。例如,如果本地 SQLite 应该在其中发挥作用(它肯定会有一个共享我下载的应用程序的元数据),
我读到,对于动态的内容列表,最好使用从适配器获取列表元素的适配器视图,这是一种与数据源的桥梁。但例如 arrayadapter 仅基于 textview,其他仅基于 imageview 等等...... 相反,我的视图并不那么简单,而是一些复杂的东西,包括一些图像,一些 textview,评级等等...... ..
所以我需要找到正确的adapterview和正确的适配器。
现在为了我的目的,为了你:
- 我应该使用哪个适配器视图?我正在考虑使用列表视图。
- 更难的是哪个适配器?我是否需要创建一个扩展基本适配器类的自定义适配器,或者是否有一些适配器适合我的目的?
- 如果 textview 是 arrayadapter 的基础小部件,那么哪一个将成为我的基础小部件?一个复杂的小部件基本上就是一个视图组?
我读过一些关于cursoradapter的内容,但我不知道它是什么,也不知道它是否是我要找的。如果您知道谷歌在其市场中使用什么,那将会很有用:)
欢迎解释、示例或链接
For my thesis I'm trying to do a kind of market similar to the Android market. I did the db in mysql, now I'm thinking about the android client interface. I'm a beginner so i need your help.
I will have on my db a lot of app, I need to do a native app that call the db (there will be php in the middle) and show the list of the app as in the android market, so with a title, a icon, a rating and a cost. All this info are on the mysql db and I think that php will get me back to my phone a xml file with all the info I need.
This is what I suppose, but if for you should be different let me know. For example if the local SQLite should play a role in this (it will definitely have one to share metadata for apps I downloaded)
I read that for dynamic list of stuff it's better to use an adapterview that takes the elements of the list from an adapter, that is a kind of bridge with the datasource. But for example arrayadapter is based on textview only, other on imageviews only and so on...... instead my views are not so simple but are something complex with some images, some textviews, rating and so on.......
So I need to find the right adapterview and the right adapter.
Now for my purpose, for you:
- Which adapterview should I use? I was thinking to use listview.
- And the harder one, which adapter? Do I need to create a custom one extending the base adapter class or there are some adapters suitable for my purpose?
- If textview is the base widget for arrayadapter, which one will be the base for mine? A complex widget so basically a viewgroup?
I read something about cursoradapter, but I don't know what is it and if it's what I'm looking for. If you know what google use for it's market, that would be useful :)
Explanations, examples or links are welcome
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您正在寻找自定义 ListAdapter 。 这是一个不错的介绍。
Sounds like a custom ListAdapter is what you're looking for. Here's a decent introduction.
你应该看看 aptoide 以及它是如何构建的希望它有帮助
http://www.aptoide.com
you should take a look at aptoide and how it's build Hope it helped
http://www.aptoide.com