Wednesday, February 22, 2012

Choosing a mobile framework: Make a list over frameworks you do want to look into

This is a follow-up for Choosing mobile dev platform/framework and looks closer at the seventh step -  Make a list over frameworks you do want to look into ?

It is important to list any framework you think it's worth considering, and probably a few that you don't think is worth considering, as it's quite critical to select the right framework in order to save development time after you have learned a framework.

This is not the step where you start looking at every detail about the framework, only find them, briefly read about them, and decide yes/no on the question: Can I consider this framework?

The frameworks I consider for this project are:
You shouldn't even consider pricing of the frameworks at this point, although that might be a major factor to considering a framework.

You might want to consider the platforms you are choosing when looking at various frameworks. For instance, I prefer if a frameworks supports all the platforms I want to target, but for now, I will consider platforms that support at least iOS and Android.

Why don't I include AppInventor, DragonRad, DroidDraw and other click-and-create frameworks? Well... Quite simple: Try to do graphics/drawing/physics in any of them. If you just need forms/push buttons and sending/getting data to/from a website, sure, use any of them, but as soon as you move out of what a click-and-create framework can provide, you should consider a real framework where you can do some actual coding.

If you are going to be a mobile developer, be sure to choose a framework that doesn't limit you from your creative ideas.

Update 7/3: Added cocos2d-x

Friday, February 17, 2012

Choosing a mobile framework: Any programming languages you want to avoid?

This is a follow-up for Choosing mobile dev platform/framework and looks closer at the sixth step - Any programming languages you want to avoid?

It's better to consider languages you want to avoid rather than listing the ones you do want to dig into. If you start selecting a programming language, you will limit the number of frameworks you can consider.
Example: you only want to write in C#, there is Mono/Monotouch and of course MS .net. But what if that platform doesn't support the features you need?

Since the syntax of languages today is barely dialects of one another, you should as a developer/programmer be willing to jump into a new language, just as much as a toddler wants to learn how to walk. (Yes, I have a toddler at home).

When you have learnt 3-4 programming languages, you start seeing the similarities, and the differences, and you usually figure out that most languages are very closely related. It's just another object, a function, a variable, an array here, a hash there etc.

Although working on several languages can be confusing at times, always keep reference manuals close by when you are stuck.

I only have one language I always want to keep away from, and that is VB. I always end up using more time figuring out why on earth Microsoft never put VB out of it's misery...

When you have compiled your list over languages you don't want to learn, go through it again, and consider if you really do want do choose a framework that suits the needs for your project, or suits your programming language skills.

Choosing a mobile framework: Choose the platforms you need to target

This is a follow-up for Choosing mobile dev platform/framework and looks closer at the fifth step - Choose the platforms you need to target

This should be fairly simple, as you just have to list up the platforms you want to support. However, it is a good idea to also consider if the application should be for smartphones, tablets and/or desktops.

Here's a few examples:
  1. You are going to make a game for tablets, but the game would be just as good on a desktop. You should consider if you need to develop the same twice (1 for desktop and 1 for tablet) or if you should have 1 codebase for both.
  2. You are making an app for smartphones, but hope it can be reused on tablets. Should you go all the way to desktop as well, or stick with smartphones only, and perhaps make a minor tweaked version for tablets?
  3. You are going to develop a desktop-only application. My question today would be: why? Wouldn't it be better to do a desktop + tablet or web version?
Basically you end up looking at both platforms and technology, when choosing which platforms to support. I do however recommend just choosing platform and form factors in this step and if needed change when looking at frameworks.

For my project I'm only targeting smartphones and tablets, however I do see that the application can work for desktop as well. So I will try to write reusable code. Reusable code is usually either very low level code or very high level code, while languages that are wrapper for low level quite often end up being quite platform specific.

For instance, VB and C# libraries isn't reusable across platforms, but C and JavaScript libraries is most likely reusable. (JavaScript is depending on the platforms web browser capabilities). There are more factors than only the language, but I've more or less always been able to adopt/port a C library to any given platform.

My conclusion for my current project will be to support in the following order:
  1. Android and iOS
  2. Windows Phone
  3. (Windows 8 Tablets, if released...)
  4. Desktop
