Friday, January 27, 2012

I'm waiting to hear back...

The last update fixes two issues, the first I realized there was a problem yesterday and I mentioned it on the g+ page.  There were a handful of Application Not Responding reports coming in and after a quick look yesterday, I realized that I committed a programming foul.  Typically, anything that's going to take a long time or anytime you're going out of the device to get something (picture, info, etc) you want to put it in a thread.  This way the thread can do it's thing and the main part application can continue doing it's thing.  I had done this in the past in a number of places (getting the image and weather just to name two).  However, I didn't think about doing this for all the new Yahoo! PlaceFinder web service calls that I mentioned in my Round up.  Depending on the device, the connection or traffic Yahoo! is receiving the reply from the web service might take too long and the OS displays that lovely "Something took too long" do you want to Force Close, Wait or Report dialog.  Most of the time, hitting wait will be good enough.  This is one of those things as a programmer that burns me as I know better, but since I don't deal with it often (or not at all for my 9-5 job) I just didn't think about it.

The other thing in this update should hopefully resolve the any future problems that Stu experienced.  Those problems frustrated him enough to leave this review.  Long story short, I found Stu's email from the purchase order and dropped him a line.  It seems (and I'm waiting for confirmation from Stu) that after the purchase of the dock extension is made 1) there's a lag between the purchase and the acknowledgement of the purchase 2) After the acknowledgement is received I'm not forcing a reload of the dock or any of the other stuff that needs to happen.  The simple fix for him should have been a Reboot or a Force Close of the app.

I believe that in the time between the purchase and the review, the app wasn't restarted and therefore the extension was never fully 'activated'.  The code change was relatively simple and hopefully other people who purchase the extension (and future extensions) will not have the same problems that Stu experienced.  My apologies to Stu and any other users who experienced the same kinds of issues.

Tuesday, January 24, 2012

Update Round-up

I've been neglecting the blog lately although I've been rolling out updates in a steady stream.  After the last post, I started digging into the static location feature.  Most of the people who sent email asked "can I just enter a zip code".  Well, that would work for the 70% of people that are in the US, but having received emails from all over the world (Chile, Australia, UK, Austria and Poland just to name a few), I didn't want a solution that would only work in the states (I try not to be a narrow minded American).   Recently, I discovered Yahoo! PlaceFinder.  In the same web service fashion as the weather, you generate a HTTP request with the information and it returns an XML file of location information. Some other additional nice things that go with it, is that if you provide it a common city name (Newcastle for example has 8 locations in the states, at least 3 in the UK and one in Australia).  It will return you a list of XML nodes that I used for a dialog.  You can also add in a locale which will only return the relevant locations for that locale.

I was more than halfway though adding the static location feature in when I noticed that I started getting a steady stream of force close reports.  It seems that I wasn't checking for a NULL value when getting the location which caused the app to crash.  Fixing the error was pretty simple, but I had already made a number of changes that would need to be rolled back to release just the bug fix.  I decided to just plow though the finishing static location as I thought that would be faster.  All said,  I ended up getting about 45 reports in week from the last update until I got the error fixed.

Not sure when version was released, but it fixed the NULL force close issue and added in the static location which can be used Never, Always or when your location can't be found (back up).

Version was pretty much a maintenance release.  Just a number of little bugs (again from Force Close Reports) and other odds and ends that just needed to be cleaned up.

Version (the latest) big change was fixing a bug with the location loop up.  Emailing back and forth with Christopher D, I ended up discovering that my my location look up hierarchy wasn't working as expected.  The idea was to try to use this list (if enabled) to get the location :

  1. Static Location
  2. Location Based on IP Address
  3. Get current location 
  4. Get a cached location
  5. Get back-up location
  6. Location can't be found (give up)
The his phone had a problem was with getting the current location so it continued on to the cached location.  That was where I started to find all kinds of problems.  I ended up making a lot of changed to how the cached location works and what to do with it when it finds it.  All in all it was pretty much a product of the rushing to get the static location out to the market.

