Qt/qml events for android life cycle events.

676 views
Skip to first unread message

spemin

unread,
May 4, 2012, 7:02:32 PM5/4/12
to android-qt
I'm trying to do some testing with android life cycle. Android has 6
Activity life cycle events: onCreate, onDestroy, onStart, onStop,
onResume and onPause. Those events are implemented in QtActivity.java;
it then forwards to QtActivityDelegate.java through
QtApplication.invokeDelegate() call. In libandroid-<n>.so plugin, it
registered all of 19 native methods that could potentially be used by
QtNative. But QtActivityDelegate.java never forwards some of the calls
there. For example, QtNative never defines onPause() method, as the
result of that QtApplication.invokeDelegate(null) call can never
forward this call there, the native method pauseQtApp() will never be
called.

Only one event onResume makes use of native call updateWindow; the
rest of native methods like pauseQtApp, resumeQtApp, terminateQt never
get calls. Is this the result of incomplete feature implementation? If
I did not read the code correct, then how do those native methods get
called? How do Qt/qml modules respond to those android Activity life
cycle events? It looks to me that it doesn't respond at all.

I would appreciate more input into this issue.

BogDan

unread,
May 9, 2012, 4:31:17 AM5/9/12
to android-qt
On 5 mai, 02:02, spemin <harry...@gmail.com> wrote:
> I'm trying to do some testing with android life cycle. Android has 6
> Activity life cycle events: onCreate, onDestroy, onStart, onStop,
> onResume and onPause. Those events are implemented in QtActivity.java;
> it then forwards to QtActivityDelegate.java through
> QtApplication.invokeDelegate() call. In libandroid-<n>.so plugin, it
> registered all of 19 native methods that could potentially be used by
> QtNative. But QtActivityDelegate.java never forwards some of the calls
> there. For example, QtNative never defines onPause() method, as the
> result of that QtApplication.invokeDelegate(null) call can never
> forward this call there, the native method pauseQtApp() will never be
> called.
>

Qt has no corresponding APIs for all Android activity life cycle
events,
so we can't forward them.


> Only one event onResume makes use of native call updateWindow; the
> rest of native methods like pauseQtApp, resumeQtApp, terminateQt never
> get calls. Is this the result of incomplete feature implementation? If
> I did not read the code correct, then how do those native methods get
> called? How do Qt/qml modules respond to those android Activity life
> cycle events? It looks to me that it doesn't respond at all.
>

We don't need them anymore, because now we prevent the activity to be
destroyed/created.

> I would appreciate more input into this issue.

BogDan.
Reply all
Reply to author
Forward
0 new messages