For form factors this is my priority:
  1. Tablets (7 inch and up)
  2. Smartphones
  3. Desktop (15 inch and up)
In a matrix to summarize:

Tablet Smartphone Desktop
Android 1 2 -
iOS 1 2 -
Windows (7 and newer) 4 - 3
OS X (Lion+) - - 3
Windows (XP/Vista) - - 5
Matrix for preferred platforms and form factors

Since MS is very likely to release Windows 8 with tablet support, I need to consider that already now, as that might end up being the third major tablet-market player. Why didn't I include Googles chromebook? Currently I have 0 demand for chromebook versions, and that isn't likely to change within the next 12-18 months.

So focus is iOS and Android tablets first, smartphone second, then perhaps desktops (Win 7 + OS X).

Thursday, February 16, 2012

Choosing a mobile framework: Non critical functions

This is a follow-up for Choosing mobile dev platform/framework and looks closer at the fourth step - Chossing/Identifying the features that aren't critical to your app, but nice to have.

It should be fairly simple to do this step, as you should already have an idea of what you haven't written down in either step 2 or step 3.

For my current project it was only Text to Speech that isn't critical. I do want to implement it in my app at some point, but it can come later.

It is recommended to do a bit of research on these features to see how hard they are to implement. If they are easy enough, you might want to implement them instead of adding them to the todo list.

I did quite a bit research on Text to Speech, and it's fairly simple to implement if you aren't using a framework, and are coding native on at least iOS and Android, but for frameworks, it still looks like a no-go. However, there are a few third party companies building TTS engines that might work for my app, so I need to see have hard it is to create a plugin/module for any chosen framework as well.

This leads to adding a feature to step 2:

  • How hard is it to create plugins/modules?

I'm not updating step 2 with this, but I'll keep it in mind when comparing various frameworks.

Wednesday, February 15, 2012

Choosing a mobile framework: Identify which critical functions you think it's OK to implement/write for yourself

This is a follow-up for Choosing mobile dev platform/framework and looks closer at the third step - Identify which critical functions you think it's OK to implement/write for yourself.

It should be fairly simple to narrow these elements down, if you still have something left on the list from the first step. You should always consider each function that you want to implement yourself, if it might be better to let the framework handle it (if it can...).

I need the following to functions in my current project:
  • Basic image manipulation
  • Drawing/Painting

Let's have a closer look:

Basic image manipulation: I need crop, rotate and zoom. These are fairly simple to implement. If the framework has image manipulation, I will weigh towards it, but it's not that critical. My current project can even survive without it.

Drawing/Painting: I need to be able to draw simple figures. I do have some SVG's that I do want to use for drawing some simple images, which should be possible to fill. I've added a google presentation below to show it. This can be implemented as a canvas (html5), opengl, some native drawing wrapper, or other options. I prefer if it has some built in 2d vector functionality, but falling back to opengl is also acceptable. (And would probably perform better as well)

As my app cannot function without drawing/painting, I do feel this is so critical, that it's worth using most of the development time on this area.

Here's what it should be able to do:

Note about the image: I've used images from google image search, so if you do have a copyright on any of the images, please let me know, and I'll be sure to mention you in the post, or remove the image if you don't want it in the sketch.

Some of these features might require quite an amount of work to implement, so always consider if you either learn a great deal about the framework, the platforms, programming techniques, and if you can reuse any of the code in a later project. Also consider if you can use any third party helper libraries to ease your development, and probably speed the development time up as well. However, you are in full control when you write from scratch.

Choosing a mobile framework: Identify critical functions, you don't want to implement yourself.

This is a follow-up for Choosing mobile dev platform/framework and looks closer at the second step - 
Identify critical functions, you don't want to implement yourself.

You need to identify which functionality you don't want to implement yourself, in order to figure out what framework to start with.

This is most likely core functionality of a framework or third party libraries for the framework. I prefer core functions over third party libraries, as you never know when a third party library might stop supporting newer versions of the framework or newer platforms. (Well, to be honest, you newer know this for a framework either, but is usually a risk worth taking.)

