Wednesday, December 11, 2013

How to wrap your Macbook power adapter

This is simply genius. Finally a way to deal with that clumsy power adapter - http://lifehacker.com/the-best-way-to-wrap-your-macbooks-power-cord-1481120226

Friday, December 6, 2013

5 Tips for getting started with Sencha Touch

Here is a collection of things I wish someone told me when I was first starting with Sencha Touch.

  1. Take baby steps - Sometimes it's best to make sure that you have your layout hammered out before you create that inherited view with 37 tabs, a header toolbar, a footer toolbar, and multiple profiles for phones and tablets.

  2. Learn to use the chrome developer tools - OK, I know how to use the Chrome developer tools. Using them for Sencha is a slightly different matter. You have to know what you're looking for. For instance - newcomers to sencha create complex views and are baffled when they run the app and....nothing. They don't see a thing. If you inspect the HTML with Chrome, you should at least see your element's xtype. If you don't, that's a sign that you have a bad reference. If you see your view's xtype, but the height/width is 0px, that usually means that you gave it a layout but didn't properly specify the size.
  3. Don't overuse element IDs - This was a difficult thing to learn. I had previously been working with jQueryMobile and gave EVERYTHING an ID. This all worked in my initial, small scale tests. Once I ramped up with multiple instances of views and inherited views, this quickly caused problems. This is because every ID must be unique throughout the entire DOM and there isn't any real concept of scope. Instead of using element IDs, rely on using the DOM through the magic of Component Query. Component Query works similarly to jQuery selectors, except you can use an object's xtype as a means of finding it.
  4. Use the command-line build tools - You're going to use sencha cmd eventually when you package and deploy the application, so it's best to make sure that your application builds correctly. Not only will this identify issues with your code, but I've seen cases where one syntax works before building, but fails when the application is packaged. It's a tiresome process coming up with workarounds at the last minute.
  5. Organize your SASS - It starts off slowly, the app.scss file has one or two things in it. By the end of your project, it's a tangled mess and you've got elements scattered throughout it. SASS allows you to break your styling into multiple files and bring them in with the @import directive. One possible approach is to separate the styles into common layout, typography, theme, and view-specific files.
Do you have any other tips someone could use when starting with Sencha Touch? Add them in the comments section. Cross-posted from http://anexinetmobility.blogspot.com

Monday, November 4, 2013

Clearing the InAppBrowser cache on iOS with PhoneGap 3.1

One of the mobile apps that I've written has to access a remote site for authentication. This allows the client to make use of multiple factors for confirming a user's identity and also confirms to the user that they're passing their credentials to the right institution.

When the application was originally written, I made use of the ChildBrowser control. In order to make sure that we were seeing the right content only if the user REALLY has authenticated, we would use the ChildBrowser's clear() method.

I was recently asked to update the application to ensure that it didn't lag too far behind the most recent versions of the tools. Updating to Cordova 3.1/PhoneGap 3.1 involved getting rid of the ChildBrowser and moving to the InAppBrowser plugin. PhoneGap makes this plugin REALLY easy to integrate with your project. All you have to do at the command-line is to issue the following command:

cordova plugin add org.apache.cordova.inappbrowser

Unfortunately, once I changed the remainder of the calls around to work with the new interface, I found there was no method to clear the cache. There are options on the Android side of things that will clear the cache as well as the session cache, but nothing on the iOS side.

It didn't take too long to figure out, but here's what I ended up with:

All I added was the one-liner:

[[NSURLCache sharedURLCache] removeAllCachedResponses];
This article is cross-posted from the AnexinetMobility Blog

Wednesday, October 16, 2013

Ireland to close Apple tax loophole

Ireland to close Apple tax loophole http://www.independent.ie/irish-news/tax-avoidance-crackdown-pledged-29662222.html

Thursday, July 11, 2013

Listpaging in Sencha Touch with filtering

I just wrote a new article on Sencha Touch for the Anexinet blog. Instead of copying it verbatim on this blog, here's a link

Wednesday, May 22, 2013

Sencha Touch Split Window

Wow, almost a year since my last post. It's been a crazy time. I've been on multiple projects with super tight deadlines. As a matter of fact, I don't seem to recall a project with a loose deadline in the recent past. I've been working with Sencha Touch recently. There's a lot to love about the framework, but still enough annoyances. A recent requirement had me scrambling for a splittable view. This is what I finally came up with: