Book Image

Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API

Book Image

Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API

Overview of this book

With the world becoming more mobile, there is a growing need for mobile websites and applications. Building these from scratch is not a simple process. Kendo UI Mobile makes building websites and applications easier than ever before. Build applications for phones and tablets in no time at all and provide your user with a native look and feel.Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API helps you to understand the concept of building mobile applications using HTML5 based frameworks, specifically Kendo UI Mobile. It teaches you in a simple step-by-step manner how to create a service backend layer using ASP.NET Web API and how to integrate it with your front end mobile application, which is the missing piece of the puzzle for most developers who are new to mobile applications development. Learn everything from the basics of HTML5 to design and development of a mobile application using Kendo UI Mobile and ASP.NET Web API. Integrate them in the right way using extensible and maintainable JavaScript code.Starting with the basics of the Kendo UI platform, learn how to build a real world mobile application from scratch. You will explore the Kendo UI framework elements and integrate the sample mobile application with the ASP.NET Web API service. One of the most important things that you will learn from this book is how to organize your code using the JavaScript Revealing Module Pattern. You will also take a journey through Kendo UI Mobile widgets with lots of code samples hosted in jsFiddle. At the end of this book, you will complete the integration of the sample application and master fixing real world problems utilizing your newly acquired professional techniques that will save you time and effort.Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API will help you improve your mobile application development skills using hands-on examples, and will help you address the common problems faced by beginners as well as experienced web programmers. 
Table of Contents (15 chapters)
Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
About the Authors
About the Reviewers


The sudden explosion of mobile devices has made mobile apps development one of the hottest career fields for programmers. The global smartphone/tablet market shared by multiple platforms posed a serious question to mobile application developers and companies, as every mobile platform has different development frameworks and programming languages to develop native applications.

How can we achieve WORA (Write Once, Run Anywhere)?

The obvious solution was HTML5, which is supported by all the latest browsers and has great support for developing rich user interfaces. With the introduction of platforms such as PhoneGap, which exposes the native OS APIs to apps developed in HTML5/JavaScript and CSS3, HTML5-based applications became a double-edged sword. They can be developed using one code base and deployed as a mobile website as well as mobile apps which can be installed on different platforms, as opposed to developing native apps which will result in multiple code bases if multiple platforms are targeted. The availability of a large number of web developers in the industry who understand HTML, JavaScript, and CSS added a boost to the shifting direction of mobile apps development towards HTML5. As the demand increased for more and more mobile applications, both in enterprise and consumer areas, different types of HTML5-based development frameworks surfaced and are still surfacing!

Kendo UI Mobile from Telerik is one of the fastest growing HTML5- and jQuery-based cross-browser mobile applications development frameworks. KendoUI Mobile distinguishes itself from other frameworks by providing adaptive native UI rendering out of the box, without any extra coding, and supporting the Kendo base application development framework. While other mobile development frameworks concentrate on the UI part only, Kendo UI provides support for end-to-end, client-side development.

As the world is getting closer to the HTTP protocol, Web APIs (services which are exposed over plain HTTP) are gaining momentum. ASP.NET Web API helps to build powerful Web APIs, which can be consumed by a rich set of clients and is now the number one choice for .NET developers to build RESTful applications.

This book will introduce you to Kendo UI Mobile and will show you how to build an end-to-end mobile app using ASP.NET Web API as the service backend.

What this book covers

Chapter 1, Building a Mobile Application Using HTML5, helps a programmer, who is relatively new to the mobile applications development world, pick up on this journey to build an end-to-end app using Kendo UI Mobile. The chapter details different types of mobile applications such as native, hybrid and mobile websites, an introduction to Kendo UI Mobile, and wraps up with mobile applications design guidelines.

Chapter 2, Building Your First Mobile Application, introduces you to Kendo UI Mobile code in detail, and some screens for the Movie Tickets app will be developed explaining views, layouts, navigation, and more. From this chapter we get our hands dirty and write some really cool code.

Chapter 3, Service Layer with ASP.NET Web API, introduces you to one of the latest additions to Microsoft .NET stack, ASP.NET Web API. We will see routing, parameter binding, content negotiation, token-based authentication, authorization, and write some API methods which will be used for the sample Movie Tickets application. Readers not from the Microsoft background can skip this chapter as well as writing your own services with the same functionality on a platform of your choice or use the service hosted by us on the Internet. The frontend Kendo UI Mobile client application is independent of the backend API technology and will work with any service platform as long as it accepts and returns the same JSON data.

Chapter 4, Integration Using Framework Elements, discusses the common Kendo Framework elements such as DataSource, Templates, and MVVM, which are used in both mobile and web application development. Then we will start backend integration with the Movie Tickets app by building the User Account screen, discussing the Revealing Module Pattern and the application architecture.

Chapter 5, Exploring Mobile Widgets, introduces you to the core of the Kendo UI Mobile Framework, the Mobile widgets. We will dive deep into widgets such as ListView, Button, ButtonGroup, and so on. Using the provided jsFiddle examples, users can play around with the sample code.

Chapter 6, ActionSheet, ModalView, and More Widgets, continues on from the previous chapter, and we will explore more Kendo UI Mobile widgets hands-on.

Chapter 7, Movie Tickets Application – Complete Integration, completes our Movie Tickets sample application by integrating with Kendo UI Mobile widgets, framework elements, and the ASP.NET Web API service.

Who this book is for

This book is intended for novice and expert programmers with a web development background who want to build mobile applications or mobile websites for enterprise as well as consumer domains. A basic understanding of HTML, CSS, and jQuery is required to make good use of this book.

What you need for this book

The following software are required to make full use of this book:

  • Kendo UI Mobile: Free trial or commercial licensed version ($199 per developer)

  • jQuery 1.8.1: Free

  • Ripple Emulator: Free

  • MS Visual Studio 2010/2012 Express edition, ASP.NET MVC4: These are available as free downloads and are required only if you are a .NET programmer and are interested in exploring ASP.NET Web API.


In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Now let's create an action method in MoviesController.cs, which calls the GetMovieList BLL method."

A block of code is set as follows:

public class TrailerBO
    public string MovieName { get; set; }
    public string VideoUrl { get; set; }

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<!-- Movies main view --->
<div data-role="view" id="mt-home-main-view" data-title="Movies"
        data-layout="mt-main-layout" class="no-backbutton">

Any command-line input or output is written as follows:

customEvent fired
customEvent fired with data: Kendo UI is cool!

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: Two buttons, Open Left and Open Right, are placed on the NavBar widget in the layout of the views, which can be clicked to open the Drawer widgets as shown in the following code:


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code and graphics

You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

You can download the colored graphics from:


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from


Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.


You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.