December 30, 2008

QuickConnectiPhone version 1.1 is now available

Posted in iPhone development tagged , , , , , , , , , , , , , , , , , , at 12:31 am by tetontech

QuickConnectFamily

Download QCiPhone version 1.1 from here.

It includes the installer as well as new example code for the new features.  See how to access a SQLite database, either shipped on the device or in the UIWebView object, by making a few simple calls.  Start by looking in the mappings.js file and then the functions.js file to see how easy it is to do.  The nativeDBAccess example includes a sample.sqlite database file.  The browserDBAccess example shows you how to create and populate a SQLite database within the UIWebView without having any database files.

The browserAJAXAccess example is a simplified example that pulls data from the RSS feed for this blog.  Again, look in the mappings.js and functions.js files to see how to do this.

If you want to know how the framework pulls all of this off have a look in the com.js file.  It handles the communication to the device for everything from database access to debug messages and error logging.  If you want to get even deeper you can check out the Objective-C classes that support the JavaScript device calls.

Want to know how the linearization happens?  Look in the QuickConnect.js file and search for the dispatchToBCF function.  Then check out the DataAccessObject.js and ServerAccessObject.js files.

All of this, in addition to coverage of PhoneGap will be covered in my upcoming book from Pearson Publishing.

As stated above, version 1.1’s new abilities include a full implementation to access any number of SQLite databases shipped with your application from within JavaScript.  This uses the same getData, setData API that version 1.0 used to access SQLite databases in the UIWebVeiw with one modification.  If you want to get or set data in a ‘native’ database instead of in the UIWebView you use the getNativeData and setNativeData methods.  Everything else is exactly the same between the two types of calls.

I have also linearized the asynchronous calls that you make to the device or remote servers using AJAX.  This required some changes to the PhoneDataAccessObject, now renamed DataAccessObject, as well as the ServerAccessObject used for AJAX calls.

In other words, now you can make a call to an SQLite database, an AJAX server, or GPS location information, and then make a call to any other piece of functionality and the second call will not happen until the first asynchronous call has completed.  This has been one of the most requested feature changes.  You no longer need worry about the timing of your asynch calls.  String together any number of asynchronous calls and the framework will ensure that they happen linearly.

Another change is that the QueryResult object is used as the data return for both database calls and AJAX calls.  Regardless of the type of call the returned objects are the same.

These major changes are what bumped the version number up to 1.1.

Advertisements

1 Comment »


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: