I am a web developer who dabbles in mobile development from time to time. You can find me on Twitter @joyceechessa or visit my website to see what I’m up to.

Joyce's articles

  1. Getting Your App Ready for iOS 8

    This year’s unveiling of iOS 8, and new devices at WWDC and September 9th event marks the arrival of new features and changes that iOS developers should utilize in order to keep their apps relevant and offer their users richer experiences.

    Apple users have always been quick to adapt to new versions of operating system compared to other platforms. The Apple website shows that 92% of devices are running iOS 7. With this high adoption rate, you can be assured that a large percentage of your app users will be using the latest version of the OS shortly after its release on September 17th. So you should be taking advantage of the new features it offers to build better apps to give them an edge amongst the competition.

    The iPhone 6 and iPhone 6 Plus present developers with another factor to consider, yet another screen size (two, in fact).

    The iPhone 5 announcement presented a similar change that developers had to take into consideration. With its larger screen, developers had to design apps that would work on the previous 3.5’ and the new 4.0’ screens. Shortly after that release, Apple started favoring apps that conformed to the new screen size. It was a disadvantage to not update your apps as this meant losing exposure on the App Store.

    Months after the release, Apple stopped accepting apps that didn’t support the new screen size. A similar condition was enforced months after the release of iOS 7, when Apple specified that new apps submitted had to be built with the iOS 7 SDK. With this history, it is clear that upgrading your app is advantageous to you and at times necessary. This is especially true if version changes are so drastic that older apps cannot function as expected on newer devices.

    But this is not the case with the iPhone 6 and iPhone 6 Plus. With the release of the iPhone 5, apps designed for the smaller 3.5’ screens did not work well with the larger 4.0’ screen and so an update was imperative. But with this year’s new phones and their 4.7’ and 5.5’ screens, developers do not need to update their apps for them to work with the new phones. As Apple’s Phil Schiller said during the event, apps on the store that haven’t been updated to work with the new iOS 8 technologies, will “just work” on the larger screens. He went on to further explain this:

    “Built into iOS is now a desktop size scaler technology that makes the software look beautiful on different size displays and so the text is sharp, the colors are beautiful. It all just works”.

  2. Creating a Cloud Backend for Your Android App Using Parse

    We previously published an article on using Parse to provide a backend for iOS apps and thought we should write one for the Android developers who want to know how to integrate the Parse SDK in their app.

    If you read the previous article, you can skip the introduction. We wanted the articles to be stand-alone tutorials, so you don’t have to read the previous one to follow along with this one.

    Introduction

    With the increased use of mobile devices, it is common for applications to offer features such as backup storage, data sync, data sharing etc. Building stand alone applications that only function and save their data on the device they are installed on is at times not feasible. A backend is usually needed where data can be saved and manipulated for the app to provide the service it was intended for.

    Building this requires time, a different skill set and other resources (e.g. servers, push notification services, etc). Fortunately, there are several platforms that provide ready-made customizable backends that you can integrate with your apps. These are known as ‘Backend as a Service’, or BaaS in short.

    Pros and Cons of Using BaaS

    Pros

    • Saves time and resources.
    • Provides different services in one package. Most of the available BaaS vendors not only provide backend cloud storage for you data, but also services as push notifications, analytics, social network integration, etc.
    • Caters to scaling. The BaaS platforms are built for scaling and as a developer, you will not need to do any extra work if you were to gain a large amount of users. It will cost you more though, as you may move up the pricing plan.
    • Easy to make changes. You can easily make changes to your application’s functionality without requiring a lot of rewrites to its backend. It is easy to change your database models using the platform’s dashboard. This comes in handy to anyone following the iterative ‘lean startup’ methodology of shipping and improving the app based on usage data.

    Cons

    • Using a BaaS can be expensive. While most of these services offer a free package for a certain number of requests a month, it can get costly if your app was to take off and gain many users.
    • You might experience vendor lock-in where a switch to another platform is difficult. But this is becoming less of a problem as most services are built to allow for easier migrations. You might have to give up some services as not all BaaS platforms offer the same services.
    • A huge disadvantage you should consider before using a BaaS is the dependence of your app on a third-party service. A provider might make changes to its service which you will either have to tolerate or look for another solution. There is also the possibility of a service being shut down which will be a huge inconvenience as you will be forced to migrate your data to another provider or to your own backend. An example of this is the recent shutdown of StackMob which forced developers to migrate their data.

    Enter Parse

    For this tutorial, we are going to look at using Parse to provide a backend for an Android application. We’ll briefly look at what it offers before building an application that will use it for user registration, authentication and storing of user data.

  3. Improving Your App’s Onboarding UX

    Because of the large number of apps available on app stores, there is no shortage of competition for your app.

    While it’s hard work to get users to discover and install your app, that is unfortunately only half the battle. You also have to ensure that you maintain those users. We all have apps that we’ve been excited to install, but rarely returned to.

    The first few minutes that a user installs and launches the app can determine whether they will be repeat users or if they’ll immediately uninstall and keep searching the app store for something else.

    Because of this, you have to make sure that your app offers a great onboarding experience to the user and makes a good first impression on them.

    What is ‘Onboarding’ and Why Does it Matter?

    Onboarding, also known as new user experience or first use experience is the orientation that a user goes through when they first use an app. This is their first experience and is a crucial step that could determine the use of your application, so it should be taken in regard when designing the app.

    The user’s first experience should be a good one otherwise it could be their last one. In the first few seconds after install, you get a few seconds to impress and show them that the app will indeed be useful to them.

    As the saying goes, ‘you only get one chance to make a good first impression’, so you’d better make it good.

    During the onboarding process, the user is made aware of the app’s features, gestures used in interaction are exposed especially if they are unconventional and in case of games, the rules and backstory are presented.

    The onboarding UX can be improved by paying special attention to the following areas.

    Login and Registration

    Delay Until Necessary

    Login and registration should be delayed for as long as possible. You should not require your user to be logged in before they are able to use your app and see what it offers. You should present the content to the user and have them start using the app as soon as possible and only ask for a login when the benefit is clear to them.

    A good example of this is the AirBnB app which allows you to search for and view details of different accommodations without signing in. When you want to make a booking, that’s when your details are requested.

    Pinterest and Tumblr also have a similar experience, where the user can browse and discover content without first logging in.

    By delaying log in, the user is able to explore the app and better understand its value proposition. Once they are confident in the quality and utility that it offers, then they will be more willing and comfortable to go through the registration process.

    Make it Painless

    If your app allows users to have accounts, then you should enable them to sign up using the app. At times, users are required to use the web interface to create accounts since registration is a long process not suitable for mobile devices.

    This is bad user experience. If someone is not already a user of the service, they would have to switch to either their browser or another device just to register an account, this is a good way of losing a user before they even come on board.

    If your application requires a lot of information to register an account, have the app only request for the bare minimum (usually the email and password) during registration to start using it, and have the user go back later to complete their profile.

    Make your login and sign up forms brief. Do not make your users have to type up a lot of information to get started. Try to get the data from elsewhere and pre-populate the form.

    For example, you can suggest email addresses known to the device for the user to select and save them from typing. Remove repetitive and non-essential information like the confirmation email and password. Don’t have passwords that are too restrictive i.e. require uppercase letter, a special symbol, alphanumeric characters, e.t.c. You should at minimum, check on the length of the password, but don’t put too much restrictions that will annoy the user.

    Make use of common login providers which will make the process easier and faster. Some users also prefer this because they would rather not have different usernames and passwords for all the apps they use.

  4. Creating CocoaPods

    In a previous article we introduced CocoaPods, a dependency management tool for cocoa development, and covered the why and how of using it. In this article, we are going to look at how to create your own CocoaPod and make it available for others to use in their projects.

    For this tutorial, I have a class that formats phone numbers that I would like to make into a CocoaPod. My phone formatting library consists of the class files JKEPhoneNumberFormatter.h and JKEPhoneNumberFormatter.m and a README.md file.

    To begin, run the following command to make sure that you have the latest CocoaPods version. The command will install CocoaPods if it isn’t already installed and will update if it is installed and needs updating.

    [code language='bash'][sudo] gem install cocoapods
    [/code]

    Use of the sudo command depends on your Ruby installation. More on this in the previous tutorial.

    I recommended that you use the latest version of CocoaPods because the command syntax may have changed and new features added.

    To check the CocoaPods version, run pod --version. At the time of writing this article, the latest version is 0.33.1.

    There are various files that you need to include in your CocoaPod. These include the class files, Podspec, license, assets used in your library and a demo project that shows the use of your Pod (this is run when a user types pod try [LIB_NAME] to see what it does before using it in a project).

    You can create your own Pod directory structure and files or you can use a command that CocoaPods makes available which creates a template library structure to get you started quickly. This generates a Podspec file (we will look at what this is later in the article), license file, readme and a demo project complete with test files and a Podfile.

  5. CocoaPods: What is it Good For?

    CocoaPods is a dependency management tool for iOS and OS X development that has been gaining a lot of traction in the Cocoa community. When using CocoaPods, you define your project’s dependencies in a file, which CocoaPods uses to determine and resolve dependencies between libraries before downloading the needed source code and linking it in an Xcode workspace.

    As your project scales, you’ll be spending a lot of time managing its dependencies, time that could be better used writing code.

    CocoaPods make managing dependencies in your code easier. Adding and removing dependencies is just a matter of defining them in a file and running a command to install them. CocoaPods reads the file, determines the dependencies that the listed libraries have and if there are any shared dependencies, it tries to determine the version that will satisfy all of them. It uses Semantic Versioning to try to resolve dependency versions.

  6. Creating a Cloud Backend for Your iOS App Using Parse

    It is a common requirement for apps to require a backend for data to be saved, shared with other users and synced between a user’s devices.

    Building this backend can require time, a different skill set and other resources (e.g., servers, push notification services, etc). Fortunately, there are several platforms that provide ready-made customizable backends you can integrate with your apps. These are known as ‘Backend as a Service’, or BaaS in short.

    Pros and Cons of Using BaaS

    Pros

    • Saves you time and resources.
    • Provides different services in one package. Most of the available BaaS vendors not only provide backend cloud storage for you data, they also offer such services as push notifications, analytics, social network integration, etc.
    • Caters to scaling. The BaaS platforms are built for scaling and as a developer, you will not need to do any extra work if you gain a large amount of users, just pay more.
    • Easy to make changes. You can easily make changes to your application’s functionality without requiring a lot of rewrites to its backend. It is easy to change your database models using the platform’s dashboard. This comes in handy to anyone following the iterative ‘lean startup methodology’ of shipping and improving the app based on usage data.

    Cons

    • Using a BaaS can be expensive. While most of these services offer a free package for a certain number of requests a month. Things can suddenly become costly if your app was to become successful and rapidly gain many users.
    • You might experience vendor lock-in where a switch to another platform is difficult. This is becoming less of a problem as most services now allow for easier migrations. You may have to give up some features as not all BaaS platforms offer the same.
    • A huge disadvantage to consider before using a BaaS is the dependence of your app on a third-party service. A provider might make changes to its service (e.g. change pricing plans) which you will either have to accept or look for another solution. There is also the possibility of a service being shut down. This is a huge inconvenience as you will be forced to migrate your data to another provider or to build your own backend. An example of this is the recent shutdown of StackMob which forced developers to migrate their data.

    Enter Parse

    For this tutorial, we are going to look at Parse to provide a backend for an iOS application. We’ll briefly look at what it offers, followed by building an application that will use it for user registration, authentication and storing of user data.

    Parse is one of the more popular Backend as a Service platforms. The service offers three products in one package: Parse Core, Parse Push and Parse Analytics.

    Parse Core generally handles the saving of data and social media integration. It also enables you to write your own code that will be run in the cloud thus providing custom server-side logic.

    Parse Push is used to send push notifications. It enables the developer to customize, schedule and send push notifications to all registered users or a select group of users.

    Parse Analytics enables you to track your app’s data. You can track usage data such as installations, active users, user retention, push notification open rates etc.

    To start off, download the project file which includes a starter project and the completed final project. The application is a simple note taking application that enables a user to save and retrieve notes to the cloud, thus maintaining the same data across devices.

    The project consists of a login, signup, notes table view and an add/edit note view as shown below.

    Our app overview

    On running the app, you will see an empty table view with Logout and Add buttons on the navigation bar. The app should require the user to login before using it. If the user is logged in, it will take them directly to the table view showing a list of saved notes. Otherwise it will bring up the Login view. If the user isn’t registered, then they will have an option of signing up.

    To start, you should first create an account on parse.com if you don’t already have one. Once logged in, access the Dashboard where you should be able to create a new app and also see a list of all your apps. Create an app called NoteApp.

    Create a new app in Parse

    On creating the app, you will see a window containing your app IDs and keys. These will be used later in the iOS app.

    App overview in Parse

    Download the Parse SDK here. Unzip the file and drag the framework into your project’s Frameworks group folder.

    Frameworks folder in iOS project

    Next we need to add some libraries to the project. Select your project on the project navigator, make sure the project target is selected and then click on the ‘Build Phases’ tab. Expand ‘Link Binary With Libraries’.

    Add frameworks to your iOS App

    Click the Add icon at the bottom of the listed frameworks and add the following libraries.

    • AudioToolbox.framework
    • CFNetwork.framework
    • CoreGraphics.framework
    • CoreLocation.framework
    • libz.dylib
    • MobileCoreServices.framework
    • QuartzCore.framework
    • Security.framework
    • StoreKit.framework
    • SystemConfiguration.framework

    Open the AppDelegate.m file and add the following import to the top of the file and make the following modification to the application:didFinishLaunchingWithOptions:, method placing in your app id and client key.

    [code language="objc"]
    #import

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    [Parse setApplicationId:@"YOUR APP ID"
    clientKey:@"YOUR CLIENT KEY"];
    return YES;
    }
    [/code]

    To test the SDK, paste the following lines below the method call that sets the application id and client key in application:didFinishLaunchingWithOptions:.

    [code language="objc"]PFObject *testObject = [PFObject objectWithClassName:@"TestObject"];
    testObject[@"foo"] = @"bar";
    [testObject saveInBackground];
    [/code]

    Run the app and navigate to the Parse dashboard on your browser. Select your app and click on the Data Browser tab. You should see a table data of the object that was created above.

    App details in Parse dashboard

    In the Dashboard, you will find controls to add/remove rows and columns, set permissions, export the class and even drop the whole class. Drop the TestObject class as we won’t need it for our app. Drop it by clicking on the More button and selecting Drop Class. Also delete the code that creates the TestObject when the application launches.

    Not only can you create objects programmatically as we did above, but you can also do so using the Dashboard. We are going to create a Post class and some test posts that will be loaded in our app.

    Click on the New Class button and name the class Post. Leave the type as Custom. Add two string columns: title and content. Add a few rows of data, just fill the title and content fields.

    Apart from the title and content columns, other columns are also generated — objectId, createdAt, updatedAt and ACL. The ACL stands for Access Control Lists. These are used to specify the access control users and/or roles have on particular objects.

    Back in our app, we’ll create a view controller for the notes table view. Parse has a convenient class which is a subclass of UITableViewController called PFQueryTableViewController. We’ll be using some of the functionality it offers like pull to refresh and pagination (which enables you to set the number of results each query gets you).

  7. Localizing an iOS App

    The App Store is a global market. Taking international users into consideration and building an app that adapts to them can greatly increase your market reach and/or your business growth. Instead of forcing users to make do with the default language, you could instead give them an app that presents information in their language. With […]

  8. Localizing Android Apps

    Introduction Localization is the process of providing the appropriate resources for your app based on the device’s language settings. If your app targets a specific locale, then localizing it might not be necessary. If it targets different regions speaking different languages, it might increase its reach and make it more usable to people speaking other […]

  9. Scheduling Background Tasks in Android

    Periodically your Android application might need to perform a task, such as checking a server for updates. The AlarmManager class can be used to schedule and execute operations that need to occur even if the application isn’t running. The AlarmManager class enables the scheduling of repeated alarms that will run at set points in the […]

  10. Better User Interfaces with the Android Action Bar

    The action bar is an important design element, usually at the top of each screen in an app, that provides a consistent familiar look between Android apps. It is used to provide better user interaction and experience by supporting easy navigation through tabs and drop-down lists. It also provides a space for the app or activity’s identity, thus enabling the user to know their location in the app, and easy access to the actions that can be performed.

    The action bar was introduced in Android 3.0, although support for older versions can be achieved by using the Android Support Library. Before its release, the Options Menu was usually used to provide the actions and functionality that are now put on the action bar. The action bar is included by default in all activities for apps with a minSdkVersion of 11. You can disable it and opt to only use the options menu, but for better user experiences it’s better to use the action bar as it is visible to the user, while the options menu needs the user to request it and the user might not be aware of its existence in the first place.

    This tutorial explores setting up the action bar and discusses the different configurations that it offers.

    Setting up the Action Bar

    To start off, we are going to create a new project. We won’t be using the Android Support Library, so make sure to select a minimum SDK version of 11 or above. When you run your project, the action bar will be included at the top of your app’s screen. It is included in all activities that use or inherit from the Theme.Holo theme – which is the default when the minSdkVersion is set to 11 or greater. A typical action bar is shown in the following figure.

    Action Bar