Monday, June 18, 2012

Updated Speaking Engagements


I got some really positive feedback for my Adding Speech Recognition to Your Android Applications presentation that I did at AnDevCon III. I'm incorporating that feedback and I'm going to be giving the talk a couple of more times over the next two months:
In addition I'm going to be at PhoneGap Day talking about my side project Corinthian. Basically, Corinthian monkey patches a bunch of stuff that should work in the Android WebView and adds some extra UI elements as well.
If you are going to be in or around those cities on those dates ping me on twitter and we'll see if we can arrange a meet up.

Friday, June 8, 2012

Books I've Read This Week

I decided to read Horns by Joe Hill since I'm a huge fan of his graphic novel series Locke & Key that he writes with Gabriel Rodriguez on art duties. While Locke & Key is a horror/suspense book it did not adequately prepare me for how disturbed I would be by Horns. I mean, I liked the book and everything but it did creep me out. I enjoy suspense novels but there was just something extra here that gave me the heebie jeebies.

In the novel we follow the journey of Ig Perrish a year after he was rightly/wrongly accused of brutally murdering his long time girlfriend. The Ig of a year ago was a saint as we discover through flashbacks but now he is literally becoming the devil complete with horns growing out of his head.

Let's just say that this novel is full of "bad things happen to good people" which makes it painful to read at times but ultimately satisfying. 

Wednesday, June 6, 2012

PhoneGap Android Application Preferences Plugin

So I'm working on a side app that I get to touch about once a month for about 15 minutes and one of the things I ran into is that I need a way to store user preferences. Well I realized that I could build my own HTML page and store the data in localStorage but I wouldn't learn anything new that way. In the end I decided to do a plugin that would allow PhoneGap developers to use Android Application Preferences and I modelled it after the existing iOS plugin by originally by Tue Topholm (Randy McMillian ported it to the updated Plugin API on iOS).

First if you are unsure about how application preferences are setup on Android go read this tutorial and then come back I'll wait. Oh great, your back. Let's crack on with things.

Functionality

Okay, so the application preferences plugin will provide you with four methods that you can use to interact with the native Android preferences.

get(key, success, fail)

If the key exists in the preferences it will be returned as the single parameter of the success callback that you provide. If the key does not exist the failure callback will be executed with an error object with error.code set to 0 which means no property.

    window.plugins.applicationPreferences.get(key, function(value) {
        console.log("The value is = " + value);
    }, function(error) {
        console.log(JSON.stringify(error));
    });

set(key, value, success, fail)

If the key exists in the preferences then value will be saved and your the success callback will be executed. If the key does not exist the failure callback will be executed with an error object with error.code set to 0 which again means no property.

    window.plugins.applicationPreferences.set(key, value, function(value) {
        console.log("set correctly");
    }, function(error) {
        console.log(JSON.stringify(error));
    });



load(success, fail)

Calling load will have the native side loop through all the preferences creating a JSON object that will be returned as the single parameter of your success callback.

    window.plugins.applicationPreferences.load(function(value) {
        console.log("The object is = " + JSON.stringify(value));
    }, function(error) {
        console.log(JSON.stringify(error));
    });


show(activity, success, fail)

Calling show passing in the class name of your PreferenceActivity class will cause the native Android GUI to be shown so your user can interact with the preferences. If the class name you pass in doesn't exists your failure callback will be called with an error object with error.code set to 1 which means no preferences activity.

    window.plugins.applicationPreferences.show("com.simonmacdonald.prefs.QuickPrefsActivity");

which brings up a GUI that looks like this:


Installation

Installation of the Plugin follows along the common steps:

  1. Add the script tag to your html:
    <script type="text/javascript" charset="utf-8" src="applicationPreferences.js"/>
  2. Copy the Java code into your project to the src/com/simonmacdonald/prefs folder.
  3. Create a preferences file named res/xml/preferences.xml following the Android specification.  
  4. Finally you'll need to create a class that extends PreferenceActivity in order to be able to view/modify the preferences using the native GUI. Refer back to the tutorial I mentioned for more details. 
That's about it. Give the plugin a try if you need to store native preferences and let me know what you think.

Oh, and I'm pretty sure that Darren McEntee has already included this plugin in his Live Football on TV app which means this plugin is already in the wild.

Enjoy!

Friday, June 1, 2012

Books I've Read this Week

Okay, it's been a long time since I've done one of these. You take a couple of week break while on vacation and then the next thing you it is 2 months later.


The Night Circus by Erin Morgenstern is a rocking good story which conjures up remembrances of Ray Bradbury stories I'd previously read. The novel centres around a contest between two young magicians named Celia and Marco. It is a very imaginative little romp as the two magicians compete against each other while falling in love.
A Discovery of Witches by Deborah Harkness was not what I was looking for after reading The Night Circus. It is another supernatural love story but it is not handled as deftly as The Night Circus and reading the two books back to back definitely cast A Discovery of Witches in a poor light. Seriously though, what do women see in vampires? When did they start becoming boyfriend/husband material? They are the undead people!

