B4A Library Camera2 - New camera library

Discussion in 'Additional libraries, classes and official updates' started by Erel, Sep 12, 2017.

  1. Erel

    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.

    Attached Files:

    Last edited: Sep 14, 2017
  2. BillMeyer

    BillMeyer Member Licensed User

    Thank you - I must say - that desk looks amazingly like mine.
    Erel likes this.
  3. NJDude

    NJDude Expert Licensed User

    I have to ask, will this new lib break any existing apps using the previous Camera lib version?
  4. Erel

    Erel Administrator Staff Member Licensed User

    No. This is a different library named Camera2.
  5. Toley

    Toley Active Member Licensed User

    Will it eventually replace the actual Camera Lib and be include in future B4A release?
  6. JordiCP

    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:
  7. Erel

    Erel Administrator Staff Member Licensed User

    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.
    Toley likes this.
  8. Erel

    Erel Administrator Staff Member Licensed User