Display image full screen through Android adb - java

I would like a way to display an image in full screen mode (without the home and status bar showing, images are same resolution as the device) on an Android device through ADB. The image could be either on the device itself of on the computer I am using to adb to the device, if that makes a difference (my first thought was that the image would be on the computer, but I've found some answers that leverage the device's storage and that would be fine).
What I would eventually like to do is set up a script that displays an image in full screen and iterates to the next file on a keypress.
This answer might be useful, showing how to display an image, but it doesn't show the image in full screen mode.
Possible ideas I have had, but don't exactly know how to implement:
Create an app that displays an image full screen and launch it with the required image as a parameter (not sure how to link the picture and the app from adb though).
Use the -n parameter seen in this post and specify an app that only displays images in full screen (could maybe make this app, but a pre-made solution would be easiest).
Any help/advice/guidance would be appreciated.

What that command is doing is starting an Activity that claims it can VIEW jpgs and launching it (passing it the file name via intent). It is not a built in android functionality, its launching an app. For you to display fullscreen as you wish, you need an app that does that, either by default or when some optional parameter is passed. There is no app like that you can 100% count on being installed. SO if you really need it, you'll need to write an app that does it. It should be a pretty trivial app at least- 1 image view and a fullscreen style is all you need.

Related

Saving a video from a view in Android Studio

Basically, I need to figure out how to save a video file of a certain duration from a View.
I'm working on a collage program. I want to be able to add images and videos to a view, which I've figured out for the most part, and then save the View (like a constraint layout) to a video file. I thought about screen recording an area of the screen, but I feel like there are better ways to solve this.
Though this is part of the Flutter wiki, this has some good information on recording videos on Android.
While you are running your Android app, you can run adb shell screenrecord /sdcard/recording.mp4 on the command line to record the video and stop the recording with CTRL+c.
The video can then be pulled off the device with: adb pull /sdcard/recording.mp4 ~/Downloads/.

Screenshot is not supported below API 14

I am trying to get a screen shot of the android studio emulator running on API-10. Unfortunately I am getting the following message:
Can anyone explain why is that so and is there any other easy workaround to this except Print Screen (since it does not produce the same image quality and one needs to crop the image manually)?
The solution has been within the Android Studio itself:
1- Click on Android Device Monitor
2- On the left, there is a tab named Devices . Find your emulator name and click on it.
3- In front of the Devices tab there are a set of icons. Find the Screen Capture icon and click on it.
4- After the Device Screen Capture window opens, wait until your emulator's current screen is captured.
5- At last, you can save the quality image by clicking on the Save button.

reboot android and take screenshot of current screen programmatically

Hello
Is there any way to reboot and take screenshot of android?
Settings.System isn't working for me.
Settings.System.putInt(context.getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, 200);
And, is there any way to take screenshot of current device screen, from application/service?
Thanks
Is there any way to reboot android programmatically?
Unless your app is signed by the system key, no.
Is there any way to take screenshot of current device screen, from application?
On most non rooted devices this isn't possible, but on some you may be able to parse the framebuffer if it is accessible (it isn't on the majority of devices).

System overlay android 4.0

Before android 4.0 you could create and overlay over any app with TYPE_SYSTEM_OVERLAY and get touches with FLAG_WATCH_OUTSIDE_TOUCH... Now with android 4 you cant receive the touches.
basically the idea follows this app,
http://www.appbrain.com/app/smart-taskbar-%28sidebar%29/com.smart.taskbar
You can keep your app open, or always on top. it will run over any app.
Ive looked every where for information and even source code for the use on android 4.0 but no luck... Now.. I know for certain there are apps that still do this even on 4.0... there is still a way. Any ideas?
I found a full sample app here that works for Android 4.0
Here is the highlight:
To create an overlay view, when setting up the LayoutParams DON'T
set the type to TYPE_SYSTEM_OVERLAY.
Instead set it to TYPE_PHONE.
Use the following flags:
FLAG_NOT_TOUCH_MODAL
FLAG_WATCH_OUTSIDE_TOUCH
FLAG_NOT_TOUCH_MODAL << This one is quite important. Without it, focus is given to the overlay and soft-key (home, menu,
etc.) presses are not passed to the activity below.
Also make sure you add the SYSTEM_ALERT_WINDOW permission to the
mainifest file.

Capture android screen and create video programmatically

In Android/Java, Is there any code example to capture the screenshot of a computer with good frames per second programatically and create video?
I'd like a tutorial or full source code to do this. I'd like the program to work with and without the device having been "rooted".
There is app in the play store called Screencast Video Recorder that does this. But you need to ROOT the device for it to work, so I know it can be done.
What's the best way to capture android screenshot and create a video programmatically on a non-rooted device?
There is an app called Telecine that is open source that allows you to record screens - the code can be found at https://github.com/JakeWharton/Telecine. All credit is to Jake Wharton.
If you need an example, you can find one at Commonsware's github page - Mark Murphy has provided a sample app for both screen capture and screen recording using the MediaProjection APIs.
you can capture the screen via using DDMS as adb runs and has permission to the framebuffer:
follow this link for more details :
http://thetechjournal.com/electronics/android/how-to-capture-screenshots-and-record-video-on-android-device.xhtml
ALSO
check this links may be get some ideas about what you need :
http://answers.oreilly.com/topic/951-how-to-capture-video-of-the-screen-on-android/
http://www.mightypocket.com/2010/09/installing-android-screenshots-screen-capture-screen-cast-for-windows/
and check this project :
http://sourceforge.net/projects/ashot/
hope this help .
Check the following link
https://code.google.com/p/java-remote-control/
in this project the owner has created a java remote control i.e. he has captured the images from the remote computer and transfer to server and convert it to movies with different format all you need to understand what he has done and implement the same for all your needs. you can access the full source code with SVN client from the following URL
http://java-remote-control.googlecode.com/svn/trunk/
Also you can look for the Remote class in java which provides createScreenCapture method
As of Android 4.4, there is a screen recording feature accessible via adb.
http://developer.android.com/tools/help/adb.html#screenrecord
The screenrecord command is a shell utility for recording the display of devices running Android 4.4 (API level 19) and higher. The utility records screen activity to an MPEG-4 file, which you can then download and use as part of a video presentation. This utility is useful for developers who want to create promotional or training videos without using a separate recording device.
Try this application from the market
https://play.google.com/store/apps/details?id=com.ms.screencastfree
** Does not work on Galaxy Nexus or Tegra 2/3 yet **
EDIT 28/11/2014
Lollipop has been released and provides a new Screen recording API
http://developer.android.com/about/versions/android-5.0.html#UI
Screen capturing and sharing
Android 5.0 lets you add screen capturing and screen sharing
capabilities to your app with the new android.media.projection APIs.
This functionality is useful, for example, if you want to enable
screen sharing in a video conferencing app.
The new createVirtualDisplay() method allows your app to capture the
contents of the main screen (the default display) into a Surface
object, which your app can then send across the network. The API only
allows capturing non-secure screen content, and not system audio. To
begin screen capturing, your app must first request the user’s
permission by launching a screen capture dialog using an Intent
obtained through the createScreenCaptureIntent() method.
For an example of how to use the new APIs, see the MediaProjectionDemo
class in the sample project.

Categories