共享preferences或SQLite数据库? [英] SharedPreferences or SQLite Database?

查看:122
本文介绍了共享preferences或SQLite数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个小闹钟应用程序,我目前使用的共享preferences来存储每个报警的设置。我想这将是比使用SQLite数据库更轻便,但我现在想编写一个小的线程安全的包装器共享preference。难道我是一个傻瓜,应该只使用数据库或会这仍然比较轻的重量比数据库?

I'm writing a small alarm clock application, and I'm currently using SharedPreferences to store the settings for each alarm. I figured this would be more lightweight than using the SQLite Database, but now I'm thinking about writing a small thread-safe wrapper for SharedPreference. Am I being an idiot and should just use the database or would this still be more light-weight than the database?

推荐答案

有关的东西这个小,这是多么轻巧的是不是真的有关。其10纳秒比50纳秒的事(不是真的,但你的想法)。只要使用什么是您的应用程序

For something this small, how lightweight it is isn't really relevant. Its a matter of 10 nanoseconds versus 50 nanoseconds (not literally but you get the idea). Just use what is easier and more reliable for your app

这篇关于共享preferences或SQLite数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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