Capture Android screenshot without having the View - java

I have found a lot of examples like this:
how to Capture screen in android and covert it to image
I need to capture an screenshot of screen activity, but I'm developing an external library, so I can't get current activity of the application to get the View and then flush the bitmap into canvas. Is there another way to capture a screenshot?

If you are trying to save the image from Snapchat, you need to save the Bitmap in another way.
With a rooted phone you can access the apps storage and copy the image while the app shows it.
That way the app wont notice you took a "Screenshot" :)

Related

Can you display the real-time output of the device's camera?

I am wondering if it is possible to show the output of the camera running on your device immediately on the screen. Just like the native camera app does.
I have to show the picture, that comes into the camera lens, and additionally add some graphics overlays. That's why I guess, starting an Intent to open the camera activity is not suitable.
I've found some SO Threads, Tutorials and documentation about using the Android Camera API, but they are all able to just take a picture and display it afterwards.
Is it possible at all?
Refer to this link Camera Tutorial for Android (using surfaceview)!
Use the SurfaceView to preview the camera output, then, you can add your graphics overlays as you wish.
Hope this helps :)

Getting Data From Online (Android)

I want to make an photo gallery app, so I want something like I upload pics to a webpage and it automatically gets displayed in that app.
I don't want to edit the coding for every single image and yess I don't want "WebView" all I want is a pure native android app, that gets data (images/audios/videos) from a webpage and display it in my native android app activity.
What you need to use is a grid view, you pass an array with the links to download the image and place them in each row.
Here is an [example] (http://www.tutorialspoint.com/android/android_grid_view.htm) of how to use it.
Hope it helps

Save as a image which is on android screen

I want to save as an image which is on android mobile screen at 10 sec time interval. Which may be home screen or menu screen or any thing. Can anybody tell me how i can achieve this?
I got success for my own application but its not capturing menu screen as an image.
Unfortunately, on most devices it's not possible to get the snapshot of the device outside your application. This, obviously, for security reasons.
This could be achieved accessing the frame buffer at /dev/graphics/fb0, but normally you don't have the permissions to read that.
You need to have a root access to achieve this. Write a background service and execute "/system/bin/screencap" to get the screenshot. Check this answer to find out how to get screenshot and store in sdcard.
Alternatively you can use Android Screenshot library to get screenshots on a non-rooted phones but it requires your phone to be connected to your desktop using ADB.

How do you auto-rotate a captured image using Phonegap?

I'm working on an example I got from Phonegap on capturing Images using the built in device camera. If I rotate the device, the saved image stays in that orientation.
I know in javascript, I can manipulate images-- and Phonegap has a G-Calibration sensor api I can use.... but Is there a straight forward way through Phonegap to auto-detect orientation?
the problem is that the exif data (which contains the orientation among other things) is not passed by the plugin.
For this reason you need to try to understand which "way" the picture was taken.
Worst case, allow the user to rotate it.

How do I retrieve the photographs taken by the camera on a phone running Android OS?

I am developing an Android application that retrieves the photographs taken by the phone camera and converts it to an alternative format. How can I retrieve the photograph that has just been shot as well as those that have been shot some time ago but still exists on the phone?
Converting the image format for existing images is just a matter of recursing file storage for images, usually the sd card but not limited to it. As far as hooking into the existing camera application you'll have to review its source to see if that is possible but you can have a service listen for the camera button and start checking for new images to convert. Android does not keep a central database of images or discriminate between "camera" and "other sources" meaning someone or something will have to decide what to convert.
You also may want to consider using the existing camera app as a library and extending it so that you are guaranteed to get the image right after its created.

Categories

Resources