September 14, 2010

couchDB and the iOS environment

Posted in iPhone development tagged , , , , , , at 8:16 pm by tetontech

Recently I got a ping from a QuickConnect user regarding connecting to couchDB. For those that don’t know couchDB is a document storage database. It is written in Erlang and, if I remember correctly, uses the Mnesia a database written in Erlang. couchDB also uses the HTTP protocol and JSON for communication.

As I went back and spent a few minutes with couchDB again I realized that the Objective-C version of the QCFamily Enterprise Data Sync feature that I will be presenting at the iPhoneDevCon on the 27th – 30th of September, 2010 needs only minor modifications to work with couchDB. I hadn’t thought of this before and was pleased that with these minor modifications couchDB could be added to Oracle, MySQL, and other relational databases that are supported.

Too much fun!

September 24, 2009

Snow Leopard and Custom Xcode templates

Posted in iPhone development tagged , , , , , at 2:59 pm by tetontech

I have been experiencing linking errors when using the custom iPhone Xcode templates developed under Leopard.  On further investigation I have found that Xcode 3.2 appears to be interpreting the templates as OS 10.5 templates rather than iPhone templates.  This causes linker failures when the 10.5 project attempts to link the iPhone libraries.

I am re-creating the iPhone template for QCiPhone 1.6 Beta 1

August 28, 2009

HTML 5 Video and Audio in UIWebView and WebView

Posted in iPhone development, mac development tagged , , , , , , , , , , , , , , , , at 9:01 pm by tetontech

I have been playing with the video and audio tags in the UIWebView on the iPhone and WebView on the Mac.  I tried them in the QT WebView as well on linux.  I am pleased to announce that they work great!  I have tried it with mp3, mp4, and wmv.  All worked on all three platforms.

It looks like this is a good way to display videos for your users to play in your hybrid applications.

Let’s say you have a video called someCrazyMovie.mp4 that you want to display to your users.  On the iPhone or the Mac put it in the Resources group of your Xcode project that uses a UIWebView.  Point the UIWebView to a local html file, also in the resources file.

In this html file put the following code.

<video src=”someCrazyMovie.mp4>A movie description as an alt</video>

When you run your application you will see the first frame of the video used as a representational image.  You can play it by clicking it.  On the iPhone and iPod touch the movie player launches to play the movie.

The tag lets you size it, display or not display the video controls, etc.

The audio tag is used much the same way.

I’ll include an example for both the iPhone and the Mac in the 1.5.0 release of QuickConnectiPhone 1.5.0

July 31, 2009

QuickConnect 1.5 Release Candidate 1 now Available!

Posted in iPhone development tagged , , , , , , , , , , , , at 10:38 pm by tetontech

After many setbacks, like a very major hard drive crash and a bug in sourceForge, I have finally been able to release QC 1.5 Release Candidate 1.  It is now the default download for the project on sourceForge.

It includes:

  • Transaction handling for native databases from the JavaScript DataAccessObject.  The example project, NativeDatabaseTransactions, includes:
    • start transaction
    • commit
    • and rollback
  • A fix to the native footers disappearing when the orientation changed
  • Synced the Dashcode project with the latest code and fixed the run error caused by the rotating image
  • A fix that correctly handles all types of URLs such as mailTo, http, https, maps, youtube, etc.
  • A total of 32 QCiPhone examples
    • not all of the examples have been updated to the latest code set.  That will be completed for the final release.  If you are willing to volunteer to help with updating the examples please contact me.

February 28, 2009

Detecting Device information on the iPhone

Posted in iPhone development tagged , , , , , , , , , , , , at 9:49 pm by tetontech

Detecting the device specific information for the device your application is running on is very easy. The code below shows how this is done in QuickConnectiPhone 1.5 Beta 2 that will soon be released.  It is found in the GetDeviceInfoVCO.m file.

I am gathering the following and putting it in an array so that the data can be passed up to the JavaScript.

  1. The device unique identifier
  2. The name of the device
  3. The localized version of the model of the device (iPhone, iPod Touch)
  4. The system name (iPhone OS)
  5. The system version (2.2.1, etc.)
  6. The language and locale used on the device(en_US)
  7. The short version of the time zone (MST)

UIDevice *aDevice = [UIDevice currentDevice];

NSLocale *currentLocale = [NSLocale currentLocale];

NSTimeZone *timeZone = [NSTimeZone systemTimeZone];

NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];

NSMutableArray *passingArray = [[NSMutableArray alloc] initWithCapacity:5];

[passingArray addObject: [aDevice uniqueIdentifier]];

[passingArray addObject: [aDevice name]];

[passingArray addObject: [aDevice localizedModel]];

[passingArray addObject: [aDevice systemName]];

[passingArray addObject: [aDevice systemVersion]];

[passingArray addObject: [defs objectForKey:@"AppleLocale"]];

NSString *timeZoneString = [timeZone localizedName:NSTimeZoneNameStyleShortStandard locale:currentLocale];

if([timeZone isDaylightSavingTimeForDate:[NSDate date]]){

timeZoneString = [timeZone localizedName:NSTimeZoneNameStyleShortDaylightSaving locale:currentLocale];

}

[passingArray addObject: timeZoneString];

The JavaScript to display this information, found in the functions.js file of the DeviceDescriptionExample, is seen here.

function displayDeviceInfoVCF(data, paramArray){

document.getElementById(‘devDisplay’).innerText = ‘UDID: ‘+paramArray[0]+‘\n\ndevice name: ‘+paramArray[1]+‘\n\nmodel: ‘+paramArray[2]

+‘\n\nsystem: ‘+paramArray[3]+‘\n\nOS version: ‘+paramArray[4]+‘\n\nLanguage and Locale: ‘+paramArray[5]+‘\n\nTimeZone: ‘+paramArray[6];

}

Here is an image of this code running in the DeviceDescriptionExample application incuded in QC 1.5

A display of the information about the device running the application

A display of the information about the device running the application

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: