Book Image

LiveCode Mobile Development Beginner's Guide (2nd Edition)

Book Image

LiveCode Mobile Development Beginner's Guide (2nd Edition)

Overview of this book

Table of Contents (15 chapters)
LiveCode Mobile Development Beginner's Guide Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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 if you follow the parts about signing up as a mobile developer in this book! For iOS development, you will need access to a Mac OS for some of the steps and these steps also require it to be an Intel-based Mac.

Who this book is for

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.

Sections

In this book, you will find several headings that appear frequently (Time for action, What just happened?, Pop quiz, and Have a go hero).

To give clear instructions on how to complete a procedure or task, we use these sections as follows:

Time for action – heading

  1. Action 1

  2. Action 2

  3. Action 3

The instructions here often need some extra explanation to ensure that they make sense, so they are followed with the following sections.

What just happened?

This section explains the working of the tasks or instructions that you have just completed.

You will also find some other learning aids in the book. Take the following section for example.

Pop quiz – heading

These are short multiple-choice questions intended to help you test your own understanding.

Have a go hero – heading

These are practical challenges that give you ideas to experiment with what you have learned.

Conventions

You will also find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text are shown as follows: "The contents of the display field are stored in the currentValue variable and the last operator button you pressed (that is stored in currentCommand) is looked at, to see what happens next."

A block of code is set as follows:

on togglesign
  if character 1 of field "display" is "-" then
    delete character 1 of field "display"
  else
    put "-" before field "display"
  end if
end togglesign

Any command-line input or output is written as follows:

start using stack "utility stack"

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "In the Tools palette, click on the Edit tool (the top-right icon)."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.