Safe to modify parts of the build output?

Monkey Forums/Monkey Beginners/Safe to modify parts of the build output?

mdgunn(Posted 2014) [#1]
I have seen that it is possible to call platform specific code from Monkey (e.g. call a vibrate function) but I imagine in some cases it might make more sense to do significant extension in native code itself if there is a lot of specific code.

Is it safe to modify the build output and how do you know what is safe to modify? When I had a quick look I couldn't see anything like comments indicating a safe area for modification, so I'm guessing you aren't supposed to modify the build output. Correct?

How are you supposed to extend more significant chunks of external code? I'm thinking of Android or XCode in these situations.


therevills(Posted 2014) [#2]
Yes you can call platform specific code from Monkey, have a look at Diddy's extern functions:

Monkey code:

Native Java (Android) code:

You can alter the build output, but you will then have to compile it yourself and then next time you compile Monkey it will wipe your changes.

MikeHart(Posted 2014) [#3]
Look into BRL admob module. Or if you grabbed my Flurry module, look there. This is one way of integrating native functionality.

Gerry Quinn(Posted 2014) [#4]
This is what extern is designed for, Easy and straightforward use of native code is a significant feature of Monkey.

mdgunn(Posted 2014) [#5]
Took a look at brl.admob. Very interesting. So, it looks like if you can hook across to big chunks native of code. Wow!

My current need is to hook into the Notification system (so just a small thing so far). I'm looking at Android first, so I can do it on Windows.
I followed a post by therevills(I think it was) on triggering phone vibrate functions and that worked great but I'm a bit stumped on how to work with notifications.

I tried figuring out notifications using a few tutorials... e.g.
....but I couldn't get my code working.

I don't know a lot about Android right now, which is partly why I'm looking at it. I think this might be an area where things have changed through various versions. I probably need to make sure I use older Android classes for compatibility (maybe?).

Anyone know if there is any code/forum posts around on hooking up notifications? I couldn't find anything.

If there's nothing around I'll have another go and post a sample if(when) I get stuck.

Thank you all!