- Install Android Studio
- Import the project to the android studio
- Click on
Build
in the navigation side bar - Start
Run
. - When running, connect to the physical device which has USB debugging enabled
- Once the physical device is connected via USB port, studio discovers it via device manager.
- Run the android app by selecting the physical device name when running.
- When the app starts, press on the Start button
- A toast appears asking for file permissions and audio record permissions. Grant permission by pressing on Yes.
- Now we can start recording the audio by pressing on the
START
button. - When you are done press the
STOP
button. Toast that saysRecoding ended
appears. - The recording gets saved to
/sdcard/recording.pcm
on the device filesystem.
- This app contains the GRPC oriented synchronous channel based client using TCP port that is specified.
- This app can start either both on the physical and virtual devices.
- The GRPC server code will be committed to seperate repo.
- App can be installed on the device using either android studio (USB) or via the .apk generated in the build directory and shared to the physical device via the bluetooth sharing.
- Input to be given on App is: Server IP of the GRPC server, Port number it is running on and the Message to be sent.
- Once connection is established the GRPC server returns the message that is displayed on a TextView area in the app.
- This does streaming channel connection using RPC service defined in teh record.proto file as per the requirements.
- It makes connection to the IP/PORT specified in the Android Client as per the proto requirements
- The server once it receives chunks replies back on the channel with "Data recieved" and final = 0
- When all data is completed server sends final = 1 and "Data completed" back to the client
- Ensure the manifest has the legacy file permission to store the recorded bytes
- Ensure the manifest has permission to store access the device recoder device
- The script audio-record-server is used to run the server java class compiled using gradle on my system.
- The server is run on the specified port
- Ensure firewall is turned off so that the server tcp port 8080 / 50051 (Default) are reachable from the mobile phone ip.
- The server is in this code AudioRecorderServer.java
- The proto is in
audiorecord.proto
which should be same as the proto used by the streaming android client above.