Thursday, July 16, 2015

Apple Watch Tips and Tricks

Here are some quick tips that I have found helpful regarding the Apple Watch.


  • The first thing I did was turn on Silence Mode.  On the Apple Watch just swipe up to view glances and then swipe to the leftmost glance and tap on the Bell icon.
  • Turn on the Prominent Haptic feedback which will give you a strong tap before most notifications are displayed.  Using the Apple Watch app on the iPhone go to My Watch > Sounds and Haptic and toggle the Prominent Haptic switch.  Turn up the Haptic Strength while you are in there.
  • Turn on Bold Text, this will make it easier to read some stuff. Using the Apple Watch app on the iPhone go to My Watch > General > Accessibility.  Toggle the Bold Text option.  I don't like a lot of motion or transparency so you might want to turn that off while you are in there too.
  • Enable Apple Pay.  Using the Apple Watch app on the iPhone go to My Watch > Passbook & Apple Pay to add any credit or debit cards you have.
  • Remove any Watch faces you don't like.  After a couple weeks of use I found I only used three of the watch faces, so I deleted all the other watch faces so it was easier to switch.  From the watch face do a Force Touch and then swipe up on the watch faces you don't want to delete them.  You can always add them back by using the "New" face functionality, which is the last face on the right.
  • Try using Force Touch all over the place because you never know when some secret options or features will show up.  For example, doing a Force Touch on the notifications screen will allow you to clear all notifications at once.
  • If your digital crown gets hard to spin it is probably because some dirt or sand has managed to muck it up.  The quick fix is to go to the sink, turn on a slow stream of warm water, place the crown under the water and spin it back and forth for about 10-15 seconds.  Afterwards dry it off and it will be spinning like new.


Wednesday, May 20, 2015

FormItem Column Count Issue

I ran into a problem today when loading a Form component with a couple of FormItem children.  The error message said, "The Form must have form items with the same number of constraint columns". In an effort to hopefully save somebody time in the future, here is the reason this showed up.  

One of my FormItem children had a skinclass defined on it, and the other didn't. The default skinclass provides three content columns (main content, sequence content and help content), while the other FormItem's custom skinclass only had two. When attempting to find the max width for each form item in a form it keeps track to make sure that all the FormItems have the same number of "content columns". If not the error will be thrown.

So to fix it I just had to make sure that every FormItem in the Form was using the same skinClass.

Friday, May 15, 2015

The Mystery of iCloud Photo Library Optimization

To say I was thrilled with the introduction of the iCloud Photo Library is an understatement.    I have been waiting for this type of single source library for years.  Of course I immediately turned it on for all  my devices and went all in (not completely in Photos for OS X, because my library was all referenced and it is a slow process moving them over).  I was also excited about the cool Optimize Storage option in iOS because in 2012, when I bought my iPhone 5, 16GB seemed like plenty of space.  

However, as I soon found out the Optimize Storage option would cause me more stress than I anticipated.  You see Apple decided that the optimization would be completely automatic with no opportunity for manual intervention for the user.  There is clearly some sort of algorithm that determines what full size versions of photos to keep on the device.  So far one of the rules revolves around photos taken within the last 30 days and there is also one based on photos that were downloaded locally to the device in the recent past.  It seems that no matter how low the available storage level goes the full size of these photos will remain on the device.  

