Soundify - Data transmission via sound waves
Soundify Library tries to offer to you the data transmission via sound waves. This library specifically makes the transformation and transmission of certain information into sound waves in the application that it is implemented and also makes the receipt of the same information transmitted. It uses the same concept as Chirp.io technology.
Support for Android 4.0.3 and up.
Feel free to fork or issue pull requests on github. Issues can be reported on the github issue tracker.
Table of Contents
- Setup
- Using Soundify
- Initialize a Instance
- Send Data
- Receive Data
- Others
- Additional Options
- FAQ
- Potential Improvements
- License
Setup
The easiest way to add the Soundify library to your project is by adding it as a dependency to your build.gradle
dependencies {
compile 'com.github.rf177.soundify:soundify:0.0.1'
}
To declare that your app requires audio permissions, add the following to your AndroidManifest.xml
, inside the bottom of the <manifest>
element.
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
Initialize a Instance
The first step is to initialize a Soundify library instance, and pass as a parameter the context of your Activity.
Soundify soundify = new Soundify(this);
Send Data
soundify.send(Soundify.stringToBytes(msg));
Receive Data
For a basic implementation to receive data, you'll need to:
- Start listening;
- Implement an
SoundifyListener
. - Convert bytes receive in your data type.
- Use the data you received the way you want it.
In order to receive the data, you will need to implemente the SoundifyListener
, typically this will be the Activity
or Fragment
.
soundify.startListening();
soundify.setSoundifyListener((data) -> {
String stringData = Soundify.bytesToString(data);
// Example of convert bytes to string // Use the data you received the way you want it
}
);