Monday, April 2, 2012
Camera Bug
Recently I built an Android tablet app for a customer that included the ability to save pictures and upload them to a backend. The Android app was being used by their infield personnel to track their daily progress and provide them with task information. Users could update when tasks were complete and be notified of new tasks automatically. After rolling the app out to about 300 test users, we ran into a frustrating bug where the app would periodically crash when taking the picture. No rhyme or reason to the crashes. The camera functionality would work 9.5 times out of 10, but occasionaly would crash within the Android code when the camera was trying to auto focus. Eventually we tracked it down to where the Android camera code would crash if the user clicked the Photo Capture button while the camera was trying to autofocus. Once we figured that out, it was an easy fix to prevent the user from double clicking the Photo Capture button. Simply hide the button and make it non-clickable until the picture result finishes.