Confirmed users
350
edits
Bnicholson (talk | contribs) |
|||
(3 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
<pre> | <pre> | ||
let message = { | |||
type: "MyMessage", | |||
title: "Cool Thing", | |||
rating: aSomeValue | |||
}; | |||
sendMessageToJava(message); | |||
</pre> | </pre> | ||
The message object is serialized into JSON, sent to Java, and received at | |||
The message | [http://mxr.mozilla.org/projects-central/source/birch/embedding/android/GeckoAppShell.java handleGeckoMessage()]. The particular activity in need of events need to register and unregister for the required events. [http://mxr.mozilla.org/projects-central/source/birch/embedding/android/GeckoApp.java GeckoApp.java]'s onCreate() and onDestroy() are good examples. | ||
== Java -> Gecko == | == Java -> Gecko == |