Android:使音乐播放器应用程序更有效率

时间:2021-07-07 02:15:17

I am making an android music app. I have a few queries about how to make it more efficient-

我正在制作一个Android音乐应用程序。我有一些关于如何提高效率的问题 -

  1. Should I store the tracks available on the device, in my app? If yes, what should I use JSON, SQLite or CouchbaseLite?
  2. 我应该在我的应用程序中存储设备上可用的曲目吗?如果是,我应该使用JSON,SQLite或CouchbaseLite?

  3. How often should I refresh the stored records?
  4. 我应该多久刷新一次存储的记录?

Any other tips will be highly appreciated.

任何其他提示将受到高度赞赏。

1 个解决方案

#1


2  

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. 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. you can learn more about content providers and media store from the following tutorials. Media Store

无需将音乐保存在您自己的应用程序数据库中,android会为您保存它们,并提供允许您限制访问该数据库内容的内容提供程序(MediaStore)。因此,每当您的应用程序想要从设备加载音乐时,它将使用来自媒体商店的加载音乐,使您自己的数据库只意味着在设备中拥有数据的副本,这将浪费内存,因为您会仍然需要查询您的数据库才能获得音乐。您可以从以下教程中了解有关内容提供商和媒体商店的更多信息。媒体商店

Content Provider

#1


2  

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. 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. you can learn more about content providers and media store from the following tutorials. Media Store

无需将音乐保存在您自己的应用程序数据库中,android会为您保存它们,并提供允许您限制访问该数据库内容的内容提供程序(MediaStore)。因此,每当您的应用程序想要从设备加载音乐时,它将使用来自媒体商店的加载音乐,使您自己的数据库只意味着在设备中拥有数据的副本,这将浪费内存,因为您会仍然需要查询您的数据库才能获得音乐。您可以从以下教程中了解有关内容提供商和媒体商店的更多信息。媒体商店

Content Provider