Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › How to combine Felgo with Androidnative for advanced system integration?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #22753

    Abe

    The open source library androidnative offers an advanced system integration for Android apps that goes significantly beyond Felgo features. Can I combine this library with Felgo and if so, how? However, the library was last updated two years ago, so the question arises whether it makes sense to build on this or to migrate the project to the JNI integration from Felgo.

    #22781

    Abe
    #22786

    Alex
    Felgo Team
    #22788

    Abe

    Androidnative requires a special instantiation in the main class. This might be a conflict:

    #ifdef Q_OS_ANDROID
    #include <AndroidNative/systemdispatcher.h>
    #include <QtAndroidExtras/QAndroidJniObject>
    #include <QtAndroidExtras/QAndroidJniEnvironment>
    
    JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
        Q_UNUSED(vm);
        qDebug("NativeInterface::JNI_OnLoad()");
    
        // It must call this function within JNI_OnLoad to enable System Dispatcher
        AndroidNative::SystemDispatcher::registerNatives();
    
        return JNI_VERSION_1_6;
    }
    #endif

    Android native offers a convenient way to bridge QML and the Android Java API. It even offers already some convenient QML types and methods, for example to retrieve messages or make a call. Felgo offers only the standard way for JNI and a limited set of convenient methods like retrieving the address book.

    #22789

    Alex
    Felgo Team

    Hm, I don’t see an obvious reason why this should not work from within the Felgo main.cpp as well. You might wanna give it a try, and if you do not succeed we can pull in one of our native implementation specialists.

    Cheers,
    Alex

    #22790

    Abe

    Thanks. I’ll try it.

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

RSS feed for this thread

You must be logged in to reply to this topic.