I want to build a function in my app. That should work like walkie talkie through mobile data or wifi.There will be a button that when they press it will send real time their voice to all logged in users IN THEIR GROUP and when they unpress it it stops, but I have no idea where to start with this. Like I know I probably need some server or something. Any idea ?
CodePudding user response:
This is not that hard to do. I've done this myself like 10 years ago. I say it's not hard because Android already includes the necessary APIs to make it simple enough.
First you need to understand two concepts:
- VoIP
- SIP protocol
Once you've got this, grab some example projects and read the APIs:
SIP Demo / walkie talkie sample project: https://android.googlesource.com/platform/development/ /master/samples/SipDemo/src/com/example/android/sip/WalkieTalkieActivity.java
SIP API: https://developer.android.com/guide/topics/connectivity/sip Be aware that this has been deprecated in API level 31.
Note that to use SIP you need a couple of accounts with a SIP provider; you should be able to find free ones. Or you can also setup your own SIP server.
Hope this helps.