A benefit that Google likes to claim that Android has over iOS is flexibility in dealing with file storage. Android devices support external SD cards that can be filled with media files, and do not need a proprietary method of adding multimedia as iOS does.
In this recipe, we will use Android's native mediaPicker
, which is started from an intent. We will then be able to pick a song and have it play through our application.
For this recipe, we created a React Native application titled AudioPlayer
.
In this recipe, we will use the react-native-button
library. To install it, run the following command in the terminal from your project root directory:
$ npm install react-native-button --save
Make sure you have music files available in your Music/
directory on your Android device or emulator.