1

I am currently developing a video chat application, it is working fine no problem at all, my issue is that the video and audio streams cut when I click on the home button and continues as I come back, this means that the other peer sees my video Container freezing, until I get the app again from the background, hoping that the system did not kill the app if the resources of the device is not enough. What I want to do is something like what I see in the Messenger application (the one related to Facebook), so when the user clicks on the home screen a dialog activity comes up containing the video or some text notifying that there is a call running, to prevent the app from stop sending video and audio streams.

UPDATE: I need to make a UI accessor for the application when it is in the background

Mohammad Elsayed
  • 1,885
  • 1
  • 20
  • 46
  • 1
    https://stackoverflow.com/questions/7521307/starting-a-view-from-a-service – mudit_sen Oct 16 '18 at 09:49
  • 2
    https://developer.android.com/guide/topics/ui/picture-in-picture – mudit_sen Oct 16 '18 at 09:50
  • I can't use this solution @mudit_sen because the application is made to support api 24 and up, I wish I can use it, it is exactly what I am looking for :( – Mohammad Elsayed Oct 16 '18 at 09:52
  • @mudit_sen there is a great difference between what I need and what is in here in this link: https://stackoverflow.com/questions/7521307/starting-a-view-from-a-service while the app is in the foreground, or am I missing something the issue is that I want to completely put the application on the background and I can't override the home button click to launch a small dialogActivity to keep my app live, in the thread he is asking about putting two activities on top of each other. – Mohammad Elsayed Oct 16 '18 at 10:00
  • @mudit_sen it seems that u have experienced this issue before :) thanks for help anyway – Mohammad Elsayed Oct 16 '18 at 10:01
  • What you need view that can be shown after an activity is closed. So you can create a service and create your view there. That's how facebook does it. Messenger bubble is a service running until you close it pushing the bubble to cross icon. But after Oreo android released picture in picture view which is quite easy to use. – mudit_sen Oct 16 '18 at 10:12
  • not the head-chat, I mean the video chat, when u r in a call and click home, a small square dialog will appeare – Mohammad Elsayed Oct 16 '18 at 10:29
  • It is upon you which view you want to show in your service. Facebook messenger is showing a chat bubble. You can show your chat view. You won't find any step by step solution for this on StackOverflow. – mudit_sen Oct 16 '18 at 10:44
  • thanks @mudit_sen you really helped – Mohammad Elsayed Oct 16 '18 at 10:49

0 Answers0