Code to large error - Android

Monkey Forums/Monkey Beginners/Code to large error - Android

Boulderdash(Posted 2016) [#1]
I have got my Monkey project to build in HTML and desktop but it wont build for Android yet.

Java - Code to large error

Its my blitmax emulator/2001 emulator , I spent days getting rid of multidimension arrays it was a mission but now I have code that almost builds in both !

I want to submit it but after the Android build is working so I cant work on the touch input.

I believe a method might be to big ?

And if it is the 64k method limit? does this limit apply to the OnRender and OnUpdate methods if so this app might be unbuildable for Android?

Sorry about newbie questions im giving it my first go.

The good news is I recently did a MacOSX build on blitzmax and that worked perfectly.

The other good bit is that it works perfectly in html but thats not the one I want.

Its an 1980's game console emulator.


MikeHart(Posted 2016) [#2]
Someone had this error before:

http://www.monkey-x.com/Community/posts.php?topic=990&post=8516&view=all#8516

It is an android limitation.


Gerry Quinn(Posted 2016) [#3]
Splitting methods or keeping them reasonably sized is rarely a major problem anyway, unless you're working with auto-generated code. However, I see your code is a console emulator, and I can imagine how developing something like that could naturally give a giant method, Even so, after refactoring it into several methods you will probably like the code better!

You could also check if it works in Release mode and just go with that on Android if it does


Boulderdash(Posted 2016) [#4]
Thanks for the help , I had been trying to cut it down to the smallest possible size anyway to make it as simple as possible so some refactoring must be needed.

Another thing is the memory (ram) array is 32768 ints but I could make this bytes ?

As you can tell im using the "hit and miss" system but its got me up to almost getting it working on Android, setting up the installer and finding out that multudimension arrays are now as cool as "goto" and trying to adapt to it has given me brain damage.

BTW I found if I build it in release mode in stops with a message straight away.


Gerry Quinn(Posted 2016) [#5]
The 32K array of ints won't be any problem, on Android or anywhere else.

It looks like your only issue the Android specific method size limit.