开发者

Read Resources from SD card

开发者 https://www.devze.com 2023-02-16 12:47 出处:网络
Suppose we have downloaded some files from somewhere to the some resources folder on the SD card. Now, let\'s be able to use th开发者_StackOverflow中文版e downloaded. Jpg image as the background, and

Suppose we have downloaded some files from somewhere to the some resources folder on the SD card. Now, let's be able to use th开发者_StackOverflow中文版e downloaded. Jpg image as the background, and play audio clip. How to implement reading data from the SD card or phone memory (com.example.app or etc folder)? For example, if resources located into the application, then I read so

layout.setBackgroundResource (R.drawable.img);

And I need instead of R.drawable.img i must read from an SD card or phone memory. The sound of my own class, but the principle of reading should be the same

sound = getAudioClip (R.raw.sound);

where instead of R.raw.sound must-read SD card or phone memory.


Look at this sample to know how to fetch and display images from the SD card
Images from SD Card

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号