# Monkey2 v1.1.04

Welcome to monkey2, a new, open source, user friendly, multi target programming language by Mark Sibly.

Please post any bug reports or feature requests to the monkey2 github repository: https://github.com/blitz-research/monkey2.

For monkey2 discussion and programming help, feel free to drop by the monkey2 forums: http://monkey2.monkey-x.com/forums.

Monkey2 is a crowd funded project. If you like what you see, please consider contributing to development either via paypal donation or by becoming a Patreon supporter.

## Building Desktop apps

If you are reading this in Ted2 on a Windows machine, you should theoretically be able to build desktop apps with no extra hassle.

On Macos, it's a little bit trickier but not much. First, you will need to install xcode from the App Store. Once that's done, go into a shell and enter 'xcode-select --install' to install the 'xcode command line tools'. Note that if you are already using Blitzmax or Monkey1 on a Mac, you may not have to do anything.

On Linux, you will need the standard set of development tools and libs such as g++, mesa-gl, a ton of X stuff etc. Sorry I can't be more specific here, but past attempts to produce a definitive list of 'what you need to code in linux' have proved fruitless - it changes from distro to distro and version to version.

Once you're ready to go, try clicking on the 'hello-world.monkey2' file in the 'Files' browser to the right, and then selecting 'Build and Run' from the 'Build' menu.

This will bring up a little 'Build Settings' dialog. Just click OK to use the defaults and build and run the app. If everything is working properly, a simple 'Hello World' window should appear.

Note that the build settings dialog will only appear automatically the first time you build an app for each target. After that, you can manually activate it by selecting 'Build Settings' from the 'Build' menu - not that it does a lot right now!

There are a few more examples in the 'bananas' directory on the right - more coming!

## Building Emscripten apps

To build emscripten apps, you will first need to install emscripten:

http://kripken.github.io/emscripten-site.

(On MacOS, you may also need to modify your bin/env_macos.txt file to let monkey2 know where emscripten has been installed).

Once emscripten is installed, you will then need to 'rebuild modules' for the emscripten target. This involves selecting 'Rebuild modules' from the 'Build' menu in Ted2, and then selecting 'Emscripten'. This will take a while, as monkey2 needs to rebuild ALL source code used behind the scenes.

Once done, you should be able to build emscripten apps. However, to also actually run them you will need to install the 'mserver' package:

http://www.monkey-x.com/mak/devtools/mserver-v86c.zip.

(On Macos and Linux, you may also need to change file permissions to 'execute').

This needs to be unzipped into your monkey2 'devtools' directory. MServer is actually a mini 'http' server, and is necessary because emscripten apps can't be run directly from the filesystem - they must always be run from a server.

Now, select the 'Emscripten' target from the 'Build Targets' menu and you should be able to build and run emscripten apps.

## Building Android apps

To build android apps, you will first need to install Android Studio:

https://developer.android.com/studio/index.html.

Once installed, make sure everything's working properly and that you can build and deploy android apps from inside Android studio. The best way to do this is by building and deploying one of the simple 'template' apps in android studio.

Next, install the Android NDK (native development kit) via the SDK Manager->SDK Tools section.

Once android studio and the NDK are installed, you will then need to rebuild modules for android. Once this is done, you should (finally!) be able to build android apps.

Android apps are produced in the form of android studio projects, and can be found in the '.products' directory next to your monkey2 source file.

Note that monkey2 only currently builds for 'armv7' hardware.

## Building iOS apps

Monkey2 iOS apps cannot currently be run on the simulator, so the first thing you will need is a real iOS device plus the necessary 'code signing skills' to be able to actually deploy to it.

Apart from that, all you need to build for iOS is the latest version of xcode. Once you have xcode installed, you will to 'rebuild modules' for iOS after which you should be able to build iOS apps.

iOS apps are produced in the form of xcode projects, and can be found in the '.products' directory next to your monkey2 source file.

Note that monkey2 only currently builds for 'armv7' hardware.

## That's all Folks!

Monkey2 is a crowd funded project. If you like what you see, please consider contributing to development either via paypal donation or by becoming a Patreon supporter.

Finally, a big shout out to everyone who has contributed to Monkey2 to date, including...

Shane Raffa, Danilo, Blaine Hodge, Lucien Bulles, Daniel, Martin, Tony Smits, Peter Rigby, Jake Birkett, Pharmhaus, James Boyd, David Maziarka, starfruit, Stephen Greener, Jonathan Pittock, Aaron Woodard, Lee Wade, abakobo, York Burkhardt, Rene Damm, Capn Lee, Jesse M Perez, Matthew, neuro, Paul Apgar, Matthew Camerer, Difference, Kirsty, kmac, Richard Betson, Javier, Adam, Phil7, Erik Thon, Noel Cole, Ole Jostein Røtne, Patrik Strandell, Darryl, Lars Kristian Gretnes, C.E., Roger Lockerbie, Philippe Back, Bill Stanbrook, Hotcakes, Christian Leth Jeppesen, Makarienkov Vladimir, Alan Broad, David, Christian, Leo Santos, Pierrou, Arthur, Richard McLoughlin, zui, Dennis Rohn, Daniele Prandini, Hezkore, Bill Murray, Felipe Alfonso, Annika Terrortante, Panayiotis Yianni, RenK, Zachary Cassity, Jules Duquette, Ian Martin, Richard Keam, James Freeman, Paul Huckstepp, Graham, Hubert BAYRE, Jochen Heizmann, Boz Aroldo Carvalho, Mattias Hansson, Catalin Lucaciu, Jochen Heizmann, Boz, Zachary Cassity, Hubert BAYRE, Cory Estes, Paul Huckstepp, Stephen Maden, degac, sal gunduz, Ole Jostein Røtne, Alan Rawkins, Dennis Rohn, Christian, Philipp Moeller, Roger Lockerbie, Pierrou, Philippe Back, Patrik Strandell, Bill Stanbrook, Erik Thon, Richard Keam, James Freeman, Danilo, Juan Camilo, Lars Kristian Gretnes, Noel Cole, Michael Hartlef, Jules Duquette, Ian Martin, Leigh Bowers, Daniele Prandini, Alan Broad, Christian Leth Jeppesen!, Rene Damm, Richard McLoughlin, Kennie, ussell King, gcmartijn, Darryl, Michael Hauck, Graham, sal gunduz, Danilo, Daniele Prandini, York Burkhardt, Peter Rigby, Michael Hartlef, Leonardo Teixeira, Daniel Murphy, Gloomywood, Adam, Arthur, Richard Betson, Jake Birkett, Simon Harrison, Daniel Born, David Maziarka, starfruit, David, Markus L, Capn Lee, Jesus M Perez, Hotcakes, Amon, Blaine Hodge, Jeffrey Nofsinger, Felipe Alfonso, Matthew, Robin Columbus, Alan Rawkins, TeaBoy, Brian Kramer, Bill Murray, neuro, degac, Javier San Juan Cervera, Sander Voorn, Makarienkov Vladimir, impixi, kmac, Paul Apgar, Shane Woolcock, Stephen Greener, Tony Smits, Lucien Bulles, SecondGear, Matthew Camerer, Jonathan Pittock, Annika Terrortante, Josh Klint, Aaron woodard, Lee Wade, taumel, Arthur Bikmullin, Difference, Michael Denathorn, Jose Faeti, Martin Leidel, abakobo, Kirsty, Benjamin Aregger, James Boyd, Simon Armstrong.