07.02.09
Cocoa WebView and the Adobe Flash plugin
Since hybrid applications using the UIWebView are not recognized by the Adobe Flash plugin installer it appears that you cannot embed flash in a page displayed in a UIWebView and expect it to play swf files.
It is also true that the plugin has a defect. If you launch the default browser, be it Safari or Firefox, from within your application to display play a swf file the plugin crashes both browsers. If the browser is already open and running then the browser will open a window and you can play the swf.
I am including this ability in a future release of QuickConnectMac and QuickConnectWin but my opinion is don’t waste your time. Produce the movies as mp4s and you’ll have a much better user experience.
07.01.09
The book is shipping
My latest book, Developing Hybrid Applications for the iPhone: Using HTML, CSS, and JavaScript to Build Dynamic Apps for the iPhone is now available and seems to be doing pretty well.
It covers using QuickConnectiPhone and PhoneGap to create applications for the iPhone.
Hopefully it will be helpful.
06.05.09
QuickConnect Defect Tracking System
A new defect tracking system is now available for the QuickConnect family of products.
When you post a defect please include a simple example code set that illustrates the issue.
05.27.09
QuickConnectiPhone download now made smaller
I have reposted the QuickConnectiPhone Beta 8 installer on sourceForge. I was able to reduce the size of the movies included in the Mac example dramatically and now the download is a reasonable size.
By the way, the Mac port will now play and loop any movie of any type your QuickTime player will handle.
05.26.09
QuickConnectiPhone 1.5 Beta 8 is now available!
I have merged the installers for QCiPhone, QCMac, and QCPHP. They are now part of the QCiPhone download from sourceForge.
You can now make a Bonjour service on your Mac and connect to it from your iPhone or iPod touch or switch it around and publish the service on your iPhone or iPod touch and connect to it from your Mac.
The download is larger due to the videos included in the Mac Device Catalog example. I’ll try to pare this down for the final release.
The Mac port has begun to catchup with the iPhone version.
After 1.5 ships I’ll start shipping more of the OS 3.0 functionallity as 1.5.x betas.
The changes for this beta include:
iPhone 1.5 beta 8:
- Fixed stateSaving Example
- Simplified and fixed the asynchronous call handling code so that multiple asynchronous calls can be made in any order and intermingled with synchronous calls.
- Created an example of using native footers.
- Added an image display to show the default.png file if one exists to ‘hide’ the web view as it loads the JavaScript, CSS, and HTML files.
- Added a function to allow you to programatically turn copy-paste on and off.
- I still need to create an example of and the code for native headers and navigation bars.
Mac 1.0 beta 2:
- Simplified and fixed the asynchronous call handling code so that multiple asynchronous calls can be made in any order and intermingled with synchronous calls.
- Added recording and playing of audio.
- Added recording and playing of video.
- Added Shipped audio and video playing.
- Added Looping of audio and video.
- Added Bonjour networking (Client and Server)
- Added Error Logging and debug messages
- Fixed database interaction for both native and in browser databases
05.01.09
Scrolling individual elements in hybrid or web applications
A request has been made to show how individual elements in a hybrid or web application can be scrolled on the iPhone. I have included some code below that has all of the JavaScript requried to accomplish this. It comes from the QCUtilities.js file of QuickConnect iPhone 1.5 release that will be posted within a couple of days.
Because it is from QuickConnect it includes the ability to add request handling for when the user touches the screen in preparation for scrolling, as well as each time the finger is moved and when the scroll action is complete. If you want to use this code outside of QuickConnect then remove everything regarding the startDragCmd, dragCmd, and dropCmd parameters.
If you want to use this within an older version of QuickConnectiPhone place the code in your version of the QCUtilities.js file and it works.
This approach uses the CSS transitions, proposed for HTML 5, available in WebKit instead of the standard JavaScript approach since that approach is much to slow for both the iPhone and iPod touch devices.
To make an element scrollable call the makeScrollable function and pass the element you want to be scrollable as the first parameter. If you want the element to not be scrollable below its original y axis location pass true as the second parameter of makeScrollable. Here is the onload event code from the scrollingElements example of the upcoming QuickConnectiPhone 1.5 release that sets three views in a view stack to be scrollable.
Making elements scrollable
function load()
{
dashcode.setupParts();
makeScrollable(document.getElementById(‘view1′));
makeScrollable(document.getElementById(‘view2′));
makeScrollable(document.getElementById(‘view3′));
}
Scrolling Functions to Add
/*
* Pass any DOM element to this function to make it scroll
* The *Cmd parameters are optional commands to be handled for
* scroll events.
*/
function makeScrollable(anElement, scrollBothUpAndDown, startDragCmd, dragCmd, dropCmd){
anElement.ontouchstart = prepareScroll;
anElement.ontouchmove = scrollIt;
anElement.ontouchend = scrollDone;
anElement.scrollBothUpAndDown = scrollBothUpAndDown;
//do not set or reset the commands if none are passed in.
if(startDragCmd){
anElement.startDragCmd = startDragCmd;
}
if(dragCmd){
anElement.dragCmd = dragCmd;
}
if(dropCmd){
anElement.dropCmd = dropCmd;
}
}
/*
* This function is triggered each time an ontouchmove event is
* fired for an element that has been passed to makeDraggable.
*/
function scrollIt(event)
{
stopDefault(event);
this.y = event.targetTouches[0].clientY – this.offsetY;
if(this.lastY){
this.y += this.lastY;
}
if(this.scrollBothUpAndDown || this.y < 0){
this.style.webkitTransform = ‘translate(0px, ‘ + this.y + ‘px)’;
}
else if(this.y >= 0){
this.style.webkitTransform = ‘translate(0px, 0px)’;
}
if(this.dragCmd){
var params = new Array();
params.push(event);
params.push(this);
handleRequest(this.dragCmd, params);
}
}
/*
* This function is triggered every time an ontouchstart event is
* fired for an element that has been passed to makeDraggable.
*/
function prepareScroll(event)
{
stopDefault(event);
//store off any timing and duration set anywhere else in the app
//and turn them off so they don’t interfere with the scrolling
this.timing = this.style.webkitTransitionTimingFunction;
this.style.webkitTransitionTimingFunction = null;
this.duration = this.style.webkitTransitionDuration;
this.style.webkitTransitionDuration = null;
this.touches = event.targetTouches;
this.offsetY = event.targetTouches[0].clientY;
if(this.startDragCmd){
var params = new Array();
params.push(event);
params.push(this);
handleRequest(this.startDragCmd, params);
}
}
/*
* This function is triggered every time an ontouchend event is
* fired for an element that has been passed to makeDraggable.
*/
function scrollDone(event)
{
//this.ontouchmove = null;
//this.ontouchend = null;
if(this.scrollBothUpAndDown || this.y < 0){
this.lastY = this.y;
}
else{
this.lastY = 0;
}
//restore any timing or duration that was set anywhere else in the app
this.style.webkitTransitionTimingFunction = this.timing;
this.style.webkitTransitionDuration = this.duration;
if(this.dropCmd){
var params = new Array();
params.push(event);
params.push(this);
handleRequest(this.dropCmd, params);
}
}
04.16.09
QuickConnectiPhone 1.5 beta 7 available
Beta 7 includes:
- A fix to a defect that didn’t allow any control functions to be called if the DataAccessObject or ServerAccessObject was used.
- Added the ability to set a timeout value for the ServerAccessObject when it is used to make an AJAX call. The default value is 10 seconds.
- Added AJAXErrorExample to show how to handle web server errors.
- Fixed the DeviceDescription example so that it includes the necessary support files.
It looks like we are getting close to a release version!
04.15.09
QuickConnectiPhone 1.5 Beta 6 is now available
Beta 6 includes:
- Fixes for special characters in native database files(See nativeDBAccess example)
- Fixed multiple geolocation request defect
- Added horizontal accuracy to the geolocation data (See DeviceCatalog example)
- Added the ability to get any custom System settings from within JavaScript(See CustomPreferenced example)
Still to do:
- Fix two of the examples that have links in them instead of files.
- ??? Requests???
03.29.09
QuickConnectiPhone 1.5 beta 5 now available
Version 1.5 beta 5 includes the ability to have multiple databases open at the same time. A new method, close, has also been added to the the JavaScript DataAccessObject.
I also spent some time doing some cleanup of some memory leaks on the Objective-C side of the framework and making sure that the Xcode and Dashcode versions of the JavaScript files have the same code content.
If there are no more major defects this will be come release candidate one.

