How to use web camera in android emulator to capture a live image?
- Download all the source files listed on the page: CameraSource, GenuineCamera, HttpCamera, SocketCamera, BitmapCamera, and WebcamBroadcaster.
- Create a package in your project called com.tomgibara.android.camera and place the first 4 source files inside.
- Download JMF from here and install it.
- Compile WebcamBroadcaster using the following command: "C:\Program Files (x86)\Java\jdk1.6.0_15\bin\javac.exe" -classpath "C:\Program Files (x86)\JMF2.1.1e\lib" WebcamBroadcaster.java or what's equivalent to it.
- Run it with the following command and keep it running: java "-Djava.library.path=C:\Program Files (x86)\JMF2.1.1d\lib" WebcamBroadcaster
- Use the following code in your program:
CameraSource cs = new SocketCamera("192.168.0.100", 9889, 320, 240, true);
if (!cs.open()) {
/* deal with failure to obtain camera */
}
while(/*some condition*/) {
cs.capture(canvas) //capture the frame onto the canvas
}
cs.close();
PS: I haven't been able to test this because I'm getting an error when I run WebcamBroadcaster
.
PPS: I just started experimenting with Android today so all this could be wrong.
Android: How to use webcam in emulator?
UPDATE
In Android Studio AVD:
- Open AVD Manager:
- Add/Edit AVD:
- Click Advanced Settings in the bottom of the screen:
- Set your camera of choice as the front/back cameras:
Using Camera in the Android emulator
Update: ICS emulator supports camera.
Android emulator camera custom image
Download the source from following url . This is work as the another Gallery in the emulator.
While passing intent to capture image from camera choose this gallery. this is looks like samsung mobile 3d gallery.. this will return the default images.. in emulators . one more thing it will work fine after 3.0 versions only.
https://github.com/c-jiang/Gallery3D-Mod
Android Emulator + Web Cam
Take a look at this question here at stackoverflow: How to use web camera in android emulator to capture a live image?
Webcam for testing camera in Android AVD?
Using Eclipse.
- AVD Manager
- Edit the AVD.
- Hardware > New:
- Configures camera facing backwards = "webcam0" (use dropdown).
Run project using that AVD.
Related Topics
Get Spinner Selected Items Text
Android Layout Replacing a View with Another View on Run Time
Android: Force Edittext to Remove Focus
How To: Define Theme (Style) Item for Custom Widget
Common Class for Asynctask in Android
How to Compile the Android Aosp Kernel and Test It with the Android Emulator
Why Does Eclipse Automatically Add Appcompat V7 Library Support Whenever I Create a New Project
Is There a List of Screen Resolutions for All Android Based Phones and Tablets
Resolved Versions for App (22.0.0) and Test App (21.0.3) Differ
How to Delete a Whole Folder and Content
Connectivitymanager Getnetworkinfo(Int) Deprecated
How to Set Entire Application in Portrait Mode Only
How to Change Color of Textinputlayout's Label and Edittext Underline Android
Android Custom Dropdown/Popup Menu
Display the Current Time and Date in an Android Application
Java.Lang.Illegalargumentexception: View Not Attached to Window Manager