I've tried to start the camera and use it my app - with unsatisfactory results. I followed the sample code provided in the android SDK (the Preview class), and I got bad results - the camera was rotating and when I tried to add a button, it never showed up.
I checked other apps and it looks like the skype app uses the same camera app as the one built into the phone. I want to know how I can implement this in my own app. Any solutions?
Related
I have an Android app that is transparent that monitors for an event and then displays a message and toggles the background between transparent and a translucent red. The app itself is working exactly as I was hoping. The problem is that only the top most app (my app) is active and updating the view. The app displays over a 3rd party app that runs a live video stream. I want the live video stream app to continue to update while my transparent app is on top. Since I have no control over the other app and it doesn't support multi-window approach, I am looking for a different approach or work around to accomplish the same thing.
I have read of people trying to use a system popup based on a service. Does anyone have experience trying to solve a similar problem and found a good approach for designing the app or a work around?
Try to google about Activity lifecycle. When another app comes as the top application (let's say your transparent app) the last playing application goes to onPause until the user bring the last app back to the top again.
The short answer is: what you want is not possible.
any question?
I'm using the first method outlined in this answer (https://stackoverflow.com/a/10229228) to invoke the camera app to let the user take a photo and return it to my app. What I want to do is get a series of photos from continuous (burst) shot mode, but invoking the camera app in this way only allows the user to take a single photo.
I have tried adding code to my app to use the camera directly with autofocus set to infinity however it doesn't get anywhere near the performance of continuous shot mode.
Is there something I can add to the intent I'm starting to tell it to use a different mode?
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.
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.
I am writing a simple android camera application (SDK version 7). Can I handle camera button like in native camera app, i.e. soft click - focus, and hard click - capture photo ?
Be aware that many android devices do not have physical camera button. It is safer bet to allow the way for the users to use touch screen for both focusing and taking photo.
Anyway, since you mention native camera app, I assume you mean the official camera app. In that case, you can find the source code at https://android.googlesource.com/platform/packages/apps/Camera.git