I learned this because the other day I tried to take a video of my son playing baseball and got the dreaded "Video couldn't be saved because of insufficient space" message. My heart sunk because I thought barring some insane offline photo taking spree this error would never appear on my devices again.  My expectation was that in the worst case scenario if space was running low (as in I didn't have enough space to take one picture) that the "Optimize" setting would delete ANY photos that had already been uploaded to the cloud.  I figured maybe there were tiers:
if (availableStorage > 500MB) then don't do any optimization
if (available Storage < 500MB && availableStorage > 250 MB) then get rid of any full size copies of photos from more than 30 days ago that have been uploaded to the cloud
if (availableStorage < 250MB) then delete any full size photos that have been uploaded to the cloud

No such luck though, it seems to insist on keeping some amount of full size photos on the device even if they exist in the cloud.  I was bit by this recently because about 2 weeks ago I went on a trip and recorded a bunch of video, which went up to the cloud nearly the same day.  However, now the 1GB of videos from last month sits on my device and I have no way of deleting it without also deleting the copy in the cloud too.

I tried all sorts of trickery like trying to delete the photos using the Image Capture app on my MacBook.  I turns out the delete functionality isn't available if iCloud Photo Library is turned on for the device.  So I tried turning off the iCloud Photo Library on the phone and while the delete button appeared in Image Capture it didn't really do anything.

In the end I found the best way to get me back some space was to turn off the iCloud Photo Library on my iPhone, which freed up some space because it removed all the iCloud Photo Library thumbnail photos, but all the full size photos were still on the device.  At this point I was able to use the Photos app on my iPhone to remove photos and videos from my device, but not from the iCloud Photo Library. I also had to delete them from the "Recently Deleted" album too. Once I got rid of some of the videos that had been taking up so much space I turned the iCloud Photo Library back on and it started downloading the thumbnails again, but I now have a 1.5 more GB of free space on my iPhone. 

Wednesday, April 8, 2015

Photos for OS X Learning Curve

It has been a while since I have posted, but I figured it would be helpful to document my experience with the new Photos for OS X.

My Library Situation
Prior to the upgrade I had a few different Aperture libraries (stored in a sub directory of the Pictures directory). My primary library has a combination of internal library and externally referenced photos, some of the external are on an external drive.  A second library has all externally referenced photos, while a third library has all its photos stored in the library.  The primary library is the one that has had the photo stream turned on and syncs all of my photos from my iOS devices.

Since November I have had the iCloud Photo Library turned on for my iPad and iPhone, which has worked pretty well.  According the my iCloud.com Photos page there are 1389 photos and videos stored in my iCloud Photo Library at the current moment.

Photos for OS X Upgrade
I was very excited to come home and update my Mac to OS X 10.10.3 and to try out the new Photos app.  The upgrade took about a half an hour to download and install, but I was up and running.  I had heard a lot of talk and read a lot of reviews on the application, but looking back a lot of these seemed to focus on the standard single library that you got with your Mac use case.

I opened the Photos app and was expecting to be prompted to choose a library for importing, but instead it just asked if I wanted to create an iCloud Photo Library.  I click next and before I knew it the 1389 photos and videos stored in my iCloud Photo Library magically appeared before me. Nice!!!

But wait, what about my existing libraries?  I quickly searched online and started doing research, but I also did a little playing around with a test library containing both internal and externally referenced images.  Here are some questions I was wondering about and here are the answers.

Why wasn't I prompted to select a library for migration? 
Since my libraries were not in the Pictures directory, but instead in a subdirectory of the Pictures directory, it just went ahead and created a new library.  Apparently if you have just one library (iPhoto or Aperture) in the folder it will automatically try to use it.

What is the deal with the 'System Photo Library'?
You can have several Photos for OS X libraries on your system, just as you could have many different libraries for iPhoto and Aperture.  However, only one of these can be the 'System Photo Library'.  The big difference between the 'System Photo Library' and the other libraries is that this is the only one that will sync up with your iCloud Photo Library.  Opening a non 'System Photo Library' will show you the photos in that library, but it won't show the photos you have in the cloud and it also won't sync your photos to the iCloud photo library.  However, you can change a library to be the 'System Photo Library' after the fact so don't fret if it isn't the one you wanted (note that you want to switch this as infrequently as possible because it does trigger a download of at preview size copies of all the photos in your iCloud Photo library.

How do I convert Aperture and iPhoto libraries over to Photos and what does that mean exactly?
If you right click on an Aperture library (MyLibrary.apLibrary) in the Finder and choose Photos from the Open With menu it will ask you if you want to start the conversion process.  Once it is complete you should see all of your photos in the Photos app.  Back in the Finder you will see that there is now a MyLibrary.photoslibrary and MyLibrary.migratedaplibrary where the original library used to be.  Going forward these are now two separate entities that can be used with their respective apps, but any changes made in one won't appear in the other.  The first time you open a .migratedaplibrary you will be warned that any changes made to the photos will not be made in the Photos app, but if you click OK the extension will go back to .aplibrary.

What happens to referenced files when migrating to Photos for OS X?
Any files that were referenced in the Aperture library will continue to be referenced in Photos.  However, the tools for managing referenced files are very limited in Photos and essentially let you either see the referenced file in the Finder or Consolidate referenced files aka bring them into the library.  The other caveat with referenced files is that they will not be uploaded to your iCloud Photo Library.  The good news is that as soon as you "Consolidate" photos (which can be done on one or many photos at a time) they will be uploaded to the iCloud Photo Library, assuming that the library you are working on is the 'System Photo Library'.

Can I delete the old Aperture Library after migrating?
First of all any files that were stored in the Aperture library will be stored in the new Photos library. I have read in various places that the masters in one is a link to the other so in reality there is only one copy, but I am not sure what is going on there.  In my testing I took an Aperture library with photos stored in the library, migrated it to Photos and then deleted the Aperture library without event.

My Plan
After some research and testing I think I have a plan that should work for me.  I am going to convert my primary library from Aperture to Photos.  Initially most of the library will not end up in my iCloud Photo Library because most of the files are referenced files.  This will create a single library for all of my photos going forward, with any new photos from my iOS devices or imported into my Mac automatically going into the iCloud Photo Library.  Over time I will slowly run the "Consolidate photos" operation on my referenced photos so they will be added to the library and consequently uploaded to my iCloud Photo Library.  Since I have the option turned on to Optimize Storage, space won't become an issue and eventually all of my photos will be in the cloud.  As for my other libraries, I will probably just convert the smaller ones to Photos and the larger one leave as an Aperture Library right now because it has a ton of referenced images, which I might want the flexibility to easily move in the future which is much easier given the tools in Aperture.

Wednesday, December 24, 2014

Moving From Adobe Flex 4.6 to Apache Flex 4.13 with FlexMojos

I was very excited for the handover of the Flex project from Adobe to an Apache project.  After a few years I was finally given permission to move our product from Adobe Flex 4.6 to Apache Flex 4.13.  Here are my notes on the process in the hopes that they help somebody else in the same situation.

For some background our product was compiling using FlexMojos 4.0-RC1 and Adobe Flex version 4.6.  I decided to go with the least moving parts approach, which meant I made the upgrade in two steps.  First I upgraded the FlexMojos version to version 6.0.1 and then I upgraded to FlexMojos 7.0.1 and Apache Flex 4.13.

Up first was the upgrade to FlexMojos 6.0.1.  This version of FlexMojos supports both Adobe and Apache SDK's, but due to difficulties in supporting two different group ids, it uses the com.adobe groupID for all types of artifacts.   I followed details available on FlexMojos 6.0 wiki page and its child page specifically for migrating to FlexMojos 6.

  1. Upgrade to Maven 3.0.5 (required for FM6)
  2. Changed the FlexMojos version property in my parent pom file to 6.0.1
  3. Changed the group id for the FlexMojos plugin from org.sontaype.flexmojos to net.flexmojos.oss
  4. Update the playerglobal dependency 
    1. Group ID = com.adobe.flash.framework
    2. Artifact ID = playerglobal
    3. Remove version that points to Flex SDK
    4. Update classifier tags to version
Once I made these small changes I was up and running with the new improved FlexMojos 6.0.1.  After that I moved on to the bigger task of Apache Flex 4.13.  I downloaded the Apache Flex installer and installed the SDK locally and then used the Apache Flex mavenizer, lots of details on that in the Apache Flex Wiki. I won't go into details, but I basically downloaded the source for the project and build the maven deployer.  Since I wanted to test locally I did modify the deployer slightly so it would just install the artifacts to my local repository first.  Overall it was pretty straightforward.

Next I updated my various pom files for FlexMojos 7.0.1 and Apache Flex 4.13.  Here are the steps:
  1. Update the flexmojo.version property in the root pom to 7.0.1
  2. Update the flex sdk version property in the root pom to 4.13.0.20140701
  3. Updated the old groupID of com.adobe.flex to org.apache.flex for several dependencies.  In my case there were some instances where the old group id was valid because I had some automation libraries that I still don't have artifacts for and also for some exclusions.
  4. Remove the license jar dependency.
  5. Updated the flexframework artifact name to framework and fixed the group id for it to org.apache.flex
  6. Updated the theme dependency so it doesn't have a classifier and instead of the type being css it is now swc.
  7. Updated the theme dependency's group id to org.apache.flex.framework.themes
  8. Updated all the Flex dependencies from the scope of "caching" to "rsl", because there aren't any swz files for Apache Flex libraries
  9. Updated the group id for all automation libraries to org.apache.flex.framework.automation
  10. Remove the "_rb" from the automation artifact names and added a new classifier of ".rb"
All of the above changes got me 99% of the way there and I was able to build the project successfully with Maven, unfortunately I ended up with a runtime problem.

When loading the application in a browser I received the dreaded VerifyError 1053 "invalid override of the removeItem() method.  As it turns out the third party library I was using had a removeItem() method on a class that extended from ListCollectionView AND in the same method was added to Apache Flex 4.10.  

Of course I didn't just take the error message at its face value and spent a few days trying to figure out the problem.  Once I did it was just a matter of downloading the source for the specific version of the third party library, changing the name of the method, rebuilding a "new" version and deploying it to my maven repository.  Of course if I didn't have access to the source I would have been in trouble. After that the application behaved as it did before the upgrade.

Tuesday, October 28, 2014

iCloud Photo Library, Finally!

Back in June while watching the Apple WWDC, I was most excited about the announcement of the new iCloud Photo Library in iOS8.  The most common problems non-technologically savvy iPhone users seem to face are related to photos and this is going to go a long way to fixing those problems.

The 2 Most Common Problems
1. No more room left on the device. 
2. Unable to back up because there is no more available space in iCloud.


To solve the first problem most people will go to Photos and start deleting photos until they free up enough space.  As for the second problem most people don't do anything, because they don't really know what the problem is and as a result their phone isn't backed up anymore.

I think the iCloud Photo Library will resolve both of these issues, well definitely the first, but it will certainly pave the way for the second fix.

The iCloud Photo Library basically stores ALL of your photos and movies on Apple's servers as long as you have enough storage available in your iCloud account.  All your photos will be available from any iOS devices with iOS 8.1, on Windows PC's and in any web browser at iCloud.com. Any changes you make to the photos like edits, favorites or organization will "immediately" be updated in all places.  Now you might say I though this feature already existing with the "My Photo Stream" thing.  It is true that "My Photo Stream" did sync your photos to the cloud, but it had limitations regarding how long the photos stayed on Apple's servers (just 30 days), editing on different devices required the creation of a duplicate copy, there wasn't a way to view the photos on iCloud.com and it didn't include movies. Here is more info from Apple

In short this is going to at least keep everybody's photos and movies in one place without much work from user's.  As an added bonus, you can now choose to save space on your device by having a smaller version of the picture on your device and the device will also delete some of these pictures as you run out of space. Now people can mindlessly take pictures without being concerned about storage on their device.  The only thing holding people back will be the amount of storage they have in their iCloud accounts, but with the new low price of $0.99 a month for 20GB, most people will be good for at least a few years, at which point they can decide to upgrade to more space.  The lack of the Camera Roll from iCloud backups coupled with the extra cloud storage space should get people back on the "backup train".

So I am a big proponent of this and recommend getting on board as soon as possible.  Here are some steps you might want to follow first.
1. Upgrade your iCloud Storage to the 20GB plan.  You are probably already at the 5GB limit, so take the plunge for $.99 a month.  Settings > iCloud > Storage > Change Storage plan
2. Back up your device to iCloud. Now that you have some more iCloud storage space get a fresh backup out there. Settings > iCloud > Backup > Backup Now
3. Upgrade to iOS 8.1.  Go grab a computer with iTunes, plug in your iPhone and upgrade.  No need to worry about freeing up space when doing it with iTunes.
4. Turn on iCloud Photo Library with iMore's Enable iCloud Photo Library Instructions
5. Wait for all of your photos and movies to upload to the cloud

Now enjoy taking pictures again.  The only other recommendation I have at this point is to make sure you go through your photos every once in a while and click on the little Favorite heart for your favorite pictures.  You can then go to the "Favorites" album and quickly see them there.  Manually adding photos to Albums is probably a good idea too although the built in Moments grouping works pretty well.

Thursday, August 28, 2014

Flex UIComponent CallLater Exception Handling

I recently ran into an issue with Flex that took me a while to track down related to callLater() execution and the UIComponent.setFocus() method.

In my case I was executing some functions using callLater() for various reasons, but I also had some event listeners set up that were listening for focus change and also testing to see if components were in focus.  It was a perfect storm for trouble it turns out.

After lots of debugging and scratching my head I started to get an idea of what was going wrong.  If you take a look at the UIComponent.callLaterDispatcher() method you can see the first line of code increments the UIComponentGlobals.callLaterDispatcherCount variable and the same variable is decremented at the end of the method.  I also found reference to this variable in the UIComponent.setFocus() method, where it will postpone setting the focus on the current component if the value of callLaterDispatcherCount is not zero.  If you look at the ASDoc for the callLaterDispatcherCount it states that in order to fix a problem with the ActiveX player the focus is deferred until enterFrame.  So that explains why my focus handler wasn't being notified, because for some reason that counter wasn't zero.

Now back in the UIComponent.callLaterDispatcher() there is an import if statement that tests the UIComponentGlobals.catchCallLaterExceptions variable.  Basically if this is set to false, which it is by default, any errors will not be caught by the callLaterDispatcher() method and the callLaterDispatcherCount will never be decremented.  So as soon as your callLater function throws one error the setFocus will stop working correctly.  Conversely if you have the "catchCallLaterExceptions" set to true any Error in the function being called later will be caught and wrapped inside a dynamic event and dispatched via the SystemManager.

For the short term I fixed the error that was being thrown, which allowed the "callLaterDispatcherCount" to be decremented back to zero.  The other option I am looking at in the long term is setting the UIComponentGlobals.catchCallLaterExceptions variable to true on application initialization so the counter will always get decremented and handling any callLater exceptions at the application level, as laid out in this blog post, Summa - Global Error Handling in Flex  Hopefully this will help people out if they run into a similar problem.

Additional Resources:
Liquid Night - Global Exception Handling in Flex
Doug McCune - How are you doing global exception handling in Flex/Flash/AS3?