TOK BOX Screen sharing is not working outside my app - android

I did screen sharing (tokbox) for my application.
It works fine inside my app.
But I cannot share screen outside my app...
Can anyone plz help?
https://tokbox.com/developer/guides/screen-sharing/android/

I had also faced the same issue and had mailed to tokbox support.
This was their response:
The way our screen capture code works is that it recursively traverses the view hierarchy and copies those images to a buffer and then send that buffer over on the webrtc data pipe. Hence once the app is pushed to the background, we could not traverse the view hierarchy and copy the image, so screen sharing works until we are in the application (Android or iOS native app). If you want to share the screen view of Opentok app only, it will work but outside the app won't work. It's just to take care of the privacy and security aspects of the mobile app users.
So according to them you cannot share screen outside the application. It will only work when app is in foreground.
Update
After constantly asking the tokbox support team I got the following reply from them:
To screenshare the content outside of your application on Android and iOS can be achieved.
For Android, you need to use the Media Projection API together with Vonage/Tokbox Custom Capturer.
For iOS, you need to use the iOS ReplayKit together with Vonage/Tokbox Custom Capturer.
Basically, the implementation is to get a frame from Media Project API or Replaykit and then pass it via a custom capturer.
Following their response, I found Accelerator Core Android repo which showed how to integrate Media Projection API with tokbox.
More specifically these two files: ScreenSharingFragment.java and ScreenSharingCapturer.java
Using these two files I am now able to share screen outside my application.
Note:
Apps that target Android 9 (API level 28) or higher should use Foreground services or else your app will crash due to security reasons.

According to Tokbox, we can't share the screen outside the application.

Manik here from the Video API team.
To screenshare the contents outside of your application on the Android platform, you need to use the Media Projection API. In combination with the Media Projection API, you need to use a Custom Capturer.
We're working on a sample application that will allow you to accomplish this - please stay tuned!

Related

Open local video on Android device, from a QR code