What are critical functions you don't want to implement? I mean functions that you shouldn't need to go into native code on each platform supported by the framework. For instance if you do want sound in your application, that is most likely a critical function.

From the list from step 1 I had three functions that the framework needed. As the application I'm working on is a bit larger, and I do want to "future-proof" myself, I expanded the list a bit to the same as in the original post.
  • Drag and Drop
  • Basic access to camera
  • HTTP(S) request support
  • JSON support
  • Custom user interface elements (Must be possible)
  • Custom user interface placement  (Must be possible)
  • Audio playback (simple)

Why I don't want to implement these functions myself?
Let me go through each function:

Drag and Drop: I've done drag and drop before Qt natively supported it, and it was a hassle. I've done drag and drop on the web before there was a properly cross-browser drag and drop javascript library. It wasn't worth the workload.

Basic access to camera: It will be diffcult and timeconsuming to make sure you are up to date on all platforms/devices for this one.

HTTP(S) request support: It's not that difficult to implement if the platform supports tcp sockets, but it's better if it's supported directly.

JSON support: There are tons of libraries for json, so that should be fairly simple to implement yourself, but since there are that many json libs, it's likely that one or another is built into the framework. It's easier and better to choose a framework that already has it.

Custom user interface elements and placement: I do need a bit more than push buttons and text fields. Who doesn't? There are enough text-box-push-button-radio-button apps out there. However for this step it's important to figure out how to implement it. Does it require OpenGL, are there core graphics functions for custom UI elements? Do you use HTML/CSS? How is the performance?

Audio playback: Should be fairly simple to playback a mp3/wav or similar file on the given platform. For this project it's non-critical when looking at latency, but I know already that if latency is critical, Android is currently not possible, however, I know that Google has this on their roadmap, so maybe later.

This raised a few questions for each functionality, which will be addressed when digging into each framework.

Tuesday, February 14, 2012

Choosing a mobile framework: Listing all the feature you need

This is a follow-up for Choosing mobile dev platform/framework and looks closer at the first step - Listing all the features you need.

To figure out what features you need, you need to sketch up your application and figure out what each screen/image does. How you create your sketches is really up to you. I usually use Google presentations, MS Powerpoint, Adobe Photoshop, a simple drawing program, a notepad or what feels right.

I've created a small small sketch one part of the app I'm working on. The rest of the sketches are with pen/paper.

Basic sketch for one of the parts in my project:

Note about the images: I've used images from google image search, so if you do have a copyright on any of the images, please let me know, and I'll be sure to mention you in the post, or remove the image if you don't want it in the sketch.

Basically this part consists of selecting something you want to do and, then you are given a drag-and-drop activity which again gives a reward. This is mostly used for training people with special needs in order to coordinate movement, and/or work with cognitive stimuli. Usually this kind of apps are fun for kids as well.

From these sketches I see that I need the following features:

  • Images
  • Buttons with text
  • Audio playback
  • Drag and Drop
  • Animation or video playback

Now I remove some features which I assume any framework supports, and if it doesn't, it's probably worth skipping that framework.
  • Images
  • Buttons with text

Then there are three functions which is needed:
  • Audio playback
  • Drag and Drop
  • Animation or video playback

The rest of the list from the original post also included : "Basic image manipulation, Basic access to camera, Drawing/painting, JSON support, HTTP(S)-request support, Custom user interface placement, Custom user interface elements."

You now have a feature list for your framework and you are ready to move on.

Monday, February 13, 2012

Choosing mobile dev platform/framework

After going through all the various frameworks, I'm close to finding which framework I will use for some projects, and which isn't really suited.

Here's some steps that will help you to identify which framework to start with for a project, and one example from me

1. List all the features you need
Figure out ALL the features you need for a project, not only the most important ones. Include anything that might be a function or feature.

My feature list for one project is:
  • Drag and Drop
  • Text to Speech
  • Basic image manipulation
  • Basic access to camera
  • Drawing/painting
  • JSON support
  • HTTP(S)-request support
  • Custom user interface placement
  • Custom user interface elements
  • Audio playback (simple)

