Aldo is a student of Computer Engineering who enjoys app development. He is a developer for Mozilla Albania and has developed a couple of Firefox OS apps. In his free time, he practices C/C++, Java and web programming.

Aldo's articles

  1. Native vs Hybrid App Development

    People enjoy using their smartphones because they can accomplish many things on the go. Such as reading e-mails, social networking, watching movies and plenty of other activities. We enjoy smartphones because they have many applications that make everyday activities easier.

    If you are thinking of developing for the mobile application market, an important decision is to decide between developing a native application or a hybrid one.

    It’s an age old question that refuses to go away, we thought it was time to revisit… Which is the best?

    Native over Hybrid

    Building native applications means using the native language of the platform, Objective-C on iOS, and Java on Android. The main advantage of native applications is their performance. Native apps are compiled into machine code (Dalvik byte code under Android), which gives the best performance you can get from the mobile phone.

    Best performance includes fast and fluid animations as well as full access to phone hardware, multi touch support and the latest APIs.

    Native development is far from easy. Despite the great number of resources that can be found, it may not be understandable to everyone. As code must be written specifically for each platform, the same code will have to largely be rewritten with little able to be shared. The logic may be the same, but the language, APIs and the development process is different. This process can be relatively long for complex applications.

    Going Native

    If you are new to mobile development and want to build performance-critical mobile apps and/or take advantage of native APIs, you would need a good resource on learning mobile native development.

  2. Firefox OS Game Development with the Ionic Framework, Part 2

    In the first part of this tutorial we created most of the User Interface. Now we will create its logic.

    Implementing functionality

    We want to know if the user entered the right name of the logo. In templates/logo.html view, delete the previous div that contained input field and the button, and replace it with this:

    [code language="html"]

    [/code]

    The UI won’t change, but this code makes sure that whatever the user types into the field passes to the function check() in the controller. So we now implement this function, by appending this code at the end of LogoCtrl controller:

    [code language="javascript"]
    //check if the logo name is found
    $scope.check = function(name) {
    if ( angular.isDefined(name)
    && name.toUpperCase() == $scope.logo.name.toUpperCase() )
    {
    localStorage[$scope.logo.name] = true;
    alert("Correct!");
    history.back(-1);
    }
    }
    [/code]

    Game Screenshot

    When the user enters the correct name of the logo, then a variable is stored into the Local Storage that allows us to check its value later.

    You may experience some issues with the on screen keyboard in the Firefox OS emulator. If so, try hitting backspace before typing, or if you’re lucky, get hold of a real device!

    When the user clicks a logo they’ve already played, we don’t want him to see the same ‘input logo name’ view. So we add the $location dependency to the LogoCtrl controller and this code right after img.attr('src',$scope.logo.img); at the end of $http.get():

    [code language="javascript"]//this logo has been seen before
    if (localStorage[$scope.logo.name]) {
    $location.path('/level/'+ $scope.lvl.id +'/logo-found/'+$scope.logo.id);
    }
    [/code]
  3. Firefox OS Game Development with the Ionic Framework

    I probably don’t need to talk much about Firefox OS, as many of you will know a lot about it already. If not, we have several great articles covering the topic on SitePoint, this is a good starting point.

    All you need to know for this tutorial is that Firefox OS applications are simply webapps, ergo programmed using HTML5, CSS and JavaScript.

    I am going to create a simple game, called YALG, Yet Another Logo Game.

    What do we need?

    Firstly, the Mozilla Firefox browser. Most of us don’t have a Firefox OS device, the Firefox OS emulator is a Firefox plug-in, you can find out how to install it here.

    I decided to use a framework called Ionic for this project.

    Why Ionic?

    • It is simple and has great documentation
    • It allows for cross platform development, using its Cordova-based CLI
    • It is based on AngularJS, one of the best Javascript frameworks
    • It is mobile oriented

    Starting the project

    Firstly install Ionic, you can do this by following our tutorial on Ionic. Then using Ionic CLI tool, execute:

    [code]ionic start YALG blank
    cd YALG
    ionic platform add firefoxos
    # You can add more platforms as required
    [/code]

    This creates a new Ionic blank Project with Firefox OS support (you may want to change some things in the config.xml file created by Cordova).

    Now execute:

    [code]cordova prepare firefoxos
    [/code]

    This makes your application ready to deploy to Firefox OS.

    To run the new application in the emulator, add products/firefox/www as a ‘packaged app’ and click the ‘Update’ button.

    Firefox OS setup

    You should see something like this running in the emulator:

    Ionic starter screenshot

    Now we will make some changes to the source code in the www folder.

  4. Introduction to the Firefox OS Command Line Interface

    Firefox OS (we’ll be referring to as FFOS) is a new Mobile Operating System full of potential and increasing in popularity with users and developers.

    After developing a couple of FFOS applications, I think the process could be more automated and less repetitive. There has to be a faster way to create a project than manually creating the whole directory tree and necessary files for every FFOS application.

    Inspired by Git, I decided to create a Command-Line Interface to automate the process and help other developers who like developing FFOS apps.

    What is ffos-cli?

    ffos-cli is a simple tool, developed in the C programming language. It helps you generate the entire directory tree needed for a FFOS app and more.

    It helps the developer:

    • Create a new project folder with the name of the application
    • Edit the manifest file from the command-line
    • Add source files to the project