Tuesday, May 22, 2012

Association of Coffee Drinking with Total and Cause-Specific Mortality

It's been awhile since I've posted about coffee but this study is too good to pass up. The conclusion of Association of Coffee Drinking with Total and Cause-Specific Mortality by the New England Journal of Medicine states:
"coffee consumption was inversely associated with total and cause-specific mortality. Whether this was a causal or associational finding cannot be determined from our data."
In other words coffee is good for you. They can't seem to pin it down but people who drink coffee are less likely to die from a wide variety of issues.

Wednesday, May 9, 2012

An Open Letter To Bell Mobility

Here is my unedited email I've sent to Bell Mobility today to complain about how they treat customers. Honestly, if any company out there is giving you good customer service you should praise them to the tops of the mountains. I really loved the fact that Samsung replaced my phone out of warranty last year but we'll see what happens this time around.

BEGIN
Hey,

In a nutshell this is my problem. I have a Samsung Galaxy S Captivate and it is stuck in a reboot loop. It boots up the Samsung screen and then you get the flash stylized S screen then reboots. This sequence continues to repeat itself until I pull the battery out of the back of the phone. I had this problem occur last October while I was attending a conference in San Francisco last year. When I got back to Ottawa and phoned Bell the representative told me they could do nothing as the phone was one week out of warranty. I don't want to even get into the debate of signing people up for 3 year contracts when the physical device won't last the three years. That is for another rant. Luckily Samsung was able to step up and provide me a replacement phone for which I'm eternally grateful for.

Now here we are 6 months later and the problem has re-occurred. I know this is a Samsung problem with their phone but where Bell has fallen down is in their response to helping their customer resolve the problem. I shouldn't have to go to Samsung to resolve this issue. I have a business relationship with Bell, I pay Bell $100 a month for my phone/data service not Samsung.

When the problem occurred last night I was in the Carlingwood Mall here in Ottawa. I went to the Bell store where two customers were being waited on and two more were in line in front of me. After waiting 10 minutes I decided to go get my haircut and come back to see if the line has lessened. Fast forward 15 minutes to which I returned to the Bell store and the same two customers were at the front counter and the same two customers were in front of me. I then waited another 15 minutes before I got to the front counter where a representative could help me.

Going in a knew the rep would not be able to fix my phone. My alternative solution was to purchase a micro-sim card and have my current number activated on that card. The cost would be $5 for the micro-sim, no biggie, but $35 to activate the SIM. Seriously!?! I'm not trying to game the system here, I just want to be able to use my service on another phone while I send my busted Samsung off to be fixed. Thanks for being so unhelpful.

I really feel that Bell missed an opportunity to make an existing customer happy and possibly if good customer service was provided convince me to switch my home phone/internet/TV to Bell.

Anyway that is my tale of woe.

Simon Mac Donald

END


To be fair here is the response from Bell.


BEGIN



Hello Simon and thanks for the email.

Every phone you purchase comes with a year manufacturer’s warranty and you have the option to purchase the phone insurance at $7 per month at the time of purchase.

If you wish to activate your old phone, please purchase the sim card at any Bell store, if you haven’t yet, and I will go ahead and apply a credit for $35 in order to waive the activation fee.

Please let us know when you would do this and the mobile number in question, as well as the type of equipment being activated.

Thank you and have  a great day.


Bell Twitter Support.



END


and finally my email to them.


BEGIN



Sure, I will take you up on your offer to waive the $35 activation fee. My cell phone number is xxx-xxx-xxxx, I will be activating an iPhone 4 and I probably won't be able to get to this until I get back from San Francisco late next week. In the mean time I'm using a different phone that doesn't require a micro-sim.

Just because I can't resist. Wouldn't this have been better if the customer agent at the Bell store have offered to waive the fee? To me that would have been better customer service and I wouldn't have taken to the internet to complain. Rather I'd have praised Bell for making the transition easier.

Simon Mac Donald


END

Tuesday, May 8, 2012

Speaking Engagements

Over the next few months I'll be making the rounds doing my Adding Speech Recognition to Your Android Applications presentation. If you've ever wanted to see someone attempt to entertain and inform a crowd and not worry if they are crashing and burning then you'll want to pop by and see me at:

  • AnDevCon III - San Francisco, May 16th
  • Ottawa Android - Ottawa, June 20th
  • OSCON - Portland, July 18th
  • PhoneGap 2.0 Day - Portland, July 20th (To Be Confirmed)
If you are going to be in or around those cities on those dates ping me on twitter and we'll see if we can arrange a meet up.