Tony Lukasavage

Caffeine. Whiskey. Code. Mostly the last one.

Appcelerator API Builder Demo

| Comments

For the last few months I’ve deviated from my usual Alloy duties at Appcelerator. I’ve instead been working on an internal project with Dawson Toth, Simon Murtha Smith, and Jeff Haynie (since he so quickly gets bored of being CEO). We’ve had a few names for it so far, but for the sake of this post I’ll refer to it as API Builder.

In short, it bridges the gap between app and API development, taking the functional links of the Appcelerator Platform and turning them into a powerful, cohesive chain. The following screencast is a (very early) preview where I’ll show you the following:

  • Creating an API against arbitrary data source(s)
  • Publishing that API to node.acs
  • Creating a secure, API-specific SDK for Titanium
  • Downloading and installing that SDK via Appcelerator Studio
  • Using that SDK to make API calls to the published node.acs endpoints

All of that done automatically, simply by defining your API in the Appcelerator 360 dashboard. Way more to come, not publicly available yet, so stay tuned.

F*ck You, Show Me

| Comments

Resolving bug reports is like trying to rescue developers lost on a desert island. Sometimes you get the privilege of rescuing the developer who started a signal fire you couldn’t possible miss, kindled by reproducible test cases and detailed specifics of their environment. They make the rescue easy and still thank you profusely for the aid. In the end, everyone involved is happy. But this isn’t always the case…

ti-mocha: Mocha testing support for Titanium

| Comments

The Appcelerator community has long been asking for a clear choice for unit testing. While many (including myself) have used Jasmine, I have over time gained preference for another. Mocha has quickly become my unit testing framework of choice for all node.js development, due to its stability, flexibility, and the consistently awesome work of its author, TJ Holowaychuk. There was one small problem.

Automata: Conway’s “Game of Life” using Appcelerator Titanium

| Comments

Get the source: Automata on Github

Every once in a while I like to engage in some wildly impractical coding experiments. You know the sort, the “Hey, I got Gentoo running on my toaster!” stuff. Today’s experiement was implementing Conway’s Game of Life using nothing more than Appcelerator Titanium views and deploying it to iOS. Let me explain a bit more why this is a ridiculous idea…

Web-based STL Viewing: Three.js, WebGL, and Javascript Typed Arrays

| Comments

Get the full demo: jsstl on Github

Recently Github announced that they were integrating a web-based STL viewer into their interface. The STL file format has become very well known as of late do to the growing popularity of 3D printing among makers. STL is the format of choice for most 3D printing devices and is as such the format used by almost all accompanying software. So whether you want to print, manage STL files, or convert them to some other format, you need to get to know them well.

Inspecting SQLite databases on Android and iOS

| Comments

One aspect of my current project, the Alloy MVC framework for building cross-platform mobile apps, is simple integration with local storage via SQLite databases. SQLite is a powerful and relatively simple way to store data for offline use, or just to cache remote data to speed up interactions. Unfortunately, the current data and structure of SQLite databases can sometimes be tricky to ascertain when housed on mobile devices, emulators, and simulators. This is especially true when developing for multiple platforms and having gone through multiple iterations of your data structure.

Flashback: My Old Away3D Experiments

| Comments

Back before before joining the Appcelerator team about a year and a half ago, I was working a typical 9 to 5 enterprise development job. While this was nothing more than a paycheck, it did afford me copious amounts of time to experiment on personal projects before I finally fell in love with cross-platform mobile development. My first true love in this experimental coding was interactive 3D using Flash and Away3D.

The Joys of Screen Scraping

Knucklehead Up and Running Again

For about a week there my MMA fighter app for Android, Knucklehead, has been out of commission. The reason is that the site that I scrape for data, Sherdog was completely redesigned. I needed to rework a lot of my PHP-based screen scraping code to make it work. My PHP is rusty, but fortunately, my regular expression chops are always sharp. In any case, it’s back to working order now.

Maybe with a little luck I can get people to re-rate those 1-star ratings I got while it was down. If not, perhaps I can guilt people into giving me good ratings by saying that it’s my newborn son’s fault I didn’t get to it sooner. I mean, really, are you going to give the father of this child a hard time? Don’t be so heartless. :)

Screen Scraping Tips

As we all know, screen scraping is pretty much the most volatile way to supply your apps with data. While no amount of planning can permanently future-proof your screen scraper, there’s some things you can do to make it easier.

  • Define a data model for what you are scraping. What made my project relatively easy to get working again was that I had a clearly defined data model shared by both the backend and frontend. In my case, this is a LAMP stack and distributed Android app respectively. Now my users don’t need to download a new version of my app in order to get the fix. It just works now.
  • Code the scraper on a backend proxy, not in the app itself. That way, when your scraper inevitably gets broken at some point (after a year in my case), you only need to change the code in one place. This goes hand-in-hand with defining a data model.
  • Keep it simple stupid. Don’t over-architect a screen scraper. Most data processing code will change over time, but a screen scraper may need a total rewrite at some point. Put all your software engineering skills into controlling what leaves the scraper, but play it pretty loose with what the scraper is going to be processing.
  • Using JSON? You better be using too. can save you a lot of time and aggravation when it comes to creating and processing your scraped data. Not only does it validate your JSON, but it will also pretty print it so it’s easy to read through yourself.

That’s just a couple things that made fixing my scraper a lot less painful. You guys out there have any tips? I’d love to hear them. All things being equal, I hope I never have to screen scrape for data ever again. But since that’s pretty unlikely, it’s good to be prepared for the inevitable obstacles that scraping will present.