Compile for Android

Community Forums/Monkey Talk/Compile for Android

AltanilConard(Posted 2012) [#1]
Hi,

I want to buy monkey but I have some questions first.

When compiling for Android, do you first get java source code? If so, can I program some native things in java and then manually compile as app?

Does Mojo use Canvas or OpenGL for Android rendering?

I find the Android emulator very slow/annoying for testing. Is it possible to setup a HTML5 canvas to emulate a device screen (maybe with Diddy virtual resolution?) and use that for testing?

I could not find much info on the Monkey site so all advice is appreciated!


slenkar(Posted 2012) [#2]
It does produce java which you can use to manually ocmpile if you want, but its easier to add java code before translating.
I think it uses OpenGL for rendering, the fastest way of testing apps is with an android virtual machine, in VMware or some such program


AdamRedwoods(Posted 2012) [#3]
1. not exactly sure what you mean, but monkey is transcoded into java when compiling. you may add your own "native" java code routines, fairly easy to do.

2. slenkar is right, it's opengl (gl11)

3. if you have an android device, you can plug it in and compile directly to the device. there are various options for emulation, like slenkar mentioned. HTML5 is one option, but if you write native Java routines, they will not be compatible with HTML5.

I test using window GLFW and then export to android. Remember mobile is slower & smaller, so care is needed for compatibility especially with image sizes.


therevills(Posted 2012) [#4]
do you first get java source code?

Yes

If so, can I program some native things in java and then manually compile as app?

Yes

Does Mojo use Canvas or OpenGL for Android rendering?

OpenGL

Is it possible to setup a HTML5 canvas to emulate a device screen (maybe with Diddy virtual resolution?) and use that for testing?

Yes, this is what I did for prototyping... but you must test it on a real device so you dont go overboard as HTML5 is actually faster on some browsers than Android...


AltanilConard(Posted 2012) [#5]
Thanks! That is exactly what I hoped for


Matty(Posted 2012) [#6]
Quick query - doesn't mojo use the Canvas instead of OpenGL in earlier versions of Monkey (v42 and prior?) I could be wrong...


therevills(Posted 2012) [#7]
Yep you are right Matty, Mojo did use Canvas at the start of its life, but after much complaining on how slow it was it was changed to use OpenGL in v32.

***** V32 *****

Modules:

JS/AS now use built-in join().

Implemented custom string_replace for JS and AS targets to avoid regex issues.

Flash target can now be used mojo-less - this is probably a pointless exercise, will revisit eventually.

Android mojo nows uses GL!

Added simple glfw LoadState/SaveState.

Fixed XNA shift/control input issues.

Mojo font now loads at startup.

LoadImage/LoadSound errors consistently return Null objects.

Flash data embedded! Will eventually be selectable. Note: flash file names must be valid identifiers for now.

Error "" added - use to 'exit app'.

Android target 'screensaver' disabled via android:keepScreenOn="true" in layout/main.xml

App suspend/resume improvements.


Last edited 2012