Creating Mobile Apps with Appcelerator Titanium


Creating Mobile Apps with Appcelerator Titanium
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
$22.94
save 15%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
$44.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Walk through the development of ten different mobile applications by leveraging your existing knowledge of JavaScript
  • Allows anyone familiar with some Object-oriented Programming (OOP), reusable components, AJAX closures take their ideas and heighten their knowledge of mobile development
  • Full of examples, illustrations, and tips with an easy-to-follow and fun style to make app development fun and easy
  • Get empowered to build your own apps from the knowledge gained from this book

Book Details

Language : English
Paperback : 298 pages [ 235mm x 191mm ]
Release Date : October 2013
ISBN : 1849519269
ISBN 13 : 9781849519267
Author(s) : Christian Brousseau
Topics and Technologies : All Books, Mobile Application Development, Open Source

Table of Contents

Preface
Chapter 1: Stopwatch (with Lap Counter)
Chapter 2: Sili, the assistant that just listens
Chapter 3: The To-do List
Chapter 4: Interactive E-book for iPad
Chapter 5: You've Got to Know When to Hold 'em
Chapter 6: JRPG – Second to Last Fantasy
Chapter 7: JRPG – Second to Last Fantasy Online
Chapter 8: Social Networks
Chapter 9: Marvels of the World around Us
Chapter 10: Worldwide Marco Polo
Appendix: References
Index
  • Chapter 1: Stopwatch (with Lap Counter)
    • Creating our project
      • What have we here?
    • The UI structure
      • Why do we use views?
    • Now on to the code
      • It all starts with a window
      • Displaying the current time with big numbers
        • We can now do our first run
      • Starting and stopping the stopwatch
        • We see the buttons, but they don't do much yet!
        • Stopwatch is not defined, but it's okay
      • Keeping up with lap times
        • Capturing lap times
        • Showing lap times in a scrollable list
      • Resetting the timer
    • Summary
    • Chapter 2: Sili, the assistant that just listens
      • Creating our project
      • The user interface structure
      • Coding the application
        • Let's do some scaffolding
          • Let's see how this looks
        • Recording with a click on a single button
          • What good is a buffer if we're not using it?
        • Listing stored recordings
          • Be sure to call it!
        • Listening to a recording
        • Deleting old recordings
      • Summary
      • Chapter 3: The To-do List
        • Creating our project
        • The user interface structure
        • Let's get this show on the road
          • The database
            • Defining the structure
            • Implementing our model
          • The user interface
            • The header view
            • The tasklist
            • The button bar
            • Let's have a look
          • Adding a new task
          • Listing all the existing tasks
            • Before executing the code
          • Marking a task as completed
          • Filtering out completed tasks
            • Activating the filter
          • Deleting the completed tasks
          • Close the door, you're letting the heat out
        • Summary
        • Chapter 4: Interactive E-book for iPad
          • The user interface structure
          • Before writing any code
            • A native module
            • Where do I get it?
          • Creating our project
            • Adding the module to our project
          • Now we can code
            • The user interface
              • Importing the PageFlip module
              • Adding some colorful views
              • Making sure the pages actually turn
              • Orientation
            • The rich HTML page
            • The map view
            • The video player
            • Final assembly
          • Summary
          • Chapter 5: You've Got to Know When to Hold 'em
            • Creating our project
            • The application structure
            • The main application window
              • Moving on to the code
                • Coding the user interface
                • Sparing our fingers
                • Preparing for our first run
            • The portfolio management window
              • Coding what we have designed
                • The form at the top
                • The stock list
            • Navigating between the two windows
              • Let's see if it works
            • Moving stocks around
              • Saving our portfolio
              • Keeping up on our objective
              • Portfolio management
                • Saving
                • Retrieving
                • Updating a particular stock
                • How much is our portfolio worth?
            • Wiring the preference service to the UI
              • Adding a new stock to the list
              • Creating a custom look for our table rows
                • One more thing before we can test
              • Saving all that
              • What if there are stocks already?
            • Retrieving the stock values from the Internet
              • Knowing where to get it
                • Let's see what we get from it
              • Retrieving one stock
                • Creating an HTTPClient object
                • Opening the HTTPClient object
                • Sending the request itself
              • Retrieving all stocks in a single call
              • Calling the web service
            • Handling when stocks are updated
            • Making the whole thing more fluid
              • Updating stocks when the portfolio has changed
              • Updating stocks as the application starts
            • Summary
            • Chapter 6: JRPG – Second to Last Fantasy
              • Creating our project
              • The game's basic design
              • We need an engine!
                • Where can we get it?
                • Installing our module
              • The map (before we code a single line)
                • The right tool for the right job
                • Creating the map
                • Tilesets
                  • Using the tileset
                • Using layers
                  • Why layers?
                • Speaking the same language
              • Let's turn this map into a game
                • The scaffolding
                • Loading an external asset
                • Loading the game
                • Let's fire it up!
                • Hum! Somehow it looked like a better map editor
                  • Let's see our map now
              • We need a hero
                • Hold that code, will you?
                  • How does a SpriteSheet actually work?
                • Bringing our hero into the scene
                  • Let's keep it modular
                  • Putting our hero on the map
                  • Hey! Don't stay in the corner
              • Venture around the map
                • No directional pad, but that's okay
                  • Creating our V-Pad
                  • Is someone touching the V-Pad?
                  • Moving our hero around
                  • Is it a game yet?
              • Our hero moves, but he's still pretty stiff
                • Make sure he walks in the right direction
                • Make sure he stops in the right direction
              • Putting the finishing touch
                • The user is touching the V-Pad, but where exactly?
                • Be sure nothing overlaps
                • Cleaning up after ourselves
              • Summary
              • Chapter 7: JRPG – Second to Last Fantasy Online
                • Creating our project
                  • Recycling saves our time
                • Before we get our hands dirty
                  • Some things to be considered
                    • WebSockets
                • Setting up things
                  • The server side
                    • Enter Node.js
                    • Creating our server project
                    • socket.io
                    • Making sure everything is in place
                  • The client side
                    • The Web Socket module
                • Coding our game server
                  • Creating a web server in less than 10 lines of code
                    • Taking our server for a spin
                  • Keeping tabs on our players
                  • Creating our socket.io connection
                  • Game interactions
                    • A player joins the game
                    • A player quits the game
                    • JavaScript arrays don't have a contains function?
                  • Player interactions
                    • A player moved around the map
                    • A player used the chat feature
                  • Sparing network traffic
                  • Make sure everything runs smoothly
                • Let's bring this game online!
                  • Connecting to the server
                  • Every player is different
                    • Designing the hero selection window
                    • Gathering new assets
                    • To the code!
                    • Changing the hero's appearance
                    • Making this work
                  • Making our hero speak
                    • Back to the drawing board
                    • Wiring it up
                    • Displaying what the hero is saying
                  • Interacting with the game server
                    • When our hero moves
                  • This looks familiar
                    • Where is everybody?
                    • Be sure to hang up that connection
                • Game on!
                • Summary
                • Chapter 8: Social Networks
                  • Creating our project
                  • One window to rule them all
                  • Code while it is hot!
                    • The top section
                      • Staying within the limits
                      • Setting up our Post button
                    • The bottom section
                    • What if the user rotates the device?
                    • See it in action
                    • Polishing it up a little
                  • Facebook Integration
                    • Creating our application
                    • Retrieving our Facebook app ID
                    • There is a module for that
                      • Instantiating our module
                    • Linking our mobile app to our Facebook app
                      • Allowing our user to log in and log out at the click of a button
                      • Handling responses from Facebook
                      • Posting our message on Facebook
                  • Twitter integration
                    • Creating our application
                      • Retrieving our consumer key and secret
                    • No module, but a good,old fashioned JavaScript library
                      • Instantiating the library
                    • Linking with our Twitter application
                      • Toggling the state of the Twitter connection
                      • Authorizing our application
                    • Posting our message on Twitter
                  • Settings
                    • Before we touch anything
                    • Settings for iOS
                      • Now to see if this works
                    • Settings for Android
                      • Where are those settings?
                    • The settings are changed, then what?
                    • It goes both ways
                  • Summary
                  • Chapter 9: Marvels of the World around Us
                    • Creating our project
                    • The main window
                      • Let's dig in the right way
                        • The header
                      • The ListView component
                        • The template
                        • Creating our ListView object
                      • Wrapping it up
                      • Calling our main window
                      • Testing our work so far
                    • Getting the device's location
                      • How does that translate into code?
                      • How can we test this?
                        • Using the iOS simulator
                        • Using the Android emulator
                        • Validating our test
                    • Photos from the Web to our application
                      • There is a web service for that...
                        • Getting our API key
                        • Remembering that key
                        • Defining the call
                        • Making the call
                        • Handling the response
                      • Having a second look at our main window
                    • The photo viewer window
                      • On with the code
                        • Returning to our main window
                    • Connecting the wires
                      • Selecting a photo
                      • The Refresh button
                      • Testing out the navigation
                    • Photo gallery integration
                      • Android photo gallery integration
                      • iOS photo gallery integration
                      • One final run
                    • Summary
                    • Chapter 10: Worldwide Marco Polo
                      • We know the drill
                      • Let's see what we got here
                      • Our tabbed user interface
                        • Getting this show on the road
                          • The chicken and the egg
                          • Using those windows
                        • Running our application for the first time
                      • Appcelerator Cloud services
                        • Creating a user
                        • Our development sandbox
                        • Connecting to the cloud
                          • Don't forget to call it
                      • The Polo window
                        • The user interface
                          • One more thing
                        • Determining the player's location
                          • A better Geolocation service
                        • Pushing our location to the Cloud
                          • This is our very first time
                          • We already played this game before
                        • Testing our Polo feature
                      • The Marco window
                        • Creating a dedicated map module
                        • We have CommonJS modules, let's use them
                        • Getting player locations from the cloud
                      • Let's play!
                      • What about Android?
                        • It's good that maps are their own thing
                        • Testing this new map module
                      • Summary
                      • Appendix: References
                        • The source code for this book
                        • The Page Flip Module
                        • The cURL utility
                        • The Stock quote API
                        • The tiled map editor
                        • Sprite sheets and tilesets
                        • The QuickTiGame2d game engine
                        • Node.js
                          • NPM
                          • Socket.IO
                        • The TiWS module
                        • The Facebook Graph API
                        • The social_plus library
                        • The Flickr API
                        • Appcelerator Cloud Services
                        • The MaxMind GeoIP service
                        • Google Maps v2

                        Christian Brousseau

                        Christian Brousseau is a proud Canadian who has been developing software for over twenty years. He made his debut in Windows development and then moved on to Java when the Web came along. About thirteen years ago, he had the opportunity to move to France where he worked on major Java Enterprise projects for one of the largest software companies in the world, in different sectors such as banking, insurance, retail, government, and defense. Over the last few years, he became very enthusiastic about mobile platforms in general and has developed quite a few applications for iOS and Android devices using the Appcelerator Titanium platform. He is very active within the community; being a Titanium-certified application developer and a member of the Titans Evangelist group, he is one of the top 10 contributors on the Appcelerator's Questions & Answers forum. Still living in Paris, he left the enterprise world and created his own company, Things Are Moving (http://www.thingsaremoving.com), that specializes in mobile development.
                        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

                        - 4 submitted: last submission 11 Feb 2014

                        Errata type: Code | Page number: 60

                        The revised toggleAllTasks function is as follows:

                        function toggleAllTasks(showAll) {
                          if (showAll) {
                            refreshTaskList();
                          } else {
                              var section = taskList.data[0];

                              if (section) {
                                for (var i = 0; i < section.rowCount; i++) {
                                  var row = section.rows[i];

                                  if (row.hasCheck) {
                                    taskList.deleteRow(i);
                                  }
                                }
                              }
                           }
                         }

                        Errata type: Typo | Page number: 77

                        In the last sentence of the Summary section, it should be 

                        ... center it to a certain set of GPS coordinates ...

                        instead of

                        ... center it to a certain set of GPC coordinates ... 

                        Errata type: Code | Page number: 85

                        The code should look as follows:

                         var lblWhatToDo = Ti.UI.createLabel({

                          text: 'HOLD',

                          left: 5, 

                          top: 200,

                          width: '100%',

                          height: Ti.UI.SIZE,

                          textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,

                          font: {

                            fontSize: '65sp',

                            fontWeight: 'bold'

                          },

                          color: '#ffffff'

                        });

                        Errata type: Code | Page number: 48

                        There should be a comma after top: 0

                        var headerView = Ti.UI.createView({

                          top: 0,

                          height: '50dp',

                          width: '100%',

                          backgroundColor: '#447294',

                          layout: 'horizontal'

                        });

                        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

                        Creating Mobile Apps with Appcelerator Titanium +    Salesforce CRM: The Definitive Admin Handbook =
                        50% Off
                        the second eBook
                        Price for both: €35.15

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

                        What you will learn from this book

                        • Create full-fledged applications using native components
                        • Save your data using a database and interact with it using SQL
                        • Interact with web services to retrieve data from external sources
                        • Make your own adventure game (Japanese RPG style)
                        • Bring a friend along on your epic adventure by adding online multiplayer to your game
                        • Use Geolocation to interact localized data and display it on a map
                        • Store your information in a centralized form using Appcelerator Cloud Services (ACS) and share this information with other users
                        • Integrate your applications with popular social media sites such as Facebook and Twitter

                        In Detail

                        Smartphones and tablets have really changed the technological landscape over the last 3-4 years. Much like the web did in the last decade, these powerful tools have changed the way people communicate and access information. Such a wide market creates opportunities for developers who have the skills to develop mobile applications.

                        "Creating Mobile Apps with Appcelerator Titanium" is a practical, step-by-step guide to building iPhone, iPad, and Android applications using JavaScript. This book will give you a solid grounding of the dos and don'ts of mobile development and also covers a lot of the functionalities offered by the Titanium platform.

                        This book begins with a look at what the Titanium platform has to offer. By taking you through clear tutorials on developing each application step-by-step, it helps you to apply your newly acquired knowledge afterwards. The difficulty level gradually increases along the course of the book.

                        Each application from this book covers different aspects of mobile development. Every chapter starts by defining the application’s features as well as the user interface structure. Every single code section is then explained and put into context allowing you to gain a clear understanding of their purpose and functionality. The book takes a “small milestone” approach, allowing you to actually run the application and see the progression. Every step is accompanied by many screenshots so you can see the expected result on screen.

                        You will learn everything you need to know to develop your very own mobile applications. The book takes a laid-back approach to Titanium development and provides information in a way designed to never overwhelm the reader with information and also uses clear diagrams, screenshots, and tips throughout.

                        Approach

                        "Creating Mobile Apps with Appcelerator Titanium" provides a hands-on approach and working examples on creating apps and games as well as embedding them onto a social networking website. Developers can then move on from there to develop their own applications based on the ones they have developed throughout the course of this book.

                        Who this book is for

                        "Creating Mobile Apps with Appcelerator Titanium" is for developers who have experience with modern languages and development environments. Also, if you are familiar with the concepts of Object-oriented Programming (OOP), reusable components, AJAX closures, and so on, this book will help you leverage that knowledge in mobile development.

                        This book will also cater to Titanium users who wish to know more about Titanium’s broad range of capabilities and will help you to expand Titanium's basic set of features by using extension modules.

                        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