Background
Some teams in my company's facilities are using Android tablets for multiple operations. We would like to allow them to access video demos from their tablets, when they are at specific places in the facility, without having to search through the tablet for the right video. So we thought of QR codes (printed on paper, stuck to the wall). Problem is: for security reasons, we can't allow the devices to access any network.
Question
So the idea is to store the videos locally, and have the QR code route to the local file. I thought this would be easy but it doesn't appear to be.
I have generated QR codes like file:///path/to/my/file.mp4, also trying to play with intents, like this:
file:///path/to/my/file.mp4#Intent;scheme=file;action=android.intent.action.VIEW;type=video/mp4;end.
(+ variants including intent://, using scheme=file, targeting images instead of videos...)
In the best cases, the browser opens, closes, and I receive "Cannot display file. Invalid PDF", and in the worst cases, "Sorry, the application could not be launched. The bar code content may be invalid.".
I also tried variants (images instead of videos, URL vs plain text QR codes, several code scanner applications), all with the same result. I have searched through SO, but most questions are about doing this programmatically in an application, while I would like to avoid designing an app just for this.
What am I doing wrong? Is there no way to do this that way?
Note: I had absolutely no knowledge about Android and intents before trying to solve this case, there may be smarter workarounds. Any hint is appreciated.
Given the network requirement within your company, it seems building a simple application is the easiest solution(maybe because I am an app developer).
So your app would need only 2 screens. QR code Scanner and a View that shows the video.(once you click done, go back to scanning)
The app can have all the videos you need prebuilt in the app itself and the QR codes can be the names of those videos.
Okay, I don't know if you are using web page or any android app for this fature, for web page you need to create your own scanner or integrate ready made solution i found 1 here, you will need setTimeinterval so it scans bar code once, Once barcode is found you will need to call your ajax method to fetch complete URL of that video, once any item is returned, you need to display it in iframe.
Hope it works for you.

Display Application widget on Lock screen android

I am stuck with one of my client requirement , it seems not be feasible to me as i am not able to find anything related to this particular requirement.I am goggling but does not came up with proper clue.I though studied the below mentioned link which states that it is not supportive . Here is the link :-
How to force a widget to appear on lock screen programmatically (Android)
i just want to confirm that is it feasible ? Or this can be achieved by making custom lock screen for application.
Here is what my client requirement is :-
I need your suggestion here , please let me know .
Thanks
i just want to confirm that is it feasible ?
As I wrote in the answer to the question that you linked to, the standard Android lockscreen framework only supports app widgets from Android 4.1 through 4.4, which is a steadily shrinking portion of the Android device ecosystem.
Or this can be achieved by making custom lock screen for application.
Android does not support the creation of custom lockscreens, other than by building your own modified version of Android, poured into your own custom ROM, installed onto whatever hardware your custom ROM supports.
There are plenty of developers who claim to create custom lockscreens. Those actually require you to disable the device lockscreen, then their apps attempt to interpose themselves between the user and ordinary apps. At the best of times, this offers weaker security.

How to stream screen content to Chromecast

I have an Android app that I would like to add the ability for the user to "cast" what is displayed on the app to a Chromecast. It could just be a local JPG but I would prefer the user to actually see actual "live" content of the app. Does anyone know if this is possible? I know there are apps like AllCast but wasn't sure if they were using supported features of the SDK or if it was a hack. I found some mention of the Default Media Receiver but could not find any documentation on how to use it with local content. Any advice or direction would be appreciated.
There is no Cast api to do that directly; you can look into WebRTC or something of that nature.
The way I do it is to use the Presentation class. The only problem is that you do need to use the ChromeCast app to start screen mirroring before you start your app.
I have not yet found a way to start mirroring my app (or, to be more precise, to show the contents of your Presentation class) from a ChromeCast UIButton within my app, even though I have been able to get that cast button working and connecting ... just not to start app-mirroring when using only my in-app chromecast button.

Multi Window App Development

I want to develop an android application which has to run two other applications on the device with one app on upper half of the screen and the other in lower half of the screen. Any clues/suggestions to start developing this ? Thanks in advance !
it's not possible multi-pane-layout two other apps.
if u want your app with multiple activities follow this tutorials for your references:
it's called named as multi-pane-layouts and offical introduction about multi-pane-layouts below link:
http://developer.android.com/design/patterns/multi-pane-layouts.html
and it's shows how to implement multi-pane-layouts on your project below link from android official side:
http://developer.android.com/guide/practices/tablets-and-handsets.html
and you can download example project from github below link:
https://github.com/faisalgeek/MultiPaneAndroidApp
This is not possible, except via custom device firmware or ROM mods. In standard Android, only one app can be used at a time.
However:
You are welcome to support multi-window apps on some Samsung devices, as they have extended their firmware to support this concept
You are welcome to have an activity's theme set up to not fill the screen, though anything else around the activity will at most be visible and will not respond to touch events
If all of these applications are yours, combine them into one app, and then you can display elements of that app alongside other elements of that app however you wish.
If you are looking for a feature for your app which supports multi-window then Latest Android version N has a new cool feature called Multi-window support, you can let your app support multi-window which can be resized and scaled which is exactly your requirement. you can find the reference link here

Should I use Webview or Android widgets for webbased Android Application?

I'm planning a project which will uses JSON objects to display data on andorid mobile.
My application is some what similar to facebook application for android. It seems making detailed ui like facebook's like,comment will be time time consuming & webview seems to be better option in this case ?
need your suggestion.
I'm also planning same app to be developed on iPhone as well.
Refrence link
Android has enough support for JSON that you can easily use the native widgets for your application. By using native widgets, the Joe Default user will have a more normal (expected) user experience, since most of the application will work just like any other Android application works.
Another thing to take into consideration that by using native widgets, it will probably be easier to add support for different UI sizes (portrait and landscape mode in various sizes can be a pain to get right in a single webview).

Categories

Resources