Tag: iOS

Useful marcos for iOS dev

#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

e.g.: view.backgroundColor = UIColorFromRGB(0xF4F4F4);

My Mobile Map app dev replay

I built my iCrimeWatcher iOS app last year, based on core-data sync with back-end API. Later on,┬áin December 2012, I decided to move on to Android market. My original plan was to get this app clone quickly done, so I picked Titanium. Things went pretty well, at first, at least during the development period, until finally I’ve reached distribution phase, something ugly drove me nuts.

The biggest shock is that Google Map Android App API V2 was released during my development time, and the old V1 discontinued right away. The end result is my app doesn’t work, kind of, at least not in distribution mode, old Titanium SDK still works OK in developer/debug mode.

Obviously Titanium SDK was catching up with the latest Google API V2, which is common for all the cross-platform solutions. My plan was postponed, nothing to do but wait.

Another ugly part is that V2 API only runs on physical device, I was forced to buy a Nexus 7 to be able to continue.

Two months later, this issue finally got fixed by Titanium team. I downloaded the V2 compatible Titanium SDK immediately to try out. Map displays perfectly in my app, except, the click event on pin popup randomly kill the app. Searched around, people are having the same issue, Titanium team has no solution/fix yet.

Time to move on, I retired Titanium, switched to native java Android app build. Not that hard to follow. Only after 3 weeks my java based CrimeMap Android app is published on Google Play Store, development time is almost same as Titanium, but no issue at all in distribution phase. The only tricky part is to get the right sha for distribution key, but the google doc has very details instruction on this. It’s much easier to follow, considering back to in Titanium mode, that key file in fact was in different place.

Research shows that BB doesn’t have Map engine. No bother. But I’m very surprised that Kindle Fire doesn’t have Google Map library embed either.