简体   繁体   English

Android:提高Music Player应用的效率

[英]Android: making a Music Player app more efficient

I am making an android music app. 我正在制作一个Android音乐应用。 I have a few queries about how to make it more efficient- 我对如何提高效率有一些疑问-

  1. Should I store the tracks available on the device, in my app? 我是否应该在设备上的应用程序中存储可用的曲目? If yes, what should I use JSON, SQLite or CouchbaseLite ? 如果是,我应该使用JSON,SQLite或CouchbaseLite吗?
  2. How often should I refresh the stored records? 我应该多久刷新一次存储的记录?

Any other tips will be highly appreciated. 任何其他提示将不胜感激。

There is no need to save the music in your own app's database, android saves them for you and provides a content provider ( MediaStore ) that allows you restricted access to the content of that database. 无需将音乐保存在您自己的应用程序的数据库中,Android会为您保存音乐,并提供内容提供商( MediaStore ),允许您限制访问该数据库的内容。 So every time your app wants to load music from the device, it would use the load music from the Media Store , making your own database would only mean having a copy of the data in the device and that would be waste of memory since you would still have to query your database to get the music. 因此,每次您的应用程序想要从设备加载音乐时,它都会使用Media Store中的加载音乐,建立您自己的数据库仅意味着在设备中拥有数据的副本,这将浪费内存,因为您会仍然必须查询数据库以获取音乐。 you can learn more about content providers and media store from the following tutorials. 您可以从以下教程中了解有关内容提供者和媒体存储的更多信息。 Media Store 媒体商店

Content Provider 内容提供商

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM