B4A Library Camera2 - New camera library

Status
Not open for further replies.
Camera2 library is based on the newer Camera API introduced in Android 5 (API 21). It is therefore supported by Android 5+ devices.
It requires B4A v7.3+.

The library is built to work together with CamEx2 class.
Camera2 native API is more complex than the old API. However together CamEx2 and the resumable subs feature it is quite simple to use.

SS-2017-09-14_17.27.38.png


See the tutorial for more information: https://www.b4x.com/android/forum/threads/camera2-still-images-and-videos.83920/

V1.10 is released. You need to update both CamEx2 (available in the tutorial) and the library.
Most of the methods now expect a task index parameter. See the tutorial for more information.

Camera2 is an internal library now.
 
Last edited:

BillMeyer

Well-Known Member
Licensed User
Longtime User
Thank you - I must say - that desk looks amazingly like mine.
 

Toley

Active Member
Licensed User
Longtime User
Will it eventually replace the actual Camera Lib and be include in future B4A release?
 

JordiCP

Expert
Licensed User
Longtime User
I guess they will co-exist, at least for a very long time (until there are no devices prior to Lollipop on Earth)
The drama will come when Android definitely drops the legacy camera APi (right now, though deprecated, it is still present in Android N, and not sure if Android O): when this happens, a lot of apps using the legacy camera API will stop working for those devices :eek:
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Will it eventually replace the actual Camera Lib and be include in future B4A release?
There are two questions here:
1. No. It will never replace the Camera library. You will be able to choose whichever one you want.
2. It will probably be included in the IDE starting from the next version.
 

Croïd

Active Member
Licensed User
Longtime User
btnAutoExposure (sample) does not work for me ( android 7.1) ! do you have the problem?

I use Camex1.11
 

Croïd

Active Member
Licensed User
Longtime User
Flash does not start !

B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Start success: true
ON_AUTO_FLASH
ON_ALWAYS_FLASH
OFF
ON
Picture taken: (Bitmap): 1080 x 1920, scale = 1,00
 

Croïd

Active Member
Licensed User
Longtime User
Thank Erel now the flash fires :)

But the temporary image does not take into consideration light ! as a synchronization shift between the light and cam.DataToBitmap(Data)
 
Status
Not open for further replies.
Top