The 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 = Titanium.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, filename); file.write(imageBlobData); // saving the full nativePath to the DB myModel.set(‘filepath’, file.nativePath); myModel.save(); console.log(file.nativePath); Unfortunately, you cannot count on the nativePath… Read More »

Automating 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 have manual steps in your release process. People screw up. We use the awesome Installr service to distribute iOS and Android test… Read More »

Don’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. Nor was memory being exhausted. Listening in on the ImageView’s error event showed no errors being reported. It wasn’t… Read More »

CommonJS 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, alternative. CommonJS modules are a standardized way to create an easily reusable object. These modules can provide… Read More »

Resolution-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 possibilities and frankly, was totally unnecessary. In the end, I replaced 30 or so lines of if-then… Read More »

Easy 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. — Tim I’ve started using the blazing-fast Genymotion emulator for my Android development. Unfortunately, the Titanium/Appcelerator tooling doesn’t support directly… Read More »

Custom 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 home screen as “My Cool App”. We can do the same thing for a Titanium Android app,… Read More »

iOS 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. Renaming Titanium projects is possible, though a bit tricky. There’s an easier way to solve these problems:… Read More »