Installing MoSync for Android (and other mobile platforms)
Android Tutorial Contest
This is my submission for Article #2: Setting Up Your Android Development Environment. Its main claim to distinction is that it describes how to install MoSync, a development environment which isn't very well known, but has the advantage of supporting a wide range of mobile platforms, not just Android.
OK, you’ve finally decided to start developing for Android. After all, it’s ridiculous for a programmer to have a tablet, a phone, a camera and a watch without programming them, right?
But… you don’t like Java, and the instructions for the NDK seem too complicated. And whatever you write, your husband will want the same thing on his iPad. And your father will want it on his Blackberry. And your brother on Windows Mobile.
Best of all, it’s free and released as Open Source.
For full details of the MoSync SDK, look no further: http://www.mosync.com/sdk/.
Do I need a license?
If you’re using MoSync just for fun, no.
If you want to sell your apps, but release the source code under the GPL, then again, no.
If you want to sell your apps and keep your source code to yourself, then you need a commercial license. But even that doesn’t need to cost you anything. MoSync offers a free commercial license. The only thing that you pay for, if you want it, is support.
Full details of MoSync licensing are available here: http://www.mosync.com/mosync-dual-licence-model.
Head for the MoSync SDK web site at http://www.mosync.com/download and click on the download button of your choice (Windows or Mac). It’s a bit big (over 200MB) so you’ll probably want to get some coffee while you’re waiting.
No surprises here. Just double-click on the installer you downloaded. Depending on your OS, you may have to allow it to make changes to your system. A little window will show progress:
Once it’s been unpacked, the MoSync Setup will run:
There’s the usual license agreement to accept:
then the choice of components:
Not a great deal of choice, in fact, which makes things easy. Obviously, you need MoSync and its prerequisites, so you can’t deselect them. You just decide what shortcuts you want created. The whole package will take up about 441 MB on your hard disk.
On the next screen, choose your destination folder. It probably makes life easier if you put it in a folder without any spaces in the path.
Click on Install, and off you go:
You’ll see a few command windows on the way as MoSync installs its files and the runtimes that it needs. Then after a few minutes, it’ll all be over:
just click on Close; the installation is complete and the new shortcuts are available in your start menu:
Uninstall MoSync is obvious, and to be honest, I haven’t looked at BMFont Generator. The other two entries are more interesting.
Online User Guides will open MoSync’s documentation page at http://www.mosync.com/docs/index.html:
From here, you’ve got access to the detailed documentation for all the APIs, as well as sample applications and tutorials. The documentation is very clear and very well written.
(Optional) Download, install and configure the Android SDK
The MoSync installation already includes its own emulator as well as compilers for the different platforms, so this step is optional. However, if you want to use the official Android emulator, you’ll want to download and install the Android SDK. As there are already plenty of articles about that, I won’t go into details here.
MoSync IDE is what this has all been for. Click on this shortcut, and the MoSync IDE will start:
It’ll ask where you want to store your projects. This is the default, but you may want to move it to your own documents folder.
If you haven’t already done so, you’ll be asked to register with MoSync, so that you can keep up to date with developments. Don't worry; you won't be bombarded with spam. You may be asked a few more questions regarding the configuration, and then the welcome screen will appear:
From here, you can go to the documentation, import the examples, or start programming. The IDE is based on Eclipse, so it’s not hard to find your way around.
To help you get started, it’s well worth clicking on Import C++ Examples. This will run an import wizard to load about 50 samples supplied with the installation:
The samples include the famous “Hello World” (but that’s for another article):
Configure MoSync for Android
If you’ve installed the Android SDK, you’ll need to tell MoSync where to find it. Click on Windows and then Preferences to open the dialog. Navigate through MoSync Tool / Android / Android SDK and fill in the location of the Android SDK:
If you’ve made it this far, you now have MoSync installed and configured on your computer, and you’re ready to go. The sample applications will help you get started, and the documentation is complete and well-written.
My next article will show how you can use MoSync to develop a simple application and try it out in the emulator and on your Android device. Have fun!