B4A Library Camera2 - New camera library

Status
Not open for further replies.

Erel

Administrator
Staff member
Licensed User
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.



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:

NJDude

Expert
Licensed User
I have to ask, will this new lib break any existing apps using the previous Camera lib version?
 

Toley

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

JordiCP

Well-Known Member
Licensed 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

Administrator
Staff member
Licensed 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
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
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
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