Android - fool-proof camera activity - android

What I want to do is be able to take a picture with my app and return that picture to an activity...either to modify it or simply view it. My possible problem or question is: How do I know this will work on all versions of Android phones? I know some phones run different versions/flavors of Android. Some will also have a manufacturers software overlayed on it. Is it possible to write one method that handles all phones and their cameras?

Use the ACTION_IMAGE_CAPTURE intent. See this for more info.

Related

Simple android application to prevent the use of camera

As the title stated, I want to design simple application without interaction from the user. After installation it will block the camera. then start a timer to release it after some time.
I tried 2 options: device manager using set camera disabled method but I could not run the project because of some errors in the manifast.
now I'm trying just to create a camera object to reserve the camera from other applications. but still the native camera app was able to start the camera.
My question: is my method correct? or there are much simpler ways to do it.
device manager using set camera disabled method but I could not run the project because of some errors in the manifast.
Perhaps you should consider asking a separate Stack Overflow question where you explain what you tried and what specific problems you encountered. If by "device manager" you mean the device administration APIs, this is the proper way of implementing what you want.
is my method correct?
No.

How can I programatically take a screenshot of the entire app?

I'm working on UI automation tests for an Android app. I need to save off a screenshot of the app as it appears during various steps of the test for later analysis by test engineers.
The usual way to do this in Android is to get the Window, then get the DecorView, then call onDraw with a Canvas backed by a Bitmap and save the Bitmap. This doesn't work when a Dialog is showing on top of an Activity, however. The Dialog and Activity each have their own separate DecorView.
Is there any way to programatically take a screenshot of the entire app with all windows composited? Unfortunately, the device is not rooted and the app does not have signature permissions, so this answer in another thread does not apply:
https://stackoverflow.com/a/13837910/244521
For phone devices: This article shares some tips that might help. However, on ICS and above, you may need to use Home + Power, not Volume Down + Power, as the article says.
For automated tests, perhaps AutomatedScreenshots will help

Capture screenshot with mobile image in Android

I have developed an application and need to have the screenshots of the application. I am able to achieve this using the devices/capture screenshot in Eclipse. But, this gives the contents inside the screen. I want the screen shot with the mobile background where i can publish or use it for website. Is there a way to achieve this?
Are you looking for the Device Art Generator?
Some custom ROMs like CyanogenMod have a built-in screen capture 'plug-in' which you can access.
Have you take a look at this already?

is it possible set pendingtransition while starting external intent like camera

Is it possible like in topic, I mean start camera intent and before opening that view set screen not to see rotating screen effectc? I was trying to use overridePendingTransition after startingActivityForResult, I tried also to put this overriDePendingTransition while calling onPause and OnResume. Somehow camera uses own animation. I would like to disable that animation. Is is possible? This effect doesn't affect in android 2.3.x. Does it might have connection with touchWiz?
TL:DR
As of KitKat 4.4.2 this still does not seem possible. Tested with AOSP phone app, Nexus 5 experience Phone App, Maps, AOSP Browser and Chrome.
(I would have put this in a comment, not enough rep yet. It's still an answer per-say, though not a solution to the problem)
Only thing I can say about why it's not possible is:
If you could force a transaction on the "external" intent through
your own app code, you would be basically injecting your animation
into another publisher's app, which would be a MAJOR design flaw
in the Android framework.
My guess is this will never be possible unless the OS manages such transactions in a bullet-proof way to both ends. Some AOSP branded-builds and custom Launchers can change default animations for ALL activity starts/resumes though (or even use no animations at all).

Taking device screenshot while application is close

I know this question is ask number of times but wait i am asking something different.
I follow this post and able to take screen shot. but is it possible to take screen shot when my application is closed.
Supposed i set timer like after 1 hour and i close my app. Then exactly after 1 hour device need to take a screen shot whatever on a screen.
Is this possible with Background Services?
I already follow code and also did some research but is this possible?
Is it necessary to root device to take screenshot.
Please give me any hint or reference.
Thanks in advance.
Try using : call the methods in this library from service.
http://code.google.com/p/android-screenshot-library/
Android Screenshot Library (ASL) enables to programmatically capture screenshots from Android devices without requirement of having root access privileges. Instead, ASL utilizes a native service running in the background, started via the Android Debug Bridge (ADB) once per device boot.
DeveloperGuide
UPDATE:
The method mentioned in your reference will not work in that case, as it reads the view that are drawn and in application context. where as if application is closed then you cant get that context.( at-least on non rooted phone).
On rooted device you can read complete frame-buffer so no need to worry about the application context.
I did tried to use the ASL once and it worked out good for me.

Categories

Resources