The Android SDK has a demo version of the API for previewing the camera. However, this gives me an exception at runtime in the emulator. I have been working with Eclipse on Mac since 10.6
Here is the link where I grabbed the code:
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html
Make sure you set permissions in the AndroidManifest.xml file to use the camera. Place this line above the application tag.
<uses-permission android:name="android.permission.CAMERA" />
I have things to work with my Nexus One.
"", API . Android Camera:
https://android.googlesource.com/platform/packages/apps/Camera
, , . SurfaceChanged startPreview. .
NexusOne.
Corey Trager, , ApiDemos, 2.1 SDK.
, , - CameraPreview
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h){..}
:
parameters.setPreviewSize(w,h);
parameters.setPreviewSize(352,288);
, Dev1S G1.
you can use
List<Camera.Size> getSupportedPreviewSizes ()
And select a size from the list
This issue is also mentioned in Google Android Android , and it may be useful for you, the code mentioned below in one comment as a possible solution to solve preview problems.
Source: https://habr.com/ru/post/1730311/More articles:Are .fsx files interactively compiled in debug or release mode? - f #C ++ Allow host IP from URL - c ++Display keyboard shortcuts in context menus Visual Studio - visual-studioHow to implement a function that can take arbitrary parameters in PHP? - functionC structure available in Java - javaОпределение того, что слово "есть" - категоризация токена - searchHow can you speed up the restart of an ASP.NET application? - performanceCan I get my copy of Mechanize.Browser to stay on the same page after calling b.form.submit ()? - pythonHow to quickly launch an ASP.Net application to reboot / recycle on a site with high traffic? - performanceКак разбить строку на предложения cocoa - stringAll Articles