Native access - Sending data to Statemachine from Android

113 views
Skip to first unread message

Jo nas

unread,
Oct 6, 2013, 6:57:41 PM10/6/13
to codenameone...@googlegroups.com
Hey!
I have the sourcecode of the Android version of my app ("include sources").
I have a native interface and an implementation that I can successfully edit in this sourcecode and the run on my device. But now I'd like to know how I can send data to the Statemachine or what's the best practice to do something like this.

Thanks in advance!
Jonas

Shai Almog

unread,
Oct 7, 2013, 1:59:44 AM10/7/13
to codenameone...@googlegroups.com
Hi,
include sources and native interfaces are two very different things. I'll talk about the latter.

In Android you can just declare static callback methods in the Java src directory and then reference them from your native impl code. This should be pretty easy to implement as a callback.

Jo nas

unread,
Oct 8, 2013, 7:06:20 PM10/8/13
to codenameone...@googlegroups.com
Hey Shai,
what i want to do is:
With the source code ("include source" option) I successfully added MoPub interstatial/banner ads into my app.
On the start of my app I have an infiniteprogress showing that i want to stop right after the ad loaded.
Because i get the event of a loaded app only in the android sourcecode I need some way to notify the StateMachine that it should close the infiniteprogress Dialog.
Do you know what I mean?

Shai Almog

unread,
Oct 9, 2013, 2:03:23 AM10/9/13
to codenameone...@googlegroups.com
Why not add a static method to state machine and invoke it?

Jo nas

unread,
Oct 9, 2013, 6:10:43 PM10/9/13
to codenameone...@googlegroups.com
Hey Shai,
thank you, it works perfectly!
Reply all
Reply to author
Forward
0 new messages