The other thing I wanted to note was that I did set up a Google+ page for the Desk Clock Plus.  I don't use Google+ on a personal level (or any other social media for that matter), so I'm really not sure how it's all going to work yet.  I figure, quick updates, support and I guess it is another way to get in touch with me.  It's an experiment so we'll see what happens with it.  

Thursday, January 12, 2012


I just quite didn't have time to post about yesterday's update and there's a bit of an overlap with the changes for today.  Yesterday's changes were some bugs reported by users.

The first one had to do with setting the Music button.  Apparently the ROM he's using has two different versions of Google Music installed.  It didn't matter which one he picked from the list, it always launched the older one.  I just had to adjust how I was finding and saving the intent.  While I'm thinking about the music button, over the life of Desk Clock Plus, there have a been a number of people who have emailed and said that music play {insert app here} doesn't show up in the list.  This has more to do with the other app than mine.  I'm trying to figure out what apps are registered to handle .MP3 files.

final String MP3_FILE = "/sdcard/media_api/music/SHORTMP3.mp3";
        Intent viewIntent = new Intent(Intent.ACTION_VIEW);
        Uri uri = Uri.fromParts("file", MP3_FILE, null);
        viewIntent.setDataAndType(uri, "audio/mp3");     
        Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);
        pickIntent.putExtra(Intent.EXTRA_INTENT, viewIntent);    
        startActivityForResult(pickIntent, MUSICPICKER);  

If the app isn't registered with the system to "view" a mp3, it doesn't show up in the list.  If anyone has a better way of doing this please let me know.

The other one which once again was reported by a pair of users with HP Touchpads saying that the display was way off.  Basically, the font sizes needed to be shrunk down the size of the font and weather icon to make everything fit.  Part of the major redesign when version 1.0 was released, all of the sizes, heights and widths were moved into one XML file.  This allowed me to very easily change everything to fit on to the Thouchpad.  Unfortunately, I didn't shrink the weather enough and the High/Low temp degree mark was pushed off the edge.  That was fixed in today's update...

So, the big thing for today's update is major improvement to finding your location.  Previously, I was relying on the last known location.  If I loop though everything and nothing knows where you're at then I'm forcing the device to update it's location.  I'm not 100% I'm happy with how all this works and it will probably be reexamined in the future.  Also, as it turns out the feature to use the IP address for the location wasn't working anymore (the web service I was using went away).  Fortunately, Yahoo had a replacement that I was able to use instead.

Finally, I also updated the "Immediate" time out to be more immediate.  As pointed out by Omniwolf in the comments, it was a little confusing / misleading.

Unless something comes up, I'm going to start on the static location tomorrow... Given the the changes I've made yesterday, I don't think that it's going to take me very long.

Monday, January 9, 2012

'Hide and Seek' or 'I'm not touching you'

I just pushed out version to the market this afternoon.  The big new feature is for Scrolling Dock users, you can now swipe up or down on the dock area to show or hide the dock giving you a little more clear space to enjoy your background.  There are also settings for the dock to "auto-hide" after a time period which also includes immediately (well, 15 second delay).

Also as per a suggestion from a user, there is now an option to dim the dark clock immediately as well.  Once again it's really a 15 second initial delay...  I figured you needed a short delay just to show the transition from non-dimmed to dimmed.  The other thing that is new for the dark clock is that the proximity sensor is now being monitored.  Typically the proximity sensors is located by the speaker at the top of the phone.  If the clock is dimmed and you wave your hand close by the sensor, the screen will un-dim for 15 seconds.  I figured that would be good for someone who wakes up in the middle of the night and wants to check the time.  This way the screen is only lit up for a short time instead of the five minutes (or more) for when the screen is touched.

I also linked the proximity sensor the the hidden dock as well.  If the dock is hidden and you trip the proximity sensor it will open the dock for 15 seconds.  This feature is a little more of a novelty, but the code was all there for the dark clock to do it and this program is a learning tool for me, so why not put it in?

The next thing up is the much requested "static" location for the weather... now that I know how to handle this for international locations.