Appcelerator Titanium Application Development by Titanium Application Development by Example Beginner's ... inaugural CODESTRONG ... com/appcelerator -titanium -application -development-

  • View

  • Download

Embed Size (px)

Text of Appcelerator Titanium Application Development by Titanium Application Development by Example...

  • Appcelerator Titanium Application Development by Example Beginner's Guide

    Darren Cope

    Chapter No. 10 "Sending Notifications"

  • In this package, you will find: A Biography of the author of the book

    A preview chapter from the book, Chapter NO.10 "Sending Notifications"

    A synopsis of the books content

    Information on where to buy this book

    About the Author Darren Cope is an experienced Titanium developer having seen the light and the potential of what could be done with Titanium back in early 2011. Since 2011 he has released several cross-platform apps using the technology. He holds TCAD and TCMD certifications and along with creating apps, he has developed modules for the Appcelerator Marketplace. He attended the inaugural CODESTRONG conference in San Francisco in October 2011 and continues to preach the benefits of coding with Titanium through the Appcelerator Titans program. He is very eager to hear from other Titanium developers in the north of England and is trying to start a user group for them. He can be contacted either through his personal website at or by e-mail on

    I'd like to thank Tracey for her love, support, and encouragement during the writing of this book, and thank the writers of NCIS who have provided the background noise for most of the time I was writing this book. I would also like to thank Steve Dawes who reached out to me with an opportunity to develop an app in early 2011 and in doing so started the process that got me here.

    For More Information:


  • Appcelerator Titanium Application Development by Example Beginner's Guide It's fair to say that while Steve Jobs didn't necessarily start a smartphone revolution with the iPhone and iPad he certainly championed it and in doing so created beautifully designed devices that rightfully became both massively popular and highly desired.

    Not long after the introduction of these seductive devices came another masterstroke, the App Store. Apple generated massive developer interest by promoting the dream of becoming a rock-star developer by creating apps for this new platform. It was a massive success; a new breed of indie developers flocked to the platform pushing new apps into the App Store hoping their app would be the one to make it big.

    The App Store opened in June 2008 with only 500 apps. By October 2011 there were over half a million apps, and it continues to grow with over 500 new apps published every day. There will soon be 1 million apps available which has resulted in an ecosystem that has paid out over six billion dollars in royalties. Thanks to a lucrative payment strategy whereby Apple gets 30 percent of revenue from every sale, they have become one of the biggest companies in history.

    Success of that size doesn't go unnoticed or unchallenged. The monopoly didn't last long and soon after Google came along with Android and its own Android marketplace. While initial take-up was slower than Apple, it has gained ground and by late 2012 both stores had equal number of apps available.

    Now the app market has two major players. You can create an app for iOS or Android, but unfortunately there are no common compilers for the two systems, so if you want to write a native app for iOS, you have to use objective-C and Java for Android.

    Jeff Haynie and Nolan Wright (the founders of Appcelerator) were ahead of all of this; they already had a way of creating native apps for iOS using JavaScript, and it just so happened that the methodology they used in their Titanium tool would also work for Android. Titanium was launched in 2009 and since then it has attracted over 400,000 registered developers.

    Titanium allows you to create native apps that will run on both iOS and Android. A Titanium app can be run on both platforms without changing a single line of code. Over 50,000 apps have been released using the technology; this book will help you to add your app to that list.

    The book will guide you through the process of creating a cross-platform app, an app that can be released to both Android and iOS app stores.

    For More Information:


  • The book has been written in a relaxed and friendly manner with carefully selected examples that highlight the core concepts of the chapter. All examples, unless specifically stated, are written so that they may be run on both platforms.

    The chapters have been ordered to reflect the order in which I believe the tool should be learned. The initial chapters will provide guidance on how to install and configure the tool before moving on to how to create apps using Titanium. The book then looks in detail at how to design and structure apps. This is the content that will be invaluable later when your apps become larger and more complex. Being able to easily modify and extend your apps because they have been designed with a well-defined structure will be a significant advantage.

    The next few chapters then focus on some of the core components of apps with chapters on the cloud, phone gadgets, and data. After this we move on to an important area, interface design, and how to create apps that will run and look good on phones and tablets from both iOS and Android.

    Next, the book has a couple of chapters that look into a few optional extras such as social media integration and push notifications, before moving on to the final phase of testing and deploying your app to the app store.

    The final two chapters focus on areas that are often considered by developers after an app has gone live, namely analytics and making money from your app.

    What This Book Covers Chapter 1, How to Get Up and Running with Titanium, guides you through the process of installing Titanium and setting up the Android and iOS SDKs. It then shows you how to create your first, simple cross-platform app and explains the core components of all Titanium apps.

    Chapter 2, How to Make an Interface, introduces the tools that are available for making an interface and shows how you can design apps that make use of platform specific features. The next two chapters provide guidance on how to design and structure a Titanium application. Furthermore, they explain how a Titanium app is connected and how the use of best practices will result in more manageable code.

    Chapter 3, How to Design Titanium Apps, delves into the detail of how to structure a Titanium app, and how the use of best design practices results in more manageable, stable, and reusable code. It also explains the Model View Controller (MVC) design methodology and touches on Alloy, the latest in design models for Titanium.

    Chapter 4, Gluing Your App Together With Events, Variables, and Callbacks, explains how different parts of your app communicate with one another, for example, how a slider indicates its value to a label. It gives a thorough examination of events and also explains some of the problems of defining global variables and how to avoid creating them.

    For More Information:


  • Chapter 5, It's All About Data, describes how to communicate with external sources using HTTP requests. It also covers how to store data locally in files, databases, or properties. Finally, it provides a worked example of how to show foreign exchange prices using Yahoo Query Language (YQL).

    Chapter 6, Cloud-enabling Your Apps, looks at how to integrate cloud services into your app and how they can be used to store and retrieve data. It shows examples of Appcelerator Cloud Services and shows the principles of integrating any REST based service.

    Chapter 7, Putting the Phone Gadgets to Good Use, describes how to integrate phone gadgets into your app. It provides examples of the camera, compass, geolocation, maps, directions, and accelerometer. It also shows how these gadgets can be combined together to produce an Augmented Reality (AR) experience.

    Chapter 8, Creating Beautiful Interfaces, details how to build interfaces that work on both platforms and how the same interface can be altered to produce a different layout for phones and tablets. It also looks into how to break down a complex screen into smaller views and how to handle and control orientation.

    Chapter 9, Spread the Word with Social Media, shows how your can integrate Facebook and Twitter into your application. It also shows an alternative way of sharing information on Android using intents.

    Chapter 10, Sending Notifications, shows how to add push notification support into your app. It details the full workflow for push notifications from registering with a provider to acting on the notification from within your app.

    Chapter 11, Testing and Deploying, examines how to test your app on devices and includes detail on creating certificates and provisioning profiles. It also guides you through the process of successfully deploying your app to iOS and Android stores.

    Chapter 12, Analytics, provides examples of how to integrate three analytic providers, namely, Appcelerator Analytics, Flurry, and Google Analytics into your app, and shows the benefits of gathering analytic information.

    Chapter 13, M