提高android应用效率的一些知识点

来源:互联网 发布:ubuntu 启动顺序 编辑:程序博客网 时间:2024/06/02 09:39

SparseArrays 比HashMap更有效率。

如果不需要同步的话,ArrayList比Vector更有效率。

尽可能使用懒初始化 技术。

 

在sqlite相关操作中,最好使用

db.beginTransaction

SQLiteStatementstmt = db.compileStatement

然后调用

。。。。

stmt.clearBindings

stmt.bindString(

stmt.executeInsert

 

最后调用

db.setTransactionSuccessful

db.endTransaction

 

这种方式的使用,速度相对来说最快,性能很好。在取数据query时,只取所需要的信息。

原创粉丝点击