Facebook OA / AI2 – Week 7 (March 11 – March 18)

This week, I was just up recovering from Dengue. Missed a midterm, but making up for it after the period. Lots of schoolwork catching up this week.

I have managed to connect the interface between Java and SimplePhaser, and it looks really neat now. It is a relief as the theory behind our program implementation works!

Wrote an app to test things out. And so this is how bi-directional callbacks actually work!

Java to JS


JS to Java

This is what you do on the Java side, exposing the interface:

/** Java **/
public void showToast(String toast) {
    Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
// from http://developer.android.com/guide/webapps/webview.html
WebView webView = (WebView) findViewById(R.id.webview);
webView.addJavascriptInterface(new WebAppInterface(this), "Android");

And on the JS side, call it like this:

function showAndroidToast(toast) {

For next steps, I will work on the collision handling.

Leave a Reply

Your email address will not be published. Required fields are marked *


To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>