Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo SDK Support › NativeDialog camera on Android

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25576

    nks (baumemo)

    Hi Felgo Team,

    its me again^^ I’m sorry. I found an interesting bug. I used nativeUtils displayCameraPicker to take a photo. I replaced it with NativeDialog.camera to reduce boilerplate code.

    This seems to work on iOS but makes problems on android in my app. Can you check out the problem? Tested on Google Pixel 8 and Sony XPeria X compact. Both didn’t work.

    Here is some code.

    Before (we opened a extra page to take the photo, this works perfectly):

    import Felgo
    import QtQuick
    
    AppPage {
        id: currentPage
        title: qsTr("Kamera")
    
        Component.onCompleted: {
            nativeUtils.displayCameraPicker("Foto aufnehmen")
        }
    
        Connections {
            target: nativeUtils
            onCameraPickerFinished: {
                if(accepted)
                {
                    console.log("Foto aufgenommen");
                    logic.storeImage(path);
                }
                currentPage.navigationStack.pop();
            }
        }
    }

    New (this works not on android. Get called from click event handler):

    NativeDialog.camera((success, path) => {
        if(success)
        {
            logic.storeImage(path)
        }
    })

    Thanks for your support.

    #25577

    Günther
    Felgo Team

    Hi,

    thank you for the bug report. I added it to our Bug-Tracker so we can take a look and fix it for a future update.
    As the Camera implementation using NativeUtils still works as expected I suggest to use this one for now.

    Best,
    Günther

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded