Archive | May, 2012

Arduino Companion 1.1

23 May

Arduino Companion 1.1

I just published an update to my Arduino Companion app to Google Play, Apple Appstore as well as Blackberry's App World. 

How's the app doing?

It's doing rather well I would say! Across the Google and Apple stores, it now has more than 20.000  140 000 (!) downloads. Not shabby, given that the only promotion I've really done for it is a single post at the Arduino.cc forums. I also don't really know what a good number is, but this isn't a game so it seems pretty good? It's also now listed as the number 1 app for the keyword Arduino in all the app stores, so I take that as some kind of compliment.

Based on feedback, the users really like the app. It has an average score of 4.6 of 5 on the Android Market and 4.5 of 5 stars on AppStore. On Market (or Play that it's called now) there's been three one-star reviews. These all complain about having to install the AIR runtime, so now I've skipped that by packing it all using the Captive Runtime capability. It's now a 10Mb download (rather than 1.6Mb) just because of those complaints. Oh well... User Power is for the good I guess?

I've also received a lot of positive feedback and it's been a great test at making view-based cross platform apps. I've done the project based on a simple framework that resides in it's own project for simple re-use, so making more apps should be fairly swift.

What's new?

I added the two most requested features from the more than 50 emails I have received from users: searching and internal linking. If a page is in the cached data, the app will now just open that page internally. Before I had this in place, all links in the reference went online to the original Reference-page. Now I check the URL requested against the cached URLs and only open the browser for those I don't have cached. The search will first search through all titles since that is usually what people want. Next it will search all the text of the cached content to look for hits there. The data is stored as XML, so it's super-fast to search that with e4x and AIR.

I've also added an omission from the last time. Many classes have an overview-page and now this one is also included. Due to the timing, I was also able to include the latest updates to the reference for the Arduino Leonardo that enables you to use the device for both receiving data from as well as controlling both keyboard and mouse. Can't wait till I get my first Leonardo board from ehobby.no so I can play with this! All versions now use Captive Runtime and if you make AIR apps, make sure you do too. Those 1-star reviews for a free product that you've worked hard to make are really hard to digest so just avoid them?

I've also fixed several minor bugs, but I can't seem to nail the one affecting certain Android tablets (including my own). I've tried asking my contacts at Adobe, but they've all failed to follow up and I don't want to push too hard...

Playbook difference

This is the first Blackberry app I'm publishing and It actually cost me a couple extra days just to get the app out for the Playbook. While compiling the AIR project for the QNX OS was more or less just the push of a button (as with Android and iOS), the app itself had a bug that only showed on the Playbook.

In the app, all listings are done in Flash but display of pages are rendered in the internal Webkit browser in the AIR runtime. The StageWebView worked flelessly on the desktop, Android and iOS, but on the Playbook it just showed a white page. I found lots of others that had the same bug, but no answers. In the end I figured out what was causing it and yeah - it was sort of my own fault. In the WebView, I capture clicks all on external linksso that I can show the internally cached version instead of the one that is online. In this handler, there was a "event.preventDefault()" that for some reason acted differently on the Blackberry device. All I had to do was to tweak the logic here and the app worked perfectly. Things like this is a little sad as it sort of breaks the advantage of having a platform that can target 3 different OS's across hundreds of devices with just one codebase.

Anyway the app is out on Google Play and the iOS and Playbook versions will come soon after (when approved) - enjoy the app!

ExpressionEngine: redirecting based on group_id

07 May

ExpressionEngine: redirecting based on group_id

Just a quick update - I've published a very simple plugin for EECMS that can redirect based on group_id. I made this so that admin users could go to one URL and members somewhere else after login, but you could use it in other ways as well. I also use it for basic redirection in a SAEF-based application based on EE, so it's good for that as well.

SAEF’s annoying default

02 May

SAEF’s annoying default

I love the Expressionengine CMS and these days I do a lot of projects with it. Today I lost an hour hunting for a stupid bug, due to a strange default. In my current project I needed a tooltip, so I did what I've done in dozens of projects before: I added jQuery + jQuery Tools at the top in addition to my own "ready-function" that would init the tooltip. It didn't work and it took me a long time to figure out what this error meant:

Uncaught TypeError: Object [object Object] has no method 'tooltip'

It looks like there's a problem finding the object, right? All the links I found led to things about the incorrect loading sequence of the Javascript files, but I knew that wasn't the fault here. I DID include the files in the right order. It worked standalone, but not in my EE templates. In other words - there had to be something inside EE that caused the problem? Strange!

A very nice module that I've only had a need for recently is SafeCracker (formerly called Stand Alone Entry Form or SAEF for short). It turns out - even if you don't use any features that require it, SAEF will include it's own version of jQuery and JQuery Tools? The code will be embedded at the bottom of your form, so even if you have everything in order at the top of the file, it'll be overwritten at the bottom. 

Fixing the problem is  as easy as adding a tiny snippet to your Safecracker tag

{exp:safecracker ...  include_jquery="no"}

This is 2012 and JS libs are updated on a weekly basis to fix browser bugs. Auto-incuding unrequested features based on outdated libraries is NOT the way to go (as default). Hope this post can help others to not spend time on this...