alangpierce / react-native-android-audio-demo

Example Android app built with React Native that follows Android best practices for playing audio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Native Android Audio Demo

This is a proof of concept for how to build an audio app (like a music or podcast player) for Android in React Native, as of early 2016. Unlike some other examples, this app properly creates an Android Service to manage audio, which means that the audio will keep playing even when the Activity is destroyed. Using a Service required opening some escape hatches in React Native, since it goes against the normal lifecycle that's currently assumed.

All that the app currently does is use a text-to-speech library to speak numbers starting at 1 and counting up indefinitely. A custom-drawn notification with play/pause controls appears in the notification shade and can be used to pause and resume the audio playback. The code is factored so that as much logic as possible is done in JavaScript.

Ideally, some parts of this app will eventually be pulled out into libraries.

About

Example Android app built with React Native that follows Android best practices for playing audio

License:MIT License


Languages

Language:Java 73.5%Language:JavaScript 26.5%