a.k.a devgeeks

Software development in the minutes a day I have spare

In PhoneGap (in reality Cordova) 1.4.x some classes were deprecated in the effort to make it play nice as a component in an otherwise native app (as opposed to only being able to be the primary controlling view). This is causing some confusion when developers using this version try to use plugins written using those classes. Xcode is giving them warnings about the deprecation and making them worry.

The plugins affected are mostly those that pop up an entire native view controller over the top of the PhoneGap/Cordova app - EmailComposer, SMSComposer, Twitter and worst of all ChildBrowser.

The important thing to remember is that for now (1.4.x), although the methods are deprecated, they should still work just fine. They will warn you, but as a good friend of mine was fond of saying: “a warning is not an error”. The point of deprecation warnings are to warn you that what you are doing might go away some time in the future and to start thinking about a new way to do it.

AFAIK, the issue will be with the coming releases when the methods are actually removed (there is debate on if this should be soon… like 1.5 or 1.6… or wait for a major release like 2.0).

I am happy to update plugins and submit pull requests to the phonegap-plugins repo if the plugin is not being actively maintained or not overly complex. I have already submitted a pull request for an update to SMSComposer after someone asked for help in the PhoneGap IRC channel. As for any of the others affected, it might be that they will just use the deprecated calls until the upcoming plugin upgrade guide is ready I believe with 1.5.x.

In the case of most of the affected plugins, really all you should need to do is in the plugins PluginClassName.m file add in this initialization method just after ‘@implementation PluginClassName’ (note: this one might be optional, but most of the modern plugins seem to initialize self this way):

-(PGPlugin) initWithWebView:(UIWebView)theWebView 
{     
    self = (PluginClassName*)[super initWithWebView:theWebView];     
    return self; 
{

Then, where ever the deprecated ‘appViewController’ appears… change:

[[ super appViewController ] presentModalViewController:picker animated:YES];

to:

[self.viewController presentModalViewController:picker animated:YES];

This will make most of the basic plugins compile quite happily without warnings. Unfortunately… ChildBrowser not so much, but that plugin is far from simple. However, it is very popular so I am sure it will get some love before the deprecations truly take effect.

If you have any questions about this feel free to shoot me a message:

tommy AT devgeeks DOT org

The main reason it took so long to port the 4ZzZfm app from Objective-C to PhoneGap had nothing to do with PhoneGap, really. It had to do with adding new functionality at the same time that I had been wanting to add in for some time.

4ZzZfm has a program schedule that changes at the very least every quarter or so. There are also small things that change from time to time for various reasons. Up until this version of the app, changing that program information in the app has meant my updating the schedule manually, then updating the app and submitting a new version to the App Store.

Needless to say, this didn’t happen as frequently as it should have.

So for this version, it was important to me to have the guide be updated from within the app with no updates to the code required. Though getting there was a bit of a challenge, the current version of the app does indeed include that functionality. However, it had not actually been tested in a “live” environment… until today. :)

Today I pushed an updated version of the guide to the server and the app should automatically use that version the next time it starts up (though the background behaviour of iOS and Android mean that this might not happen unless you close it all the way or don’t use it for a given period of time… not entirely sure what all triggers the app having to start from scratch).

Anyway, it seems to have worked. If you or anyone you know has trouble with the app updating the guide, please let me know, but for now I am calling it a success.

If you haven’t already checked out 4ZzZfm and / or the app, it’s available for iPhone and Android now.

I have decided to move the blog to tumblr for a few of reasons.

  1. I was sick of managing the comment spam on the previous WordPress blog
  2. I was sick of managing the software/security updates on the previous WordPress blog
  3. I wanted an easy way to post to the blog when I was out and about on an iOS device using Markdown 
  4. I wanted to see how well Tumblr works for a blog with it’s own domain, etc
  5. I wanted to learn how to theme Tumblr 

So far it seems to be going OK. Some things are certainly easier (less maintenance, easier posting) but some things are more tedious (static “landing pages” for the apps, etc).

I will be updating the theme a bit at a time. Cleaning up the posts so the images are no longer coming from the previous WordPress blog, extending the theme to include comments/discussion/likes/etc and adding more social media integration (apart from just Twitter).

Feel free to shoot me an email if you think this is a good/stupid/pointless idea. ;)

Dear 4ZzZfm and lovers of the best community radio station ever

The 4ZzZfm iPhone app has been updated to version 3.0. This new version should always have an up to date Program Guide. It can now update the guide over the internet so it will no longer need an updated version to have a correct guide.

