By: Mehfuz Hossain and Stephen Forte
Building native apps can be challenging when you only have one developer and are targeting multiple device platforms . Also when you are doing some customer validation and quickly want to validate an idea, building an app for multiple platforms with two or three code bases is extremely tedious and inefficient.
You may have heard of the Yo! app that has been causing some ripples recently. The app can send your Friends a push notification containing “Yo” and that is about it. If you think that this is about as serious as a fart app, think again, serious Silicon Valley players are supporting Yo and the Yo app has raised well over $1.5m in venture funding.
Growing up on the East Coast, I think saying “Yo” is very East Coast (think Rocky Balboa or Tony Soprano), so in order to demonstrate the power of the Telerik Platform and stay true to our West Coast presence (think Mark Zuckerberg), we decided to recreate Yo with the Telerik Platform and call it “Dude”.
In this post, I will share my experience creating the “Dude” app that let you quickly nudge your friends through push notifications built using Telerik platform.
The app is comprised of the following features:
It sends device push notification to friends who are registered using Dude and have their app installed on their device
It can access the native contacts app in the device to invite new friends via SMS.
Provides in-app user registration and login support.
Once completed the app roughly will have the following screens:
But before you can send/receive notification you need to generate certificate(s) from Apple developers portal and upload it to your backend services portal. In case of Android, you need to set the API key copied from the Google developers console.
More information on how to configure backend services for push notification is outlined in the following link:
Backend Services SDK internally uses the push notification plugin to send out notifications and gives you rather consistent API methods to work with. You can include the SDK in your project in one of the following way:
bower install everlive
Now I have also used Couchbase Lite Cordova plugin for storing user lists locally. It is possible to install it from plugins marketplace or right from the AppBuilder web-client IDE properties page:
Once everything is configured, I am ready to roll. I have used Google’s angular.js for separating my controller logic from view which gives me nice separation of concerns (SRP) and prevents me from repetitive code (DRY),
I just had to include angular.js in my index.html file and added ng-app directive in the <body> tag:
I’ve declared separate controller for each kendo view and grouped them in a controllers folder and also referenced them in my index.html :
Now within each view, I referenced the controller with the ng-controller directive in the following way:
<div class="app" data-role="view" id="login" ng-controller="AccountController" data-transition="slide">
<ul class="list" ng-init="init('#login')">
<input type="text" placeholder="Username" ng-model="username" />
<input type="number" pattern="[0-9]*" placeholder="Password" ng-model="password"/>
<a href="#home" data-role="button">Go Back</a>
Here you will notice the other ng-* directives that maps to the corresponding $scope methods and variable bindings.
In addition, I’ve initialized the couchbase lite database as the app starts in the following way:
app.cbLiteUrl = url;
// More code goes here
Other than the basic configuration as shown above, nothing is surprising with appBuilder which is used for building the app and is pretty straight-forward with flexibility of sharing codebase between web client, CLI (command line interface) and Visual Studio with appBuilder extension.
If I want to share the codebase with other team members, appBuilder also lets me configure my repository using GitHub. In this way you can start your project in the web client , import it in your Mac to finish app with Sublime Text and finally continue in the web client to build and deploy the app.
Using AppBuilder you can quickly share the app with your friends using the companion app available both in iOS and Android store:
Or you can distribute it as a native package and enable live sync that will let you update the app with three fingers gesture when there is a new build. You can deploy your app to the device in the beginning of the development process and make subsequent updates without ever connecting your device.
I believe that deploying to app store is always a more time consuming and difficult process than building the app. If you agree with me then I like the step-by-step wizard in AppBuilder that guides me through the process without the need to dig deeper.
It is Build -> Configure your Certificate and Signing Details -> Publish process:
As my app becomes more complex, I can take the advantage of testing and analytics all of which come with Telerik platform to make you more productive.
One thing I forgot to mention is the on-the-fly bug fixing while running the app inside AppBuilder emulator.
In this case I have used the command line tool to fire up the emulator in my local machine:
In this post , I have quickly gone through the various bits and pieces of Telerik Platform as I build the “Dude” app and publish it in app store. The app is made open source in github and you can find the up-to-date store links in the readme.
Stephen Forte sits on the board of several start-ups including Triton Works. Stephen is also the Microsoft Regional Director for the NY Metro region and speaks regularly at industry conferences around the world. He has written several books on application and database development including Programming SQL Server 2008 (MS Press).
Subscribe to be the first to get our expert-written articles and tutorials for developers!