Scaling the Android emulator
You can resize a running Android emulator by setting the window’s scale factor. You’ll need to telnet to the running emulator. Then, just enter the window scale command. Enter telnet localhost...
View ArticleIs your Titanium app running on a tablet?
On a recent Titanium Mobile project, I found my app’s layout got all screwy when running on an Android tablet. To be more precise, on 10-inch class tablets (like the Xoom or ASUS Transformer), buttons...
View ArticleADB hung? Restart it without closing the emulator
I find that occasionally adb loses touch with the fact that an emulator is running. I build my project only to get an error that adb timed out waiting for the emulator. I used to close the emulator,...
View ArticleWeb site relaunch
I’ve set up WordPress as part of an overall site refresh. I migrated a few of my past Tumblr posts, the ones that were worth keeping. Much of my former site’s contents are gone. Sorry for the 404s but...
View ArticleDelete a member of an array
Here’s a quickie: Need to delete a member of an array in JavaScript? The traditional way is with the splice() method. Here’s an alternative using filter(): var deleteFromArray = function(array,...
View ArticleSplit window editing in TiStudio
Yes, you can edit the same file in two tiled windows in Titanium Studio! Today I figured out how to do this and whipped up this short tutorial video just for you.
View ArticleSee the Mac Console for full error details
I got a (probably not so) bright idea about how to do a bulk update of my app’s database as part of a version upgrade. I could generate a SQL file containing all the statements that needed to be run by...
View ArticleTitanium graphs with a WebView
Got data to graph in Titanium? On its own, Ti doesn’t provide a graphing component. There is an iOS-only module in the Marketplace. But if you also need to support Android or want other graph types,...
View ArticleBreakpoint debugging an Alloy app
Today’s tip came out of a chat I had with the brilliant Aaron Saunders (@aaronksaunders). Thanks Aaron! First, a little backstory. Appcelerator’s new Alloy framework provides an MVC-like development...
View ArticleiOS app names in Titanium projects
Ever want spaces in your Titanium iOS app’s name? Did you start a project with one name, but then want to change it? When you create a new Titanium Mobile project, you cannot enter spaces in the name....
View ArticleWorking with databases created by the iOS Simulator
Quick post for today, but a tip I find indispensable. When working with a database-driven app, I often find the need to directly access the database — to confirm that queries worked, to examine the...
View ArticleCustom app names in Android projects
A few weeks back, I showed how you can tweak the name of your Titanium iOS app. By using the internationalization (i18n) feature of Titanium, I was able to configure an app named TestApp to show on the...
View ArticleEasy Genymotion builds with Ti 3.2 RC
Update: An hour or so after I posted this, Appcelerator posted an entry on their Developer’s Blog describing how to use Genymotion with the 3.2 CLI. I encourage you to check out that official solution....
View ArticleResolution-specific graphics in Titanium
Working on an app the other day, I came across some complex logic for selecting which graphics to show on an iPhone 5 vs. an iPhone 6 vs. and Android device. While it worked, it didn’t capture all...
View ArticleCommonJS modules instead of globals
When you need a value or method to be available in various places in your app, the temptation to use a global variable can be hard to resist. You should resist! Besides, there is a good, and easy,...
View ArticleUpdate a ‘Waiting for Review’ app and keep the version number
Recently, I submitted an app update to Apple only to find a bug that really needed to be fixed before it got to customers. However, I wanted my new fix to use the same version number I had already...
View ArticleDon’t create variables you don’t need
We were having a problem in our app where occasionally photos would load only partway. You’d see the top portion of the photo and the rest would be white. In testing, I was not seeing network errors....
View ArticleAutomating Titanium builds with Grunt
OMIGOSH, I submitted our app to Apple with it pointing to our development endpoints, not production! Stupid mistakes like this are the stuff of developer nightmares, and they can easily happen when you...
View ArticleThe right and wrong way to save file paths in Titanium
If your app requires you to save files, perhaps photos that the user snapped using your app, your first thought might be to do something like: // don't do this: var file =...
View ArticleMultiple exceptions for iOS 9 App Transport Security
As you’ve surely heard by now, Apple is requiring secure network connections (https). This requirement will apply to all newly-submitted apps for iOS 9, as well as updates to existing apps submitted...
View Article