android怎么样来simpleCursorAdapter和ArrayAdapter之间比较 [英] android how to compare between simpleCursorAdapter and ArrayAdapter

查看:125
本文介绍了android怎么样来simpleCursorAdapter和ArrayAdapter之间比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序。我想优化的那一个。我怎么能做到这一点。
比如我使用simpleCursorAdapter绑定列表视图,并从数据库中获取的数据。
但是,如果我检索光标数据到一个字符串数组,然后通过使用ArrayAdapter我可以绑定列表视图。
所以我想知道哪一个是最好的一个装置,它需要较少的时间来绑定或占用较少的CPU时间。
PLZ给我答案。
而如果妳有code优化任何额外的提示,然​​后告诉我PLZ。
谢谢

I have an application. I want to optimize that one. how can i do that. For example I am using simpleCursorAdapter to bind listview and it fetch data from database. But if i retrieve data from cursor into an string array and then by using ArrayAdapter I can bind listview. So I want to know which one is the better one means which takes less time to binding or takes less CPU time. Plz give me the answer. And if u have any extra tips of code optimization then tell me plz. Thank you

推荐答案

请尝试通过你的自我测试。有下列步骤来看看检查的性能差异

Please try to test by your self. Have a look on the following steps to check performance difference

创建你写这两个技术的一个示例应用程序。同时打印两个打印报表显示和自由堆内存

Create a sample application where you write both of the technique. also print two print statements for displaying and free heap memory

一个调用数据库之前声明
第二条语句创建列表视图后,

在这种方式,你可以找到它的技术是按照您的要求更好的。

In this way you can find which technique is better as per your requirement.

谢谢
迪帕克

这篇关于android怎么样来simpleCursorAdapter和ArrayAdapter之间比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