Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Creating Mobile Apps with Appcelerator Titanium
Creating Mobile Apps with Appcelerator Titanium

Creating Mobile Apps with Appcelerator Titanium: There's no better way to learn Titanium than by using the platform to create apps for iPhone, iPad, and Android, and this tutorial lets you do exactly that. It's a truly hands-on approach that covers all the essential bases.

eBook
AU$36.99 AU$53.99
Paperback
AU$67.99
Subscription
Free Trial
Renews at AU$24.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $24.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Creating Mobile Apps with Appcelerator Titanium

Chapter 2. Sili, the assistant that just listens

In this chapter, we will be making our very own voice recorder application called Sili. While other popular applications interpret voice commands, this application simply listens by storing the recordings on the device. We will also provide the possibility of listening to previous recordings by selecting them from a list. We will cover user interface (UI) interactions of course, but we will also be covering media and filesystem interactions.

By the end of this chapter, you will have learned the following concepts:

  • Applying images to standard controls (such as buttons) to implement a "custom" look and feel
  • Recording audio and saving to the device
  • Interacting with the filesystem
  • Playing back an audio file
  • Deleting a specific table view row

Note

Titanium only supports audio recording on the iOS platform at this time. Therefore this project will be specifically built for an iPhone. Also, while all the interface interactions can be...

Creating our project

First, we need to set up a new project for our application. To do this, select the File | New | Mobile Project menu from the Titanium studio and fill out the wizard forms with the following information:

Field

Values to be entered

Project Template

Default project

Project Name

Sili

Location

You can either:

  • Create the project in your current workspace directory by checking the Use Default Location checkbox
  • Create the project in a location of your choice

App Id

com.packtpub.hotshot.sili

Company/Personal URL

http://www.packtpub.com

Titanium SDK Version

By default, the wizard will select the latest version of the Titanium SDK, which is recommended (as for this writing, we are using Version 3.1.1 GA)

Deployment Targets

Only check iPhone

Cloud Settings

Uncheck the Cloud-enable this application checkbox

Project creation is covered more extensively in Chapter 1, Stopwatch (with Lap Counter). So, feel free to refer to this section if you...

The user interface structure

This new application's user interface will also be comprised of a single window, divided into sections using views as containers:

  • The top view will act as a header containing the application's title using a Label and a Button for interaction.
  • The second view will be the largest one of them all. Spanning most of the screen's height, it will contain a list of all the saved recordings.
  • The last section will be present at the bottom of the application and will contain a very large Button so that it is easily accessible, as shown in the following figure:
The user interface structure

Coding the application

Now that we have a better idea of how our application will look, and most importantly, how it will be structured, we will go ahead and translate that into code.

Let's do some scaffolding

We can start creating our window and views, and add controls to them. While these controls won't have any interaction (yet), it will be much easier down the road to implement interactions once everything is in place. As we did before, we will open the app.js file and clear all its content in order to have a clean slate.

Since every single application needs at least one window, ours is no exception to the rule. So, we will create one using the Ti.UI.createWindow function and set its title to Sili. We also need to add additional views and controls later on in the code, hence we store its reference in the win variable:

var win = Ti.UI.createWindow({
  backgroundColor: '#ffffff',
  title: 'Sili',
  layout: 'vertical'
});

Our top view will serve as a...

Summary

In this chapter, we learned how to use the audio capabilities of Titanium. We also learned how to interact with the device's filesystem and how to read and write from the application data directory. Finally, we learned how to use the powerful table view's edit mode.

In the next chapter, we will learn how to save data on our device using a database.

Left arrow icon Right arrow icon

Key benefits

  • 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

Description

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.

Who is this book 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.

What you will learn

  • 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

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 26, 2013
Length: 318 pages
Edition : 1st
Language : English
ISBN-13 : 9781849519267
Vendor :
Appcelerator
Category :
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. $24.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Oct 26, 2013
Length: 318 pages
Edition : 1st
Language : English
ISBN-13 : 9781849519267
Vendor :
Appcelerator
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
AU$24.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
AU$249.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just AU$5 each
Feature tick icon Exclusive print discounts
AU$349.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just AU$5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total AU$ 143.98
Creating Mobile Apps with Appcelerator Titanium
AU$67.99
Appcelerator Titanium Application Development by Example Beginner's Guide
AU$75.99
Total AU$ 143.98 Stars icon

Table of Contents

12 Chapters
1. Stopwatch (with Lap Counter) Chevron down icon Chevron up icon
2. Sili, the assistant that just listens Chevron down icon Chevron up icon
3. The To-do List Chevron down icon Chevron up icon
4. Interactive E-book for iPad Chevron down icon Chevron up icon
5. You've Got to Know When to Hold 'em Chevron down icon Chevron up icon
6. JRPG – Second to Last Fantasy Chevron down icon Chevron up icon
7. JRPG – Second to Last Fantasy Online Chevron down icon Chevron up icon
8. Social Networks Chevron down icon Chevron up icon
9. Marvels of the World around Us Chevron down icon Chevron up icon
10. Worldwide Marco Polo Chevron down icon Chevron up icon
A. References Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8
(4 Ratings)
5 star 75%
4 star 25%
3 star 0%
2 star 0%
1 star 0%
Josh Jun 11, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is written extremely well, and is a great intro to building apps in Titanium for beginners. Intermediate level programmers will also appreciate it as a quick read to familiarize yourself with the methods specific to the Titanium SDK and how to integrate various cross-platform functionalities. Some examples have already become a bit outdated, such as the Japanese style RPG game, since the original module was purchased by another company and is no longer easily accessible. (You can still find it in Github) Other than that, the skills you learn from this book will get you rolling with Titanium and their community and documentation can probably take you from there!
Amazon Verified review Amazon
Fariza Dahes Apr 28, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
L'auteur fait montre d'une pédagogie infinie, impossible de rater votre première appli mobile!Les exemples d'appli proposés sont de difficultés progressives et variées!Ce livre est un excellent investissement.
Amazon Verified review Amazon
Zims Jun 17, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent! Well written and concise. Great examples. Very helpful. Thanks. Hope to see more titanium books like this in the future.
Amazon Verified review Amazon
Flavio Apr 21, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
It's a practical book with good examples and explanations. If you are a developer of mobile application in Titanium this is one of the recommended books for you. You'll have a good navigation on planing and coding apps in Titanium with practical cases.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.