I need to take screenshots from my application running on my android device. Its connected via USB to my computer and thus it is simple to take a single screenshot of the device by refreshing and saving the captured image via the DDMS tool in eclipse. fine.
But I need to take screenshots continously e.g. every second during several minutes. I can't take these screenshots manually, since I have to manage the application while I want to take the screenshots. Is there a possibility e.g. any computer programe to capture and save the screenshots from my computer continously? The DDMS tool doesn't seem to support such a request.
Recording a video of the device would also satisfy me.
Please without rooting my device!
But I need to take screenshots continously e.g. every second during several minutes
You are unlikely to achieve every-second frame rates.
Is there a possibility e.g. any computer programe to capture and save the screenshots from my computer continously? The DDMS tool doesn't seem to support such a request.
Use Droid#Screen.
Recording a video of the device would also satisfy me.
Buy a device with HDMI-out support and use an HDMI recorder.
Related
Is there a way to take an image of an android system running on phone and run it on emulator?
I have a client with a certain bug on his phone and I want to be able to take a snapshot or an image of the Android and run it on the emulator to debug it freely without the need to take the phone from the client cause the problem seems to happen only on his phone.
You can't do what you want for a couple reasons. For one, getting the ROM image off the phone wouldn't be a trivial matter. In fact, I can't really think of a way to do it at all. Unless this is a Nexus phone or something where the manufacturer has made the images available for download, manufacturers generally don't want you mucking about with system images.
The more important reason is that the software running on a phone expects to be conntected to the physical hardware of the phone: the processor and chipset, the GPU, all the input and output devices, sensors, and so forth. The ROM image has device drivers that talk to all of that. For that image to work in an emulator, the emulator would have to emulate all of those devices well enough to fool the device drivers, which is a very complex thing, and that environment doesn't exist anywhere -- even manufacturers don't emulate their hardware to that extent when developing it. Much of that hardware and device driver environment is manufacturer-proprietary, so it would be impossible (or legally difficult) for someone other than the manufacturer to make that possible.
The Android emulator has a specific kernel image with device drivers tuned to its software emulation environment; what it's got is designed specifically for that environment. The other side of the equation is also true: you couldn't take an emulator system image and get it running on a physical device.
In your case, I would suggest you to upload your apk file to testfairy, then you can have the option to trace user's activity with your app, and it also have an error log that might even more useful.
I've got a DSLR camera and Samsung Galaxy Tab running Android Honeycomb. DSLR connected to a tablet using USB-cable (via USB kit enabling host functionality on a tablet). I'd like to being notified when user takes a photo using this external camera, in order to download this image to the tablet or do something else with it like showing Toast notification containing meta-information taken from the image.
As far as I get all of the existing tools (like FileObserver using underlying inotify mechanism, MediaContentProvider etc) allowing to watch for changes, demand a specific file or a filesystem path to be watched. This was good enough till we had a block layer protocol support in 2.x and earlier Android versions - when you connected device it'd been mounted somewhere on the device's filesystem and you was able to use this mountpoint as a watch point for those tools.
Since Honeycomb Google has changed the way of accessing external USB devices to Media Transfer Protocol with PTP as a subset of this. Now when I connect external USB device to an Android device I won't see any mountpoints for it (I'm using adb shell and subsequent mount command for getting them). Moreover, MTP implementation uses storage ids which apparently act as a higher level of abstraction and are just plain integer values. I was hoping there is a way to somehow translate these storage ids to the real paths/mountpoint/whatever but apparently there does not appear to be.
Thinking about Android MediaScanner which is already running on my device I guessed it could manage this issue with a special Intent broadcasted when there're changes in media files accessible from the device, so I started looking for already existing and suitable Intents for being notified, but no luck - I found only ACTION_MEDIA_MOUNTED and ACTION_MEDIA_REMOVED which are broadcasted only when device is connected and disconnected respectively. That means MediaScanner can't notice any changes on the device until you remount it (I've double checked it using stock Gallery app - it doesn't see any newly created images on the camera until you unplug and then plug it into the Android device again).
Trying to get this mount path for external sdcard, I used Environment.getExternalStorageDirectory() API call but it yields emulated Galaxy's sdcard path
which is /mnt/sdcard, not the camera's one. So it doesn't work for me either.
I managed to work out this issue only having launched periodic Timer event with AsyncTask acting as a TimerTask. This task does initialize usb connection, open device,
scan the whole device memory, getting only the last taken photo and then close device descriptor and usb connection.
It doesn't look like the best and efficient way of doing that taking into account it has to do all of these actions every time which could be pretty often, say each 5 or 10 seconds. It definitely quickly drains battery out and produces unnecessary system I/O for only taking last taken photo and comparing it with the previous last taken photo (in 99% it'd the same image), but I haven't found any better working solution for doing this. It'd much better off to have an observer mechanism with event-based notifications.
So my question is there more efficient way of being notified about changes in external USB storage for Honeycomb or later Android versions rather than one described above?
If you would like a more efficient way the camera would have to send out some sort of signal over usb that it has taken a photo. I guess it is not doing that.
Therefore you will have to check manually by doing the way your are discribing:
mount storage --> check for changes --> do your thing with your detected changes.
I dont know what you used to read "the MTP way" but here an example application:
https://github.com/ynakanishi/Honeycomb-MTP-sample
To not scan the entire storage every time you could save the result of read out file names for example every time you check and compare it to find the new ones. Usually the naming of the file also starts with the same number on a camera. So if you start a session with an empty sd card you know already the file name the photo will have. lets say img0001.jpg. So you just need to write a function to grab that file until it succeeds. if you want the next one img0002.jpg you can write a task/service/function to grab that file until successful, and so on.
If you want to save on battery you could implement an additional battery/power source inbetween for powering the usb port.
Instead of an Async task or timerTask you could try a ScheduledExecutorService and see if it uses less power.
Hope that gave you some new thoughts
I want to take automated screenshots of a running emulator, e.g. every 10 seconds and then save them into a directory.
I found out that I can do screen capturing with DDMS, but only over the UI. Is there any console based scripting API?
If you want to do it on System side then take a look at Android-DDMLIB. And Droid#Screen Also look at this tutorial Android: How to take screenshots from command line.
Or if you want to do all this at android device side then you have to root permission and read the device framebuffer for it.
We have recently bought ~20 different Android phones for testing (the emulators/online services just aren't good enough). When the phones are connected all at the same time the driver detects around half of them, but if I connect them one by one all are detected.
Is that a problem with the USB driver? Are there any alternative ways of doing this? I know that it is possible to run adb connect
[IP]:[PORT] but it seems like you need to root the phones for that.
I think you should be looking for a different means to get your apk onto your devices. I find myself testing on a similar number of devices, what I've gone to most recently is drop the apk inside dropbox and copy a link to it, then generate a QR that points to that link. Then I can just scan the QR with all of the devices I want it installed on. Bypasses the need for adb drivers too.
Yes , it's possbile, watch this url https://play.google.com/store/apps/details?id=com.tete.wifiadb
i'm developing an android app that needs to capture a camera picture,
is there any way to configure my AVD to use my conputer webcam on the emulator?
when i open the default camera app it shows me an squareanymation, can i use/configure the emulator/avd to use my computer webcam?
I really can't think of a way to do this.
I would do the following:
During development, when debugging on an actual Device under adb, use the camera as normal. While debugging on an AVD, comment out your camera code and us a pre-taken a png to your app that resembles/emulates the photo the camera would have taken. This would let you work on the picture analysis regardless of the camera, and finish your app without an actual ADB device, just AVDs. One you get ahold of a real device you can finish up.
On another note, if you are ready to go poking around in VMs, Android Kernels, and HALS, you could follow this article (http://bytecruft.blogspot.com/2011/05/alternative-to-android-emulator-and.html) which tells you how to setup Android X86 under VMWare or Virtualbox as an ADB Device. I'm sure setting up the host machine's webcam as a camera would be much easier that bay (VMWare device bridging comes pretty close).
Hope I helped.