LiveCode Mobile Development: Beginner's Guide - Second Edition
By Colin Holgate and Joel Gerdeen
4/5
()
About this ebook
- Create fun, interactive apps with the rich media features of LiveCode
- Dive headfirst into mobile application development through explanations enriched with ample screenshots
- Learn to create apps and interfaces using the step-by-step instructions
The ideal reader for this book would be someone who already knows LiveCode, is interested in creating mobile apps, and wants to save the many hours it took for me to track down all of the information on how to get started! Chapter 1, LiveCode Fundamentals, will help those of you who know programming but are not familiar with LiveCode. The knowledge you've acquired should be enough for you to benefit from the remainder of the book.
Colin Holgate
Colin Holgate was originally trained as a telecommunications technician in the Royal Air Force, but with the advent of the personal computer era he transitioned to working as a technical support engineer for companies that included Apple Computer UK. In 1992 he moved to the USA, to become a full time multimedia programmer, working for The Voyager Company. In that role he programmed several award winning CD-ROMs, including A Hard Day's Night and This Is Spinal Tap. For the last 12 years Colin has worked for Funny Garbage, a New York City based web design company. In addition to using Adobe Director and Adobe Flash for online and kiosk application, he has used LiveCode for in-house production tools. At the introduction of LiveCode for Mobile at the RunRevLive Conference in 2011, Colin entered, and won a contest to create a mobile application made with LiveCode.
Related to LiveCode Mobile Development
Related ebooks
LiveCode Mobile Development Beginner's Guide Rating: 0 out of 5 stars0 ratingsFlash Development for Android Cookbook Rating: 3 out of 5 stars3/5Swift 5 for Absolute Beginners: Learn to Develop Apps for iOS Rating: 0 out of 5 stars0 ratingsiPhone Application Development For Dummies Rating: 4 out of 5 stars4/5Mastering Android Application Development Rating: 5 out of 5 stars5/5Mastering Google App Engine Rating: 0 out of 5 stars0 ratingsAndroid Programming for Beginners Rating: 3 out of 5 stars3/5PhoneGap By Example Rating: 5 out of 5 stars5/5How To Create An App Rating: 3 out of 5 stars3/5HTML5 Game Development by Example: Beginner's Guide - Second Edition Rating: 1 out of 5 stars1/5Dart By Example Rating: 0 out of 5 stars0 ratingsMastering Android Game Development Rating: 0 out of 5 stars0 ratingsBuild a Whatsapp Like App in 24 Hours: Create a Cross-Platform Instant Messaging for Android Rating: 4 out of 5 stars4/5Android NDK: Beginner's Guide - Second Edition Rating: 0 out of 5 stars0 ratingsAppsters: A Beginner's Guide to App Entrepreneurship Rating: 3 out of 5 stars3/5Learning Android Application Development Rating: 0 out of 5 stars0 ratingsApp Development For Beginners: Secrets to Success Selling Apps on the Google Play Store Rating: 5 out of 5 stars5/5Corona SDK Mobile Game Development Beginner's Guide Rating: 5 out of 5 stars5/5Windows Batch File Programming Rating: 2 out of 5 stars2/5Libgdx Cross-platform Game Development Cookbook Rating: 0 out of 5 stars0 ratingsSwift For Dummies Rating: 0 out of 5 stars0 ratingsAndroid System Programming Rating: 5 out of 5 stars5/5App Development For Beginners: Secrets to Success Selling Apps on the App Store Rating: 3 out of 5 stars3/5Android For Beginners. Developing Apps Using Android Studio Rating: 5 out of 5 stars5/5App Empire: Make Money, Have a Life, and Let Technology Work for You Rating: 4 out of 5 stars4/5Principles of Programming: Java Level 1 Rating: 0 out of 5 stars0 ratingsPHP 8 Objects, Patterns, and Practice: Mastering OO Enhancements, Design Patterns, and Essential Development Tools Rating: 0 out of 5 stars0 ratingsAndroid Game Programming by Example Rating: 0 out of 5 stars0 ratings
Programming For You
Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5101 Amazing Nintendo NES Facts: Includes facts about the Famicom Rating: 4 out of 5 stars4/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Pokemon Go: Guide + 20 Tips and Tricks You Must Read Hints, Tricks, Tips, Secrets, Android, iOS Rating: 5 out of 5 stars5/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5C# 7.0 All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsGrokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5ReactJS by Example - Building Modern Web Applications with React Rating: 4 out of 5 stars4/5
Reviews for LiveCode Mobile Development
1 rating0 reviews
Book preview
LiveCode Mobile Development - Colin Holgate
Table of Contents
LiveCode Mobile Development Beginner's Guide Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Time for action – heading
What just happened?
Pop quiz – heading
Have a go hero – heading
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. LiveCode Fundamentals
Background history and metaphors
You do have LiveCode, don't you?
Learning the lay of the land
Online lessons
Main windows
Time for action – it's a drag, but you'll like it!
To select edit or not…
What just happened?
Creating a hierarchy
The stack structure
Where does the code go?
Time for action – making cards and navigating between them
What just happened?
Pop quiz – selecting the best name?
Making a simple calculator application
Inspector clues, oh!
Time for action – making the calculator buttons
What just happened?
Verbosity, synonyms, and me
Adding the card handlers
Variable types in LiveCode
Pop quiz – try to remember…
Extending the calculator
Have a go hero – getting to the root of things
Other interface controls
The video player control
The still image control
Rollover buttons
Many more controls…
Debugging
Summary
2. Getting Started with LiveCode Mobile
iOS, Android, or both?
Becoming an Android developer
Google Play
Amazon Appstore
Pop quiz – when is something too much?
Downloading the Android SDK
Installing the Android SDK on Mac OS X (Intel)
Installing the Android SDK on Windows
Pointing LiveCode to the Android SDK
Pop quiz – tasty code names
Becoming an iOS developer
Pop quiz – iOS code names
Installing Xcode
Pointing LiveCode to the iOS SDKs
Before we make our first mobile app…
Getting ready for test development on an Android device
Time for action – starting an Android Virtual Device
Creating an Android Virtual Device
What just happened?
Connecting a physical Android device
Using Kindle Fire
Time for action – adding Kindle Fire to ADB
What just happened?
Getting ready for test development on an iOS device
Time for action – using the iOS simulator
What just happened?
Appiness at last!
Time for action – testing a simple stack in the simulators
What just happened?
Time for action – testing a simple stack on devices
What just happened?
Have a go hero – Nook
Further reading
Summary
3. Building User Interfaces
Setting up a test bed mobile app
Time for action – making the test bed stack
What just happened?
Invoking the desktop e-mail application
Time for action – calling the native e-mail application
What just happened?
Installing the e-mail test on devices
Time for action – trying the test bed stack on devices
What just happened?
Opening a web page
Time for action – calling the native browser application
What just happened?
The mobile-only date picker
Time for action – displaying a date picker
What just happened?
Time for action – loading pictures for a mobile device
What just happened?
Pop quiz – getting the big picture
Making OS-styled buttons
Using bitmaps
Time for action – using Photoshop to prepare button states
What just happened?
Pop quiz – the cost of things these days
MobGUI to the rescue!
Time for action – getting started with MobGUI
What just happened?
A test bed app, the MobGUI way
Time for action – using MobGUI to make a test bed app
What just happened?
MobGUI native controls
Time for action – using native controls from MobGUI
What just happened?
Have a go hero – other tests and pretty icons
Laying out using a resize handler
Time for action – a simple code layout example
What just happened?
Laying out using the LiveCode Geometry Manager
Time for action – using the Geometry Manager to position buttons
What just happened?
Resolution independence
Multiple density support
Pixels and points
Image naming convention
The full-screen scaling mode
Syntax
The empty mode
The showAll mode
The letterbox mode
The noBorder mode
The exactFit mode
Summary
4. Using Remote Data and Media
The stack structure
Code-driven and manually created layouts
Locations for code
Pop quiz – name that structure
Loading and saving external data
Querying a URL
Reading and writing to a text file
Using another stack to store data
Time for action – creating a data save stack
What just happened?
Pop quiz – other special places
Creating a web scraper
app
Time for action – setting up the tab navigation
What just happened?
The Browser card
Time for action – adding the browser controls
What just happened?
The Links card
Time for action – making a links extraction function
What just happened?
The missing links
One more thing…
Time for action – adding the links card's init handler
What just happened?
The Text card
Time for action – setting up the Text card
What just happened?
The Media card
Time for action – extracting a list of media links
What just happened?
Time for action – setting up the Media card scripts
What just happened?
The Keepers card
Time for action – setting up the Keepers card
What just happened?
Have a go hero – add some preset locations
Summary
5. Making a Jigsaw Puzzle Application
Image data format
Mystery byte…
Misusing imageData
Time for action – testing a getPixel function
What just happened?
Pop quiz – how many bits in a byte?
Simulating lots of buttons
Time for action – making a map of the United States
What just happened?
Pop quiz – getting the big picture
Using maskData for collision detection
Time for action – making a racecourse
What just happened?
Time for action – making a racecar
What just happened?
Pop quiz – calculate this!
Making a jigsaw puzzle
Going to pieces…
Time for action – creating the pieces and choosing an image
What just happened?
Time for action – transferring imageData
What just happened?
Adding interactivity
Time for action – setting up touch events
What just happened?
Have a go hero – one for the kids
Summary
6. Making a Reminder Application
Different types of reminders
Timing of notifications
Date and time pickers
Time for action – creating date and time pickers
What just happened?
Pop quiz – OA (odd acronyms!)
Where?
Time for action – trying out native location tracking
What just happened?
Calculating the distance between two points on the Earth
Pop quiz – what floor is my apartment on?
Information needed in a reminder
Making the reminder app
Laying out the cards
Time for action – creating the reminder app screens
What just happened?
Stack-level scripts
Time for action – adding stack-level functions
What just happened?
Home card scripts
Time for action – making the home card buttons work
What just happened?
Creating a location card
Time for action – making the location card work
What just happened?
The reminder entry form
Time for action – taking in information about the reminder
What just happened?
Have a go hero – nice transitions
Summary
7. Deploying to Your Device
Standalone application settings
The General section
The Stacks section
The Copy Files section
The iOS section
The Build for section
Basic application settings
Icons
Icon tools
Splash screens
Orientation options
The Custom URL scheme
Requirements and restrictions
A status bar
Android
Basic application settings
Requirements and restrictions
Application permissions
User interface options
Building Apps for Beta Testers
Sending an Android app to testers
Preparing an iOS app so that it can work on someone else's device
Using over the air
installers for iOS
AirLaunch
BetaBuilder
TestFlight
Using over the air
installers for Android
Google testing
Amazon testing
Samsung testing
Creating an app store submission file
Finding and using the Android Keytool application
Creating a distribution certificate for iOS
Uploading to the app stores
What's similar
What's different
Bottom line
Summary
A. Extending LiveCode
The story so far…
Extending LiveCode
MobGUI
tmControl
The DropTools palette
mergExt
animationEngine
AirLaunch
The ControlManager IDE
Creating your own add-ons
Custom controls
Externals
Open source
Quality control
A New World of Extensions
Inside extensions
LiveCode Builder
Additional constructs
Packages
Modules
Roadmap
Index
LiveCode Mobile Development Beginner's Guide Second Edition
LiveCode Mobile Development Beginner's Guide Second Edition
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: July 2012
Second published: May 2015
Production reference: 1250515
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84969-965-5
www.packtpub.com
Credits
Authors
Colin Holgate
Joel Gerdeen
Reviewers
Randy Hengst
Akinori Kinoshita
Jane Wilson
Commissioning Editor
Mary Nadar
Acquisition Editors
Vivek Anantharaman
Mary Nadar
Content Development Editor
Rohit Singh
Technical Editor
Aman Preet Singh
Copy Editor
Neha Vyas
Project Coordinator
Mary Alex
Proofreaders
Stephen Copestake
Safis Editing
Indexer
Monica Ajmera Mehta
Production Coordinator
Nilesh R. Mohite
Cover Work
Nilesh R. Mohite
About the Authors
Colin Holgate was originally trained as a telecommunications technician in the Royal Air Force, but with the advent of the personal computer era, he transitioned to working as a technical support engineer for companies, which included Apple Computers, UK.
In 1992, he moved to the US to become a full-time multimedia programmer working for The Voyager Company. In that role, he programmed several award-winning CD-ROMs, including A Hard Day's Night and This Is Spinal Tap.
For the last 17 years, Colin worked for Funny Garbage, a New York City-based web design company. In addition to using Adobe Director and Adobe Flash for online and kiosk applications, he has used LiveCode to create in-house and client production tools. At the RunRevLive Conference in 2011, Colin entered and won a contest to create a mobile application made with LiveCode.
Joel Gerdeen obtained a PhD in engineering mechanics and biomedical engineering from Iowa State University, where he started using computers in experimental research. In his first employment as a structural analyst, he developed software to assist other engineers to graphically model heavy machinery. His support of engineering computer usage transitioned into a career of software project management at FMC, Honeywell, and BAE Systems, all of which were Fortune 100 companies. Joel has experienced computing evolution from loading machine code through switches on a DEC minicomputer to booting a Raspberry Pi from a microSD card. He has worked with microprocessors, timesharing, personal computers, mainframe business systems, and latest mobile devices.
After 35 years of employment, Joel ventured into mobile software development in 2010, working with a small start-up company and publishing numerous apps on both Apple and Google app stores. After working with separate iOS and Android development environments, he discovered LiveCode and was able to build on his former HyperCard experience. Joel is also active in the mobile development community in Minneapolis and has presented LiveCode at local conferences.
I would like to thank the LiveCode staff and all its active users who have provided a treasure trove of experience through examples, lessons, and discussion groups. I'd like to especially thank the original author, Colin Holgate, for the first edition that helped me learn LiveCode and for the experience I gained in coauthoring this edition.
About the Reviewers
Randy Hengst is a long time educator. He began his career in 1975 as a 6th grade science teacher and subsequently taught 4th grade. He has also worked as a building-level administrator in middle and elementary schools. He was a middle school assistant principal when the first Apple II lab was placed in the school building. As an elementary principal, he helped a handful of 6th grade students learn to use HyperCard. He earned a PhD in 1990 and has worked as a teacher since 1993 at Augustana College, Rock Island, IL. There, he introduced the teacher candidates to scripting within HyperCard and HyperStudio. His current projects are all developed with LiveCode for iOS and are designed to support a collaborative program with a local elementary school, the Number Sense Project. In this project, elementary education majors work with college faculty and kindergarten teachers to design and implement lessons designed to facilitate the kindergarteners' sense of numbers. The elementary education majors and kindergarten teachers regularly make suggestions to create new and modify existing apps. Refer to the apps at http://www.classroomfocusedsoftware.com/numbersense.html. Also, you can read more about the Number Sense Project at http://www.augustana.edu/numbersense/index.htm.
Akinori Kinoshita holds a bachelor's degree in electrical engineering from Purdue University and a master's degree in business administration from National Taiwan University. Besides his work, he actively participates in the free, libre, and open source software (FLOSS) art movement. He takes workshops on Processing, (fluxus), and SuperCollider for artists and nonprogrammers in Taipei, Taiwan.
I would like to thank my father, mother, and sisters for their support. Without them, I wouldn't be here.
Jane Wilson is a web developer with a master's degree in user experience engineering and a bachelor's degree in applied computing from University of Dundee. Currently working in Dundee, she also writes for Geek Scot, a technology news site focused on Scotland.
www.PacktPub.com
Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
Preface
Everyone you know has a smart mobile device of some kind. You probably own several too! The general idea of having utility applications on a phone is not new. Even cell phone and PDA games have existed for years, but the way that iPhone used touch instead of a stylus or keyboard and the way it used gestures to reduce the number of steps to do something was a game changer.
iPhone was released in June 2007 and the Android OS was released in September 2008. If you wanted to create something that worked on both platforms, you'd had to learn two development environments and languages: Objective-C for iPhone and Java for Android.
In the desktop world, there are several development tools that allow you to publish apps on both Mac and Windows as well as Linux in the case of LiveCode. The most successful of these tools are Adobe Director, Adobe Flash, Unity, and LiveCode. Publishing apps to iOS was introduced with Adobe Director 12, which means that all four tools are also suitable for mobile development.
These tools have different strengths; in some cases, the strengths relate to the nature of the applications you can make and in other cases, they relate to how accessible the tool is to people who are not hardcode programmers. If you want to make a high-quality 3D game, Unity would be the best choice, with Director and then Flash as other choices. If you need a lot of character animations, Flash would be the best choice, Adobe Director being a good alternate.
If the most important thing for you is how approachable the tool is, then LiveCode wins easily. It's also a valid choice to make the majority of apps you might wish to make. In fact, for apps that are a set of single screens, as would be the case for most utility apps as well as board and puzzle games, LiveCode is better suited than other tools. It also has better access to native interface elements; with the other tools, you usually have to create graphics that resemble the look of native iOS and Android controls instead of accessing the real thing.
With its easy-to-use near-English programming language and the stack of cards metaphor, LiveCode lets you concentrate more on creating the app you want to make and less on the technicalities of the development environment.
What this book covers
Chapter 1, LiveCode Fundamentals, introduces you to the LiveCode environment and to its near-English programming language. Experienced LiveCode users can skip this chapter, but for someone new to LiveCode, this chapter will take you through the process of creating a simple calculator app as a way to make you familiar with the various tools and hierarchy of LiveCode.
Chapter 2, Getting Started with LiveCode Mobile, describes in detail how to set up your Mac or Windows computer so that you are ready to develop and publish mobile apps. This chapter will take you all the way through from signing up as an iOS and Android developer to creating and testing your first LiveCode mobile app.
Chapter 3, Building User Interfaces, shows how to use some of the standard mobile features, such as date pickers, photo albums, and a camera. This chapter will also show you how to make your own buttons that have an iOS-like look to them and how to use the LiveCode add-on, MobGUI, to make your life easier!
Chapter 4, Using Remote Data and Media, discusses the structure of your apps, where to place your code, and how to read and write to external text files. Here, we will also create a mobile app that is a web scraper
capable of extracting links and media from a web page to show or play media from that page.
Chapter 5, Making a Jigsaw Puzzle Application, will show you how to process image data and how to use the information to create a color picker, detect regions, and to make a collision map. We will then create a full jigsaw puzzle application that takes its image from the photo album or device camera.
Chapter 6, Making a Reminder Application, examines which information is needed to represent a reminder
and how to set up notification events so that you are alerted at a specified date and time. Here, we will make a reminder app that can create a list of such events and even list those events based on your current location.
Chapter 7, Deploying to Your Device, is a reference chapter that describes all of the mobile publishing settings. This chapter also shows you how to send apps to beta testers and how to get started with the submission of your finished app to various app stores.
Appendix, Extending LiveCode, describes add-ons to LiveCode that will make your mobile apps look better or will extend the mobile capabilities of LiveCode. The planned LiveCode builder and widget capabilities of LiveCode's Version 8 are introduced as well.
What you need for this book
In addition to Community LiveCode 7.0 or its later versions, you will need a Mac or PC, iOS and/or Android devices, and some money