How I could add R.raw class to my android project? Now I haven't /res/raw folder at all (and class as well). And I can't find any tools in eclipse to do that. So how to add R.raw?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Adding a raw folder to your resource folder (/res/) should do the trick.
Read more here: https://developer.android.com/guide/topics/resources/providing-resources.html
Here is the string to access files in raw folder. Replace filename with name of your file.
android.resource://" + getPackageName() + "/" + R.raw.filename
Right click on package or Res folder click on new on popup then click on android resource directory
a new window will be appear change the resource type to raw and hit OK copy and past song to raw folder remember don't drag and drop song file to raw folder and song spell should be in lower case! This method is for Android Studio Also Check MY Link
To get it to recognize the raw file, make sure you create it, and add it as a raw resource file. Then go to build.gradle file and add this block of code.
(With reference to Android Studio)
Create a new directory in res folder. Make sure to create new "Android Resource Directory" and not new "Directory".
Then ensure that there is at least one valid file in it. It should show up now.
Simply add a folder 'raw' to your res folder.