Appcelerator Titanium Application Development by Example Beginner's Guide


Appcelerator Titanium Application Development by Example Beginner's Guide
eBook: $29.99
Formats: PDF, PacktLib, ePub and Mobi formats
$25.49
save 15%!
Print + free eBook + free PacktLib access to the book: $79.98    Print cover: $49.99
$49.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Covers iOS, Android, and Windows8
  • Includes Alloy, the latest in Titanium design
  • Includes examples of Cloud Services, augmented reality, and tablet design

Book Details

Language : English
Paperback : 334 pages [ 235mm x 191mm ]
Release Date : April 2013
ISBN : 1849695008
ISBN 13 : 9781849695008
Author(s) : Darren Cope
Topics and Technologies : All Books, Mobile Application Development, Android, iOS, Mobile, Beginner's Guides

Table of Contents

Preface
Chapter 1: How to Get Up and Running with Titanium
Chapter 2: How to Make an Interface
Chapter 3: How to Design Titanium Apps
Chapter 4: Gluing Your App Together with Events, Variables, and Callbacks
Chapter 5: It's All About Data
Chapter 6: Cloud-enabling Your Apps
Chapter 7: Putting the Phone Gadgets to Good Use
Chapter 8: Creating Beautiful Interfaces
Chapter 9: Spread the Word with Social Media
Chapter 10: Sending Notifications
Chapter 11: Testing and Deploying
Chapter 12: Analytics
Chapter 13: Making Money from Your App
Appendix A: Git Integration
Appendix B: Glossary
Appendix C: Pop Quiz Answers
Index
  • Chapter 1: How to Get Up and Running with Titanium
    • System requirements and restrictions
    • Installing Titanium
    • Time for action – installing Titanium Studio
    • Setting up Titanium Studio
    • Time for action – setting up Titanium Studio
    • Installing the Android SDK
    • Time for action – configuring the Android SDK
    • Installing the iOS SDK
    • Time for action – configuring the iOS SDK
    • Installation problems – did something go wrong?
    • Your first cross-platform app
    • Time for action – creating an app from a template
    • Time for action – running an app in the emulator
      • Did the app fail to run?
    • A review of the first app
    • tiapp.xml
      • tiapp XML structure explained
      • Other files in the base directory
      • The Resources directory
        • app.js
        • KS_nav_ui.png and KS_nav_views.png
        • The Android and iPhone directories
    • Summary
    • Chapter 2: How to Make an Interface
      • What's in the toolkit?
      • A recap
      • Window
      • Tab group and tabs
        • Creating a tab group
        • Creating a tab
      • Labels
      • Views
      • Time for action – adding a view to a window
      • Time for action – adding a button to a view
      • Time for action – making something happen when the button is pressed
      • Adding a settings screen – a TableView masterclass
      • Time for action – adding a new window
      • Time for action – adding a styled TableViewRow object
      • Platform-specific tools
        • Adding an Android menu
      • Time for action – adding an Android menu
      • Time for action – running the Android menu changes on iOS
        • Why did this fail?
        • Isolating platform-specific code
      • Time for action – add an iOS fix for the Android menu
      • Capturing debug messages
        • Coding iOS specific elements
      • Time for action – adding an info button to the navigation bar
      • Summary
      • Chapter 3: How to Design Titanium Apps
        • JSON
        • Extending your app over multiple files
          • Titanium.include
        • Time for action – creating an activity indicator
        • Require
          • Require – loading a marketplace module
        • Time for action – adding an Appcelerator marketplace module
          • Require – promoting commonJS compliant code
        • MVC
        • Time for action – creating a better designed app using MVC
        • Behind the scenes – a look at the code
          • What does this mean?
        • An example of require
      • Alloy
      • Time for action – creating an Alloy app
      • Summary
        • Chapter 4: Gluing Your App Together with Events, Variables, and Callbacks
          • Sharing data
            • Execution context
          • Global variables
            • What is the right way to share data?
          • Time for action – sharing information between windows
          • Events
            • Event scope
            • Event properties
            • Making something happen – fireEvent
          • Time for action – creating a progress bar game
            • Global event listeners and garbage collection
            • Better event code using callbacks
          • Summary
          • Chapter 5: It's All About Data
            • External data
            • Time for action – creating an HTTP request
            • RSS reader
            • Time for action – fetching RSS
            • Time for action – parsing and displaying the RSS
            • Storing data on the device
              • Which one should you use; filesystem, database, or properties?
            • Storing data in files
              • Storing data in the database
            • Storing settings in Ti.App.Properties
            • Time for action – comparing the speed of database, file, and application properties
            • YQL
            • Time for action – creating a foreign exchange list
            • Summary
            • Chapter 6: Cloud-enabling Your Apps
              • Before the cloud
              • Which cloud services can you use with Titanium?
                • Clouds are everywhere
              • Appcelerator Cloud Services
              • Time for action – creating ACS custom objects
              • Uploading pictures
              • Time for action – uploading a photo to the cloud
              • Fetching ACS stored content
              • Time for action – creating a panel to show commentary entries
              • Parse
              • Time for action – storing custom objects using Parse
              • StackMob
              • Other cloud offerings
              • Choosing your cloud service
              • Summary
              • Chapter 7: Putting the Phone Gadgets to Good Use
                • The camera
                • Time for action – using the camera
                • Time for action – selecting a photo from the photo library
                • The accelerometer
                • Time for action – showing the accelerometer on a slider
                • Time for action – smoothing the accelerometer response
                • The compass
                • Time for action – displaying the compass heading
                • Augmented reality
                • Time for action – creating a simple augmented reality app
                • Maps
                • Time for action – adding a map
                • Time for action – adding annotations to a map
                • Directions
                • Time for action – adding directions to a map
                • Geolocation
                  • Are we allowed to get the location?
                • Accuracy and battery life
                • Time for action – getting the current location
                • Computing the distance from a coordinate
                • Time for action – getting the distance from a coordinate
                • Showing the user's current location on a map
                • Time for action – showing the user's location on the map
                • Summary
                • Chapter 8: Creating Beautiful Interfaces
                  • How to position and size items on a window?
                    • So what is a DIP and what's so good about it?
                  • Time for action - making DIPs the default unit for your app
                    • What about percentages?
                    • Using views to create your layout
                  • Orientation
                    • Restricting the orientation
                  • Time for action – restricting the orientation of your app (iPhone)
                  • Time for action – restricting the orientation of your app (Android)
                    • Changing the orientation manually
                  • Time for action – forcing an orientation change (all platforms)
                  • Creating layouts for phones and tablets
                  • Time for action – creating a multiplatform interface
                  • Time for action – creating a phone layout for your app
                  • Summary
                  • Chapter 9: Spread the Word with Social Media
                    • Facebook
                    • Time for action – registering your app with Facebook
                    • Time for action – sending a screenshot to Facebook
                    • Sending tweets
                    • Time for action – registering your app with Twitter
                    • Time for action – sending a tweet
                    • Sharing and social media on Android
                    • Time for action – sharing an update using intents
                    • Summary
                    • Chapter 10: Sending Notifications
                      • How push notifications work
                        • Why do you need to know this?
                      • Setting up notifications – the prerequisites
                        • Setting up iOS notifications
                      • Time for action – getting a push certificate
                      • Push notifications using Appcelerator Cloud
                      • Time for action – registering for push notifications with Appcelerator Cloud
                      • Push notifications using Urban Airship
                      • Time for action – registering for push notifications with Urban Airship
                        • Coding the interface to Urban Airship
                      • Time for action – registering a device for push notifications
                      • Summary
                      • Chapter 11: Testing and Deploying
                        • Registering your app with Apple
                        • Time for action – registering your app with Apple
                          • Installing a development/distribution certificate
                        • Time for action – installing a development certificate
                        • Running the app on devices
                          • Testing the app on iOS
                        • Time for action – running the app on an iOS device
                          • Testing the app on Android
                        • Time for action – configuring your Android device
                        • Debug your app
                        • Publishing your app
                          • iOS
                          • Android
                        • Deploying the app to the Apple App Store
                      • Time for action – deploying the app to the Apple App Store
                        • Deploying the app to Google Play
                      • Time for action – deploying the app to Google Play
                      • Summary
                        • Chapter 12: Analytics
                          • Comparing the providers
                          • Flurry
                          • Time for action – setting up Flurry
                            • Tracking page views
                          • Time for action – registering a page view
                            • Tracking custom events
                          • Time for action – registering a custom event
                            • Other items you can gather
                          • Google Analytics
                          • Time for action – setting up Google Analytics
                            • Tracking page views
                          • Time for action – registering a page view
                            • Tracking custom events
                          • Time for action – registering a custom event
                          • Analytics using Appcelerator
                          • Time for action – setting up Appcelerator Analytics
                            • Catching custom events
                          • Time for action – registering a custom event
                          • Other suppliers
                          • Summary
                          • Chapter 13: Making Money from Your App
                            • Displaying adverts in your app
                            • Time for action – configuring Google AdMob
                            • Time for action – incorporating AdMob into your app
                            • In-app purchases
                            • Time for action – adding in-app purchases for iOS
                              • In-app purchases on Android
                            • Time for action – adding in-app purchases for Android
                            • Summary
                            • Appendix A: Git Integration
                              • Importing a project
                              • Time for action – importing an existing GitHub project
                              • Time for action – uploading a project to GitHub
                                • Alternative suppliers
                              • Summary

                              Darren Cope

                              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 http://darren.cope.name or by e-mail on mail@darren.cope.name.
                              Sorry, we don't have any reviews for this title yet.

                              Code Downloads

                              Download the code and support files for this book.


                              Submit Errata

                              Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                              Errata

                              - 8 submitted: last submission 08 Apr 2014

                              Errata type: Code | Page number: 76

                              The revised index.xml file is as follows:

                              <Alloy>
                                <Window class="container">
                                  <NavigationGroup id="navgroup" platform="ios,mobileweb">
                                    <Window title="Window 1" id="MasterWindow" platform="ios,mobileweb">
                                      <TableView id="MasterTable" onClick="doClick" platform="ios,mobileweb"></TableView>
                                    </Window>
                                  </NavigationGroup>
                                  <TableView id="MasterTable" onClick="doClick" platform="android"></TableView>
                                </Window>
                              </Alloy>

                              Errata type: Typo | Page number: 141

                              var Cloud = require('TI.cloud');
                              should be
                              var Cloud = require('ti.cloud');

                              Errata type: Code | Page number: 76

                              The revised index.js file is as follows:

                              function doClick(e) {
                              if (OS_IOS || OS_MOBILEWEB) {
                              $.navWindow.openWindow(Alloy.createController('detail').getView());
                              } else {
                              Alloy.createController('detail').getView().open();
                              }
                              Ti.App.fireEvent('MVC:tab:itemSelected', {
                              name:e.rowData.title,
                              price:e.rowData.price
                              });
                              }

                              // some dummy data for our table view
                              var tableData = [
                              {title:'Apples', price:'1.25', hasChild:true, color:'black'},
                              {title:'Grapes', price:'1.50', hasChild:true, color:'black'},
                              {title:'Oranges', price:'2.50', hasChild:true, color:'black'},
                              {title:'Bananas', price:'1.50', hasChild:true, color:'black'},
                              {title:'Pears', price:'1.40', hasChild:true, color:'black'},
                              {title:'Kiwis', price:'1.00', hasChild:true, color:'black'}
                              ];

                              $.MasterTable.setData(tableData);

                              if (OS_IOS || OS_MOBILEWEB) {
                              $.navWindow.open();
                              } else {
                              $.index.open();
                              }

                              Pg 71

                              The image diagram has 2 errors in the following line. 

                              rew Window().open(): 

                              Should have the word new and a semicolon, not colon 
                              new Window().open; 

                              PG 41 

                              Incorrect: 
                              button1.addEventListener('click', function(e) {alert('You clicked 
                              me!')}) 

                              Corrected: 
                              button1.addEventListener('click', function(e) {alert('You clicked 
                              me!');}) 

                              Errata type: Technical | Page number: 75

                              1.) Point Number 8
                              The detail window merely has a window and a label. The edited contents of the detail.js file are included in the following code, although you can probably guess for yourself what it looks like:
                              SHOULD BE:
                              The detail window merely has a window and a label. The edited contents of the detail.xml file are included in the following code, although you can probably guess for yourself what it looks like:

                              2.) Point Number 10

                              Add the highlighted code to the table definition in index.html to add a click event handler to the table view.

                              SHOULD BE:

                              Add the highlighted code to the table definition in index.xml to add a click event handler to the table view. 

                              Page 141 | Step 8 - missing semicolon 

                              error:
                              success: function(e) {showPhoto(e); sendPiccyToCloud(e)} 

                              corrected:
                              success: function(e) {showPhoto(e); sendPiccyToCloud(e);} 

                              Errata type: Code related | Page number: 137

                              The line in the fourth bullet point  

                              "The first file will be called forexCommentary.js  and will contain the cloud functionality, and the second file called forexCommentaryView.js  will contain the layout code"

                              should be

                              "The first file will be called forexCommentary.js  and will contain the cloud functionality, and the second file called CommentaryView.js  will contain the layout code"

                              Sample chapters

                              You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                              Frequently bought together

                              Appcelerator Titanium Application Development by Example Beginner's Guide +    Oracle Warehouse Builder 11g R2: Getting Started 2011 =
                              50% Off
                              the second eBook
                              Price for both: £27.34

                              Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                              What you will learn from this book

                              • How to design applications that work on all supported platforms
                              • How to create layouts that work on all platforms and on both handheld and tablet devices
                              • How to design applications using Alloy
                              • The integration of social media
                              • Use the phone gadgets such as the accelerometer, compass, and camera
                              • How to integrate cloud services such as ACS, Parse, and Stackmob
                              • How to test your code and deploy to the app store/marketplace

                              In Detail

                              Appcelerator Titanium is the leading method for creating native cross-platform apps. This book guides you from the initial stages with the language right through to the submission of your app to the marketplace/app store. Specially crafted examples cover the most common requirements of an app programmer. This book will be your companion as you progress with the language.

                              "Appcelerator Titanium Application Development by Example Beginner's Guide" will guide you through the process of designing cross-platform apps using Titanium. It covers all areas of the language from installation through development to submission to the store.

                              This book will take a hands-on approach in teaching you how to write cross-platform apps using Titanium, as well as exploring the new features of Titanium 3. Each chapter will show you how to overcome specific challenges using Titanium. You will learn how to design your apps using MVC principles and Alloy, use the cloud to your advantage, develop apps that work on tablets and phones, use the phone gadgets like the accelerometer, integrate social media, record usage using analytics, and monetise your app. All tasks from installation to deployment to the store are covered and backed by examples. The book will be your companion from your first steps with Titanium to successful live deployment.

                              Approach

                              "Appcelerator Titanium Application Development by Example Beginner's Guide" is an example-driven tour of the language that guides you through all the stages of app design. The style is relaxed and friendly whilst remaining concise and structured.

                              Who this book is for

                              If you are new to this technology or curious about the possibilities of Appcelerator Titanium then this book is for you. If you are a web developer who is looking for a way to craft cross-platform apps, then this book and the Titanium language is the choice for you.

                              Code Download and Errata
                              Packt Anytime, Anywhere
                              Register Books
                              Print Upgrades
                              eBook Downloads
                              Video Support
                              Contact Us
                              Awards Voting Nominations Previous Winners
                              Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                              Resources
                              Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software