http://devgeeks.org/iphone-apps/4zzzfm-iphone

or on iTunes:

http://itunes.apple.com/au/app/4zzzfm/id359090535?mt=8

oh… and for those that have brought it up whenever the 4ZzZfm iPhone app is mentioned…

Meet the 4ZzZfm Android app!:

http://devgeeks.org/android-apps/4zzzfm-android-app

or on the Android Market:

https://market.android.com/details?id=org.devgeeks.fourzzzfm

So here we are. Almost four months to the day since I last posted about porting the 4ZzZfm iPhone app to PhoneGap, it’s finally awaiting review in the App Store.

A lot has changed from starting out to getting to this point. I’ll be writing a much bigger post about the whole experience (including my new-found hate for timezones and date math), but till then… I am just happy to see the back end of it. :)

Now let’s see if we can get past the approval process OK.

So for all my bemoaning about not having enough time to work on devgeeks work and mobile stuff in particular, I have had a career change of sorts and I am now going to pursue devgeeks as my full-time job.

This means I will be able to take on work as a mobile developer (as well as my more traditional web applications work).

I have set up the new devgeeks.com to this end. I will also continue with the open source plugin development that I talked about in my previous post. I am pretty excited about this change. Feel free to throw work my way so I can keep doing it ;)

It’s that time again. Time to update the 4ZzZfm iPhone app. Actually, it’s way past due… but this is the way things go sometimes.

Early on I attempted to use some of the “write your app in HTML/Javascript/CSS and deploy to iPhone” technologies, but at the time their acceptability by Apple for App Store distribution was in doubt, and I couldn’t get them to do what I wanted anyway. This meant I had to actually learn Objetive-C. Now let me just say that I really like Objective-C. The problem is that I am primarily a PHP developer so HTML/JavaScript/CSS feels more natural to me.

This has lead me to revisit the above-mentioned web technology options for iPhone app development. PhoneGap in particular seems to be both quite mature, used a great deal in apps in the App Store and quite extendable via plugins. This last part is the bit that has tipped it for me. Not only are there some great plugins available for PhoneGap, but it is quite easy to write your own plugins.

What this all comes down to is that I am going to try and re-write the 4ZzZfm iPhone app using PhoneGap and write whatever plugins I need along the way that aren’t catered for in PhoneGap’s core or plugins written by others.

I have already started on this process and I have the Audio Streaming classes written by the amazing Matt Gallagher (cocoawithlove.com) that I used in the original Objective-C version of the app (mostly) working as a PhoneGap plugin. The remote control events don’t work yet, and I am not sure that will be possible from a plugin anyway… that might require some hacking of the PhoneGap core. We’ll see. It needs some more work update: I have had the remote control events working fine. No core hacking needed. Then between updating PhoneGap and iOS something went wrong.

Another piece of functionality I need for the 4ZzZfm iPhone app is a volume control slider. In the Objective-C iPhone SDK that is implemented using an MPVolumeView (from the MediaPlayer framework).  This turned out to be a very easy to make into a PhoneGap plugin. Now one of the best things about PhoneGap is that it and its plugins are open source. PhoneGap and its plugins are developed by the PhoneGap community and available on GitHub. So I have decided to join GitHub myself and submit any plugins I create for this project that I think others might find useful. The first of these that have been added to the main PhoneGap plugins repository is the aforementioned VolumeSlider plugin. I am pleased as punch about this as it is my first real contribution to a modern open source project. Hopefully it is just the first of many more such contributions.

Wish me luck. Worst case I can always just stick with Objective-C.

So what we have here is a failure to communicate update…

Between moving house in September, the birth of my beautiful daughter Ivy in October and entering a new start-up phase at my “day job”… I just haven’t been keeping up with this blog.

I mean seriously.. the last post was about the Brisbanesounds app not having been approved yet. That app has long since been approved and is going quite well.

I can’t promise to do much better in the future, but perhaps I can at least update when an app has made it through the approval process next time :)

Apple say they are getting through 83% of new app submissions in 7 days… I guess Brisbanesounds falls in the other 17%

I guess all I can do is wait. I have probably been abnormally lucky with my quick turnarounds on the 4ZzZfm app so far. It’s probably just a lucky numbers game. I suppose I shouldn’t be worried. It would be much more serious if it was taking a long time once the review process actually STARTS… then I would be worried.

I have finally gotten my second app into the review process on the App Store.

It’s an app for the Brisbane Sounds project – http://www.brisbanesounds.com/