Iphone Application
Development
Designed and developed by Wi-Design, Inc in partnership with D'Eredita D’sign & D’velopment [ http://www.d-d-dltd.com/ ]
Support
Support E–mail: [ cal4pros@wi-design.com ]
Description
Have you ever dropped your iPhone? The glass is not damaged, COOL! But those tiny, sensitive accelerometers inside (that measure orientation and movement) are a different story.
Cal4Pros allows a heavily used, dropped, shaken, stirred, rattled and flat out abused iPhone to be:
- measured and
- restored to beyond its out–of–the–box level of precision when used in conjunction with other applications. (Note: Even the degree of out–of–the–box precision varies from phone to phone!)
The former, anyone can do by simply using this app. Restoring the level of precision requires the pro responsible for your favorite app to incorporate some basic code and distribute an update. Read on. We have made it easy to do.
Accelerometers are highly sensitive micro-devices that quickly lose accuracy when used "in the wild." Yet, thousands of iPhone apps depend on accelerometer data for game control, measurement, or movement sensing while not offering users the ability keep their apps in tune with the ever changing accuracy of accelerometers. Cal4Pros allows for both measurement and tuning.
DOES 0 = 0? YOUR PHONE ASSUMES SO: Place the phone face up on a flat, relatively level surface and hit calibrate. Voila. Within seconds, you are presented with the calibration factors needed to bring the accelerometers in your phone back to--and in some cases beyond--their original level of precision. These factors are presented in their raw form, which are percentages of 1 g-force (g-Force is the stuff you and your phone feel when taking off in an airplane or turning a corner in your car). Note: This alone does NOT automatically calibrate your phone, it simply allows any concerned or zealous (okay, overly concerned or zealous?) user to get more acquainted with their iPhone. However, programmers can easily access Cal4Pros output stored in a local SQLite database and pull the calibration values into their applications:
MAKE 0=0!
How to access Cal4Pros output from your app
You must have a custom URL scheme attached to your app in order to sync with Cal4Pros. Add the following snippets of code to your application: The first must be placed within the Application Delegate. In your application delegate, you will need the following method: (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions. This method will give you back the calibration data that your user has received from Cal4Pros. If you already have: application(UIApplication *)didFinishLaunching, replace it with this method. You must include the following code snippet at the beginning of this method:
–(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions(NSDictionary *)launchOptions { NSArray *keyArray = [launchOptions allKeys]; if ([launchOptions objectForKey:[keyArray objectAtIndex:0]]=!nil) { NSURL *url = [launchOptions objectForKey:[keyArray objectAtIndex:0]]; if([@“/calibrateVals”isEqual:[url path]]) { NSDictionary *queryDictionary = [self parseQueryString:[url query]]; double calibrationX = [[queryDictionary objectForKey:@"cfx"] doubleValue]; double calibrationY = [[queryDictionary objectForKey:@"cfx"] doubleValue]; double calibrationZ = [[queryDictionary objectForKey:@"cfx"] doubleValue]; //...do something with the calibration dates } // Any other URL scheme responses here... } // ...Perform necessary application startup return YES; }
The second is the method that is used to invoke Cal4Pros; you can call this method from anywhere within your app. Simply change the myAppName and myAppURLScheme values accordingly.
– (void)calibratePhone:(id)sender { NSString *myAppName = @"My App"; // Put your iPhone app’ name here NSString *myAppURLScheme = @"myapp"; // Put your iPhone app’ URL scheme here NSString *urlString = [ NSString stringWithFormat: @"cal4pros://localhost/calibrateIphone?return-url=%@app-name=%@", myAppName,myAppURLScheme]; NSURL *openURL = [NSURL URLWithString:urlString]; [[UIApplication sharedApplication] openURL:openURL]; [muAppName release] [myAppURLScheme release]; [urlString release]; [openURL release]; }
And that‘s it! Users can now calibrate their devices from within your app. If Cal4Pros is invoked from your application, users can return to your app by clicking the “Return to My App” (where “My App” will be replaced with the value entered for the myAppName string).
Note: The z–component accounts for the effects of gravity when calibrated as instructed (i.e., when placed screen up).
If you are not a programmer and your favorite applications could benefit from a precisely calibrated device, write your app providers today!
While we have found this app to be very useful and oddly fun in–house, we are interested in your feedback and how useful this app is for you, either as a more informed user (who is now more in tune with their iPhone) or a programmer. Write us at: [ cal4pros@wi-design.com ].

