/sdcard上的音乐文件会进入apk吗?
我有一个已导出为 apk 的应用程序。我在 /sdcard/audio
上存储了一些对应用程序绝对重要的 .wav
音乐文件。我的问题是:
- 如何导出 wav 文件并确保它们存在于 apk 中?当我导出项目时,apk 的大小约为 23kB。看来我应该把 wav 文件放在其他地方,在其他目录中。我已使用
adb
中的 mkdir + Push 命令将文件添加到 /sdcard/audio。
I have an application that has been exported to an apk. I have stored some .wav
music files on /sdcard/audio
that are absolutely essential to the application. My question is this:
- How do I export the wav files and make sure that they are present on the apk? When I export the project, the size of the apk is something like 23kB. It seems that I should have had the wav files somewhere else, in some other directory. I had added the files to /sdcard/audio by using mkdir + push commands in the
adb
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些类型的文件应该位于
/res/raw
中。sdcard 中的文件不会推送到 apk 中。
Those type of files should be in
/res/raw
.Files in the sdcard will not be pushed into the apk.
假设您的虚拟机上有 .wav 文件:您必须了解该虚拟机与您的 apk 无关。本机上的所有设置、下载、上传(如您的 wav)等都只是测试。
你可以删除它,但没有什么真正重要的。只有您项目中的代码(如果您使用的是 eclipse:您在其中看到的代码,因此您的 src、res 等目录)将进入 apk 中。模拟器什么也没有。
现在将它们放入项目中的文件夹中,如 @macarse 所说:
/res/raw
Assuming you had the .wav files on your virtual machine: it is essential you understand that this virutal machine had nothing to do with your apk. All the settings, downloads, uploads (like your wav) etc on this machine are just testing.
You could delete it and nothing really matters. Only your code in your project (if you're using eclipse: the code you see there, so your src, res etc dir's) will go in the apk. NOTHING from the emulator.
Now put them in a folder in your project like @macarse says:
/res/raw