Android Screenshot Capturing - android

I am new to android development and Kotlin. I am trying to implement a feature that takes a screenshot when there is an issue in the application and uploads the screenshot to a server.
I am currently writing a function that uses DrawingCache and saves the view to a bitmap image. Other than this approach, is there a better way to do this? I was wondering whether there is a way to use the Android OS level screenshot capturing mechanism for this?

No. You should only have a screen of your own views, and not other apps nor system status bar. If that is possible, it is a security issue with Android and Google should forbid it.

Related

TOK BOX Screen sharing is not working outside my app

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!

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 do people make GIFs from Android Studio?

Stuff like this. I'm not sure how to quite do that outside of a screen capture program. Or perhaps they are using an emulator with that function?
GIF
There is an app called screencast pre installed in Android. Use that to record screen actions and then convert it to a gif using an online software

Preview Documents in Android

Hi does android have a native document preview window like iOS? i'm creating an app that handles documents and know iOs has a default document preview Window. I'm wanting to if it android has the same or would i be better just downloading the document and having the user preview the document in there chosen app. ideally and like to keep the user in my app rather than go to another but if its not standard android then i will accommodate that.
Does anyone know the best way to proceed with this?
There's no "native document preview" but you dont need to bother much. Just fire proper Intent to do the preview and let other apps do the job (do not forget to handle "there's no app to handle this intent" case correctly and warn your user (and perhaps suggest installing some apps to have this "fixed")).

rights protected photo on android

I've been tasked with writing an iphone application that displays a set of images (think powerpoint slideshow). The content of these images need to be protected from forwarding
this task seems quite simple with one exception - I'd like to prevent the user from taking a screenshot
it's not like i'm protecting the crown jewels here, so I'm not looking for military grade super ninja protection.
thoughts?
If the user has the Android SDK, they can take a screenshot. There is nothing you can do to stop it.
OTOH, without the Android SDK, there is no way to take a screenshot in Android.

Categories

Resources