LiveCode Mobile
Development
Beginner's
Guide
Create
fun-filled,
rich apps for
Android
and iOS with
LiveCode
Colin
Holgate
[
PUBLISHING
BIRMINGHAM-MUMBAt]
Table of Contents
Preface
1Chapter
1:LiveCode
Fundamentals 7Background history
andmetaphors
8You do have
LiveCode,
don'tyou?
9Learning
thelay
ofthe land 9Main windows 10
Timefor action-it'sa
drag,
butyou'll
like it!11
Creating
ahierarchy
13Stackstructure 14
Where codegoes 14
Timeforaction-
making
andnavigating
between cards 15Making
asimple
calculatorapplication
18Inspector
clues,
oh... 18Time for action-
making
the calculatorbuttons19
Verbosity,
synonyms, and "me" 20Adding
the card handlers 22Variable
types
in LiveCode 24Extending
the calculator 27Other interfacecontrols 28
Video
player
control 28Still
image
control 28Rollover buttons 28
Many
MoreControls... 30Debugging
30RunRev's online tutorials 32
Summary
32Chapter
2:Getting
Started with LiveCodeMobile
35
Table
of
ContentsBecoming
anAndroiddeveloper
36Android Market 36
Amazon
Appstore
40Downloading
the AndroidSDK 44Installing
AndroidSDKon MacOSX(Intel) 45Installing
Android SDKonWindows 46Pointing
LiveCode tothe Android SDK 47Becoming
aniOSdeveloper
49Installing
Xcode 57Pointing
LiveCodeto the iOS SDKs 59Beforewe canmakeourfirstmobile app 60
Getting ready
to testfor Android 60Timefor action-
starting
anAndroid virtual device 60Connecting
aphysical
Android device 61UsingaKindle Fire 61
Timefor action-
adding
a Kindle FiretoADB 62Getting
ready
to testfor iOS 64Timeforaction-
using
the iOS simulator 64Appiness
atlast! 64Time for action
-testing
asimple
stack in the simulators 65Time for action-
testing
asimple
stackondevices 66Further
reading
67Summary
68Chapter
3:Building
User interfaces 69Setting
upatest bed mobile app 70Timeforaction-
making
thetest bedstack 70Invoking
thedesktop
e-mailapplication
72Time for
action-calling
the native e-mailapplication
72Installing
the e-mail test ontodevices 72Timeforaction-
trying
testbed stackondevices 73Opening
a webpage 75Timeforaction-
calling
the native browserapplication
75Mobile-only,
datepicker
76Time for action-
showing
adatepicker
77Mobile-only, loading pictures
77Time for action-
loading pictures
78Making
OSstyled
buttons 79Using
bitmaps
80Timeforaction-
using Photoshop
to preparebutton states 80MobGUItotherescue! 83
Time for action
Test bed app, the MobGUI way 86 Time for action
-using
MobGUItomake a testbed app 86MobGUI native controls 88
Timeforaction-
using
native controls from MobGUI 89Adjusting things
for differentscreensizes 91Layout using
a resize handler 91Time for action
-simple
codelayout
example
92Layout using
the LiveCodeGeometry
Manager
93Timeforaction-
using
theGeometry
Manager
toposition
buttons 94Layout using
MobGUI 95Time for action-
using
MobGUItorememberlayouts for
us 95Further
reading
96Summary
97Chapter
4:Using
Remote Dataand Media
99Stackstructure 100
Code driven and
manually
createdlayouts
100Locations for code 101
Loading
andsaving
external data 103Querying
a URL 103Reading
andwriting
to atextfile 105Using
another stackto store data 107Time for action
-creating
adatasavestack 107Creating
a web"scraper"
app 110Time foraction-
setting
uptab
navigation
110The Browser card 112
Time foraction-
adding
the browser controls 113The Links card 114
Time for action -
making
alinksextractionfunction 115
Themissinglinks 118
Onemorething... 118
Time for action
-adding
the Links card "init" handler 118The Text card 120
Time for action-
setting
upthe Textcard 120
The Media card 121
Timefor action-
extracting
alist of media links 121Time for action
-setting
up the Media cardscripts
123The
Keepers
card 125Time for Action -
setting
up the
Keepers
card 126What now? 129
TableofContents
Chapter
5:Making
aJigsaw/
PuzzleApplication
Image
data formatMystery byte...
Misusing
imageData!
Timefor action-
testing
agetPixel
functionSimulating
lots and lots of buttons Time for action-making
a mapof the United StatesUsing
maskData for collision detection Timefor action-making
a racecourseTime foraction-
making
a race carMaking
ajigsaw puzzle
Going
topieces...
Timefor action-
creating
thepieces
andchoosing
animage
Timefor action-
transferring imageData
Adding interactivity
Timefor action-
setting
uptouchevents
Summary
Chapter
6:Making
aReminder
Application
159
Whatisa "reminder"?
When?
Date andtime
pickers
Timefor action-
creating
date and timepickers
Where?
Time foraction-
trying
outnative locationtracking
Calculating
the distance between twopoints
on EarthWhat?
Making
the reminders appLaying
outthe cardsTimefor action
-creating
the reminderappscreensStack level
scripts
Timefor action-
adding
Stack level functionsHomecard
scripts
Time for
action
-making
the Home cardbuttonsworkCreating
a location cardTime for action-
making
the location card workReminder
entry
formTime for action-
taking
in information about the reminderSummary
Chapter
7:Deploying
toYour Device StandaloneApplication
Settings
General 188
Stacks 189
Copy
Files 189iOS 189
Build for 190
BasicApplicationSettings 191
Icons 192
Splash Screens 193
OrientationOptions 194 Custom URL Scheme 194
Requirementsand Restrictions 194
StatusBar 195
Android 196
BasicApplication Settings 196
RequirementsandRestrictions 198
Application Permissions 198
UserInterfaceOptions 199
Building
Apps
for Beta Testers 199Sending
anAndroidApp
to testers 199Preparing
an iOSApp
sothat
itcanworkon someone else's device 200Creating
"overthe air" installers for iOS 202AirLaunch 202
BetaBuilder 203
TestFlightApp.com
204Creating
anapp storesubmission file 204Finding
andusing
the AndroidKeytool
application
204Creating
a distribution certificate for iOS 206Uploading
tothe app stores 208What's similar 209
What's different 209
Bottom line 209
Summary
210Appendix: Extending
LiveCode 211The
story
sofar... 211Extending
LiveCode 212MobGUI 212
tmControl 213
DropTools Palette
214mergExt
215Creating
your ownadd-ons 216Custom controls 216
Table