Choose all the features that you cannot be bothered to implement yourself, which you feel the framework should handle and you . (Or a third party plugin to the framework)

The critical features for one of my current projects
  • Drag and Drop
  • Basic access to camera
  • HTTP(S) request support
  • JSON support
  • Custom user interface elements (Must be possible)
  • Custom user interface placement  (Must be possible)
  • Audio playback (simple)

Basically the opposite of 2. Critical functions that must exist in the app, but you do feel it's ok to write/implement these yourself.

Only 2 things I think I need to write for myself, and can accept doing.
  • Basic image manipulation
  • Drawing/Painting

Any features you think your app can be release without, but they should be there later, bonus for the framework if it's already in-there/supported

Basically the features from 1 that aren't in 2 or 3. For my project that would be:
  • Text to speech

Any platform you do need and/or your target audience uses.
I need to target:
  • Android (both phones and tablets)
  • iOS (both phones and tablets)
  • Windows Phone 7 (currently only phones, but most likely tablets in the autumn)

If there are any languages you don't want to learn, and therefore need to avoid, write them down so you don't end up choosing a framework that only supports a language you don't like.
I only have 1 language I prefer to never write software in, as it usually ends up limiting what you can do on a platform: (And the syntax sucks)
  • Visual Basic/Basic (I've used it way back, and it "does not compute...")

Any framework you think it's worth considering. Later on you will need to consider why you should choose a framework or why you should avoid it. There are many factors worth considering when choosing your framework.

The frameworks I consider for this project are:

This one isn't always easy, as you probably want both desktop, mobile, web-based and non web-based. Consider what your target audience is. Usually it's easy to combine web-based mobile app with an actual app or a desktop app with an web-based app, but making it to all three with one codebase is most likely going to be diffucult, or will require a lot of hacks in your code.

I needed an web-based app for integration in VLE's as well as a actual app in the appstore. As my current target audience are schools with VLE's, but they are moving fast forward into tablets, I found this difficult. I chose to target tablets and phones through the appstore first, then VLE's through web later.

This is the timeconsuming part. You probably want to use a few days for this one, and there are tons of articles to read up on various frameworks. 

Update 14/02/12: I missed a few features I need for the project I'm using as an example

I'll follow up on this post going through each step, and with some links to pages that are worth reading regarding frameworks, as well as how I narrowed down which frameworks I'm considering for this project.

Steps in details:

  1. Listing all the features you need.
  2. Identify critical functions, you don't want to implement yourself
  3. Identify which critical functions you think it's OK to implement/write for yourself
  4. Choose which features that isn't critical, but is "nice" if the framework handles
  5. Choose the platforms you need to target
  6. Any programming languages you want to avoid?
  7. Make a list over frameworks you do want to look into
  8. Choose if your app should be web-based or an actual app in the appstore or both, should it be mobile and desktop?
  9. Start investigating the features of each framework
    1. Marmalade SDK
    2. Appcelerator Titanium
    3. Moai SDK

Friday, February 3, 2012

Convert from svn to git

Time to convert all those old SVN repositories to GIT... I'm using bitbucket for everything now.. On ubuntu do "apt-get install git git-svn" first

Short script to do it all: (it's not perfect, but it does the job...)

# variables:
# existing svn repository
# new git repository
# username

# DO THIS FIRST TO CREATE USERLIST: (just do it manually, and add all users into one big file)
# for getting authors
# svn log $SVNREPO -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" quot;, "", $2); print $2" = "$2" <"$2">"}' | sort -u > ~/svn_convert/authors-transform.txt
#now edit ~/svn_convert/autors-transform.txt

#create temporary git folder
mkdir git_tmp_repo
cd git_tmp_repo
#clone repo to git
git svn clone --no-metadata -A ~/svn_convert/authors-transform.txt . -T $SVNREPO

#optimize repo
git gc
git fsck

# clean SVN sections from Git
git config --remove-section svn
git config --remove-section svn-remote.svn
rm -rf .git/svn .git/{logs/,}refs/remotes/svn/

# add remote
git remote add origin $GITREPO

# push to master
git push -u origin master

# remove temporary git folder

cd ..
rm -rf git_tmp_repo