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

FelgoAndroid

FelgoAndroid initializes the Felgo runtime from a native Android application. More...

Import Statement: import Felgo 4.0
Since: Felgo 3.10.0

Methods

Detailed Description

This Native App Integration class is available in native Android code.

It manages integration of your QML code with the Android Activity. Call its static methods from your Activity's corresponding lifecycle methods.

You can then show QML content using FelgoAndroidView or FelgoAndroidFragment.

Note: For simpler integration you can also use FelgoAndroidActivity. It does not require manual forwarding of lifecycle methods.

You can also use setQtInitHandler() to register a callback for Qt runtime initialization.

See also FelgoAndroidActivity.

Method Documentation

void onActivityCreated(Bundle savedInstanceState)

Call this method from your Activity.onCreate() implementation.


void onActivityDestroyed()

Call this method from your Activity.onDestroy() implementation.


void onActivityPaused()

Call this method from your Activity.onPause() implementation.


void onActivityResult(int requestCode, int resultCode, Intent data)

Call this method from your Activity.onActivityResult(int requestCode, int resultCode, Intent data) implementation.


void onActivityResumed()

Call this method from your Activity.onResume() implementation.


void onActivityStarted()

Call this method from your Activity.onStart() implementation.


void onActivityStopped()

Call this method from your Activity.onStop() implementation.


void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)

Call this method from your Activity.onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) implementation.


void onSaveInstanceState(Bundle outState)

Call this method from your Activity.onSaveInstanceState(Bundle outState) implementation.


void setQtInitHandler(QtInitHandler qtInitHandler)

This method registers a global callback for Qt initialization.

Pass an implementation of the interface QtInitHandler. It provides 2 methods for Qt's startup process.

It calls QtInitHandler.onQtInitializing() when Qt is starting, before C++ main(). You can use it to perform any initialization logic of your app.

It calls QtInitHandler.onQtInitialized() when Qt has started, from inside main(). This callback happens after creation of the QApplication and QQmlEngine but before initialization of any QML views. You can use it to load custom native libraries and e.g. register custom QML plugins.

Note: Both callbacks happen on the Qt thread, not the main Android UI thread.


Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded