Tuesday, November 25, 2014

LiveCode Mobile Development Cookbook





In K12 education today, the emphasis on teaching students and universal common set of learning standards, coupled with the ability to develop unique solutions to open ended problems lends itself to coding and computer programming. There are a plethora of apps and software tools that provide students with some of the fundamentals and programmatic thinking principles necessary for learning to code/program. However, these tools do a great job at providing the underlying thinking, but not so good a job of allowing learners to develop working applications ready for public distribution to the most common computer platform, mobile computing.

Edward Lavieri's new book, LiveCode Mobile Development Cookbook does a great job of supporting learners beyond the programmatic thinking and into real app development using LiveCode. The book does a nice job of scaffolding the learning from the initial configurations for developing, for both the iOS and Android platforms, all the way up to utilizing databases within your app for storing and retrieving data. The later chapters of the book focus on providing modules for standardized mobile user interfaces and for including multimedia components in your apps.

The book assumes some prior familiarity with LiveCode, but presents its content in manageable chunks, with easy to follow and well documented tutorials.

I would recommend this book for anyone ready to take their programming beyond the theoretical and into actual app development stage. This book easily supports a second tier coding/programming class, where students have mastered introductory concepts and are ready put that thinking to use in developing actual solutions.  (https://www.packtpub.com/application-development/livecode-mobile-development-cookbook)

Monday, November 10, 2014

Memory Game Built Using LiveCode



How good is your memory?

Here is a little LiveCode example project based on the old memory game that requires that you repeat a specific pattern. The game begins by clicking the start button and will continue incrementing up until you make a mistake. How high can you go? I pretty much bomb out at 7 or 8 steps.

This LiveCode example works both as a desktop application or as a iOS mobile application. The scripts/code for this project live in the “Start” button, the Card script, and the colorful game buttons: one, two, three, and four. The card script contains the CheckProgress command which determines whether the player is correct or incorrect. It also contains, essentially, a matching series of code that the desktop version of the Start button uses, but incorporates the iOS specific commands for mobile. If you compare the iOS code in the Card script, and the desktop app code within the Start button, you will notice some similarities.

The musical notes were created in Apple’s Garageband and saved as mp3 and wav files. The mp3 files are referenced from within the iOS package (they are included as individual files in the apps sandbox) in order to play and the wav files are imbedded into the application for playback in the desktop version. (MP3 files were converted to wav files using the OSX terminial application afconvert.) You will notice differences between the desktop code and the iOS mobile code.

Finally, to address different screen resolutions on both an iPad and an iPhone, it uses the “fullScreenMode function within LiveCode, a relatively new addition to the development tool, to make adjusting screen resolutions automatic. The application will automatically resize itself to fit within the devices screen resolution. It is one line of code within a preOpenStack call: set the fullScreenMode of this stack to “ExactFit.” That’s it.

The Memory Game project file is available here: Download .

Here is a short YouTube video explaining more about the process of creating the memory game example with LiveCode and a peak at the code:



Monday, November 3, 2014

Puzzle Pullooza App With LiveCode

This little puzzle example started out as a little Sunday evening mental exercise. How to create a simple puzzle activity that would work well as a desktop application and as a mobile application. As a result of that effort, I think this little project does a great job of showcasing some of the great features of creating mobile and desktop apps with LiveCode. There is actually a great little book by Colin Holgate, LiveCode Mobile Development, https://www.packtpub.com/application-development/livecode-mobile-development-beginners-guide, that I would recommend that gives another puzzle app example and much more. It’s an easy read and great way to introduce yourself to LiveCode.



Now, back to Puzzle Pullooza. The app is pretty basic in appearance and in its code. To begin, the majority of the code is in the stack script. Here is a Google Docs link where I have shared the code: Puzzle Pullooza Code . You can see from the Google Doc, the code is pretty easy to understand. I have attempted to comment each section of the code to explain what it does. But, you may be able to decipher what the code does without even understanding much programming.

In order to begin poking around the app and discovering how it works, I would recommend you download the free LiveCode Community version of the software, http://livecode.com/download/. This is the full version of LiveCode, but the OpenSource version. You can create apps, compile apps, and do everything you can with the commercial version, you just can’t sell what you create in the Apple App Store.

Once you have downloaded and installed the Community Version of LiveCode, you can download the Puzzle Pullooza app here: Download Puzzle Pullooza

Open it up and have a loop around!

The Puzzle Pullooza app showcased many of the nice feature built into the development tool. First is the ease at which code is written in the development tool, as I shared earlier. The coding features mirror many other development tools, but the plain language, and effort to create with LiveCode far outshine other development tools, in my humble opinion.

As with most applications under development, Puzzle Pullooza suffered from “feature creep.” It was very easy to take components others had shared in their projects and incorporate them into my app.

For example, I added a timer another LiveCode developers had shared online. There’s nothing like adding a stopwatch/timer to increase your level of urgency when solving a puzzle. There is also a very active LiveCode developer list, http://livecode.com/community/, and great Developer resources here: http://livecode.com/developers/.

I thought it would be neat to have folks share out on Twitter when they completed a puzzle. This component demonstrates how easy it is to build a custom web browser directly in your app. In this case, the web browser’s only purpose is to provide the twitter interface for posting to Twitter.

I’d encourage you to take a look at LiveCode. It is a great tool for students and those learning to code. The free Community Edition makes it a “no (cost) brainer.”