Taking a video of the application in android - android

I understand that to take video of the application you need to have your phone rooted in android. What feature puts this restriction?
Workaround
I want to know how feasible this is? Take screenshots of the UI on regular intervals(very quick intervals) and convert those pictures into a video.
NOTE
By screenshot I mean the area of only my application's layout. I want to take rapid screenshots of the layout and then convert it into a video. If it is possible, when saving the current state of the layout in a bitmap, will it do so in a UI thread?

if you are trying to capture the current application activity you can use this code in a thread with a timer.
RelativeLayout rl1 = (RelativeLayout)findViewById(R.id.relative_layout_1);
View v1 = rl1.getRootView();
v1.setDrawingCacheEnabled(true);
bitmap = Bitmap.createBitmap(v1.getDrawingCache());
v1.setDrawingCacheEnabled(false);
and you can make a video. refer This Link

You can use this solution if you want to capture your own application activities.
Capturing the phone's entire screen is only possible using the the READ_FRAME_BUFFER permission which allows system (non 3rd party!) apps to take screenshots. This is why this solution works for rooted devices only. You can find a more detailed explanation here.

If you are just looking to capture some fluid images of your app in action, you might just try video capturing/taking screenshots of your app on your desktop while running the app in the Android emulator.

Related

How to programmatically record screen without root device in android?

I have a drawing app. I want to record finger drawing and make .mp4 file. Display whole drawing steps for how to create drawing. I can't understand how to use record screen on my apps.
You can not record screen video without rooting device.
But in your case if you want to play drawing then if you have state of your drawn items then you can redraw it in thread with proper delay, it will looks like video.
Its simple solution, without using any 3rd party library using handler, generate screenshot and use frame animation for full screen mode. Thats its.

android make video of screen -need to take application video

In one of my application i need to record video of my own screen.
I need to make a video in that user can take video of their app how it possible?
first question is it possible so? if yes then how? any useful links or some help
Thanks
Pragna Bhatt
Yes, it is possible, but with certain limitations. I have done it in one of my projects.
Android 4.4 adds support for screen recording. See here
If you are targeting lower versions, you can achieve it, but it will be slow. There is no direct or easy way to do it. What you will do is, create drawable from your view/layout. Convert that drawable to YUV format and send it to camera (see some library where you can give custom yuv image to camera), camera will play it like a movies, you can save that movies to storage. Use threads to increase frame-rate (new multi-core device will have high frame-rate).
Only create drawable (from view) when there is any change in view or its children, for that you can use Global Layout Listener. Otherwise send same YUV image to camera.
Limitation:
You can not create video of more than one activities (at a time), or their transactions, because you are creating image from view. (Work on it yourself, may be you'll find a way)
You can not increase frame rate from a certain point, because it depends on hardware of your device.

Is it possible to have a background process detect screen capture

I want to build n app that detects when the user takes a screenshot then get the image and use it.
Is it possible without root? My idea is very crude. the app will scan the screenshots holder for changes every second but that is very inefficient. is there another way?
I don't think there is no supported way of doing that. You could try the FileObserver class though and watch for events. Look here: https://developer.android.com/reference/android/os/FileObserver.html

Can you "wrap" the stock camera's functionality on a droid phone?

My company has a need to print a timestamp on images taken on a droid. Another developer mentioned that we could wrap the entire functionality of the stock camera, then once a photo is taken, embed the timestamp on it. Can this be done, and if so, how simple/complex would it be?
Pretty simple actually. Definitely way simpler then writing a camera app from scratch.
Here is a short overview to give you a few keywords:
You need to fire a ACTION_IMAGE_CAPTURE intent,
this launches the devices camera app and prompts the user to take a picture (stock app or not doesn't even matter). When the picture is taken it will return to your app¹. At this point you'll get a file URI of the taken image that points to a JPEG usually.
Once you have that, load the image via the BitmapFactory into a Bitmap object and edit it by using a Canvas. You can use Canvas.drawText() to draw the text. Then store it where you need it, send it off the device or do whatever you want with it. And that's all the magic.
¹ here is a small example how to do that, found via google, there are plenty more out there

android - use camera from within background service

I'm trying to figure out if it is possible to use a camera video stream from within a background service rather than from a normal intent.
What I had in mind is this:
start the service from my app
this service accesses the video stream and extracts features continuously; depending on the features, it sends network packets (to localhost)
user switches to another app - the service must still be running and extracting features!
Before trying to implement all that, I'd like to know if it was possible.
Thanks in advance
Nicola
yes its possible, check my answer and sample code on one similar thread
Open/Run Camera from background service in android
You have to show the fake preview over the current screen. For that you have to create the surface view with 1*1 px dimension and display the preview in that. You have to draw the surface view over other apps for that.
Check out this library that provides facility to capture image from the background even from the service.
I don't think this is possible as the camera needs a preview screen. See previous question here

Categories

Resources