android screen capture without layout root view - android

Actually in android mobiles when we press the home button and the side button at a time we can make a screenshot. which event is running at the time of pressing?
In the camera event we fire android.provider.MediaStore.ACTION_IMAGE_CAPTURE.

Posts about how to make a screenshot:
This: screenshot in android
or this: How to programmatically take a screenshot in Android?
or maybe this: https://stackoverflow.com/a/10482368/1164919
But i did not find anything about some kind of provider as you describe in your post.

It looks like there is a dedicated service running from android 4.0 and up which helps to take screenshots by the way you have mentioned here.
But I am not aware of how it happens in the previous versions of android.
Here is a link to the Service TakeScreenshotService. When you look into it you will be able to see another class which actually is responsible for capturing the Screenshot and storing it. And here is the link to the class GlobalScreenshot.

Related

Take screenshots from other apps as image source

I'd like to offer an app to modify images. In order to have the user give an easy access to the that feature, it would be the easiest solution to just let him directly take a screenshot to have the source picture taken or respond to a screenshot event and access the latest screenshot.
Unfortunately it seems to be a problem, since an app or even a service from the app runs in background cannot easily react to events and I haven't found any solution that would go only little close to that kind of thing.
So my questions are (lets assume all necessary permissions are given from the user):
Is there a possibility to register my app as kind of standard screenshot app (or additional screenshot app triggered by another key combination of the device) and how ;-)
Can an app stay in a state to notice if a screenshot is taken and
can access it?
If not: Any ideas for an workaround other than let the user select a taken picture, which is rather kind of roundabout and annoying?
Any hints are very welcome! Thank you in advance!
(Since I had a misleading headline, I reposted this question - sorry!)

Android - Take a "Screenshot" of an App Running in the Background

I have read plenty of questions that deal with an app taking screenshot of the current users screen while the app runs in the background, but have not seen many articles that deal with the app taking a "screenshot" of itself while it runs in the background.
I would like this to be able to be done without having to root the phone in any way as I would like the app I make be available to everyone(rooting is probably not involved in this solution, but just throwing that out there).
The end goal of the app is for the app be able to take a screenshot of itself and save that screenshot as the users background wallpaper. There are several other features I would like to add, but I would just want to know, is this even possible? If this is, could anyone show me some starter code or link me to some?If this question has been asked before, please let me know, otherwise, any and all help is appreciated. Thank you!
Firstly, I am not really sure if I understand your requirement correctly. Ideally when the app is in background, its state when it went to the background and while it is in background will remain the same. So you can take a screenshot of your app, when the app is just going in background, which can be handled in your onPause() of the activity.
To take screenshot of your app, place the entire layout in a ViewGroup and then use the following code.
parentLayout = (RelativeLayout)findViewById(R.id.parentLayout);
parentLayout.setDrawingCacheEnabled(true);
parentLayout.buildDrawingCache();
And when you want to take a screenshot, get the screenshot in the Bitmap by using
bitmap = parentLayout.getDrawingCache();
The above line should be in your onPause() thats when the app goes in background. Or you could also trigger it when your app is in background, and see if it is captured. I'm not really sure how it will work in the latter scenario.

create live wallpaper in viewpager android apps

Hi i have a app contain 3 page. and i want to set one page as background like android home screen. I search in google and i found this and this
tutorial's but i couldn't use it for my target can anyone show me another better example thanks.
i mean How can i create app like android home screen which have one picture for 5 pages background (in my phone).
at last i found my answer and that was so simpler that i think.
that was not a live wallpaper that was simple trick using scroolview for background of main layout and listen to onPageScrollStateChanged.
that's it.

Adding a screenshot feature to Android 2.3

I'm implementing a screenshot feature for Android 2.3 (I know that ICS has a screenshot feature already). I'm using the Android Screenshot Library (ASL for short) project as a base, and I'm modifying it to suit my needs. I can also freely modify Android's source code for it. The goal is to have something like what the Galaxy Note does: you take a screenshot with a key press combo and then an editor shows up which allows you to change the image however you like. You could take a screenshot anywhere: on the main screen, while using apps, etc.
Right now I have 3 working parts: a native binary that captures the screen buffer, a service that talks to the native binary and retrieves the screenshot, and the editor. But I'm not sure how I could join the 3 things together. The native binary can be added to the Android prebuilt part and init.rc can be modified to execute it as root when booting (I still have to do this though). The editor is a simple app that can be included in Android as well. But I still can't figure out what to do with the service.
Ideally I'd like to capture a key press combo (say power button and volume down, or maybe two of the front buttons), which would trigger the service. The service would then call the binary to take a screenshot and launch an intent to open the editor with the screenshot. However, as far as I know a service cannot catch key presses. Besides, the service has to be bound somewhere in order to know when it has to take a screenshot, so I guess that I should modify Android itself to start the service and bind to it at startup, but the documentation regarding Android source code is lacking and I have no clue where to start looking.
Does anyone know what component of Android is in charge of the key presses, and where I should bind my service? Is my approach even possible at all?
Thank you in advance for any possible help.
Take a look here. It suggest using the camera button, which is certainly better than overloading other system buttons.

Demoing android app screenshots

I need a way to show off concept designs of an android application on an android phone to simulate that it is running. Basically just being able to tap to advance to the next photo/screen would be sufficient with a tap ANYWHERE on the screen. Any tools you know that would be helpful?
Eclipse with Android toolkit.
Write a small program. wont take up much time.
[update]
No coding is required. Create an android project Using Eclipse android project, you can visually create UI prototype (i.e. drag and drop .. no coding). Use main.xml after developing each screen run the project in emulator, you can take screenshot of the same (either using eclipse DDMS plugin's snapshot capability or using Alt+Print screen in windows or something similar in other OS). Use this screenshot in a powerpoint presetation . Repeat the same process for a second screen (overwrite the same main.xml so that you dont have to write code). take screenshot again. Add the required animations in powerpoint.
Is there any other option that does not involve any code?
The easiest way I can think of is:
1. Take screen shots(wireframes, screen prototypes) for every screen flow you wish to demonstrate.
2. add them in proper sequence(regulated by sequence number) to your sdcard.
3. Open Picture gallery and use swipe gesture to transition and cycle between screen, walk through all the screen flows.
Do it photoshop, create images, add it to an activity. Create a layout that fills the parent, add it as a background. Then implement a ontouch method to finish the activity and load the next. Quite simple.

Categories

Resources