如何从数据库中获取音乐并在android中播放 [英] how to get music from database and play in android

查看:442
本文介绍了如何从数据库中获取音乐并在android中播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我是Android的新手。现在我想创建从数据库读取数据(MUSIC)的应用程序,如mysql,并在Android应用程序中播放它。那么请你告诉我这样做的步骤。如果可能请给我一些代码。



谢谢。

解决方案

在数据库中存储相对较大的二进制文件并不是一个好主意,我的看法。您应该只保留数据库中文件的路径

如果您对播放音乐文件感兴趣,那么请查看许多教程中的一个(或多个)可用(例如,参见 MediaPlayer 如何使用[ ^ ]课程)。

Hello i am new to android. now i want to create app that read data (MUSIC) from database like mysql and play it in android application . so could you please tell me the step to do that. if possible please give me some code.

Thanks.

解决方案

Storing relatively big binary files in the database is not a good idea, in my opinion. You should keep just the path of the files inside the database.
If you are interested in playing musical files then have a look at one (or more) of the many tutorials available (see, for instance how to do it with the MediaPlayer[^] class).


这篇关于如何从数据库中获取音乐并在android中播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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