November 28, 2009

Cross Platform Mobile Development Documentation

Posted in Uncategorized tagged , , , , , , , , , , , at 1:25 am by tetontech

Available on the wiki you will find documentation on how to start using the latest 1.6 beta to develop for iPhone, Android, and Palm with the same HTML, CSS, and JavaScript code.  I hope this helps you creating the apps that you want.

I’m still working on getting Blackberry development to work the same way as the others but I’m close to having something that works.

I’m also uploading 1.6 beta6.  It makes some small fixes related to the Images directory in the project.  If you are using beta5 you should upgrade.

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

September 5, 2009

Moving QuickConnectiPhone projects from Dashcode to Xcode

Posted in iPhone development tagged , , , , , , , at 6:57 am by tetontech

There is a video, not by me, on youTube on how to move your dashcode project into a QCiPhone Xcode project. I though it might be helpful for those who are starting out.

August 13, 2009

QuickConnectErlang now available for OS X

Posted in erlang development tagged , , , at 5:48 pm by tetontech

The latest version of QuickConnectiPhone includes QuickConnectErlang in the installer.  QCErlang uses an Xcode plugin to speed and  ease Erlang development on OS X.  The plugin is based on the great work of Jón Grétar Borgþórsson and his xcode erlang plugin.  I have used it to create a project template for erlSim.  erlSim is a massively parallel discrete event simulator written in Erlang.

The plugin allows you to run your Erlang application from within Xcode and all terminal input and output happen in the Xcode Debugger Console.  Compilation errors and warnings are displayed as bubbles in the source code files just like all other Xcode project types.

The plugin is not as complete as I would like it.  I am identifying and fixing defects related to Code Sense.  Currently the functions in the standard modules such as io, math, etc. are not working correctly with code sense.  Hopefully I can identify the underlying problem soon and it will be fully up and running.

The installer also includes a template for a standard Erlang application without the QuickConnectErlang framework if you want to go that route.

March 7, 2009

QuickConnectiPhone 1.5 Beta 2 now available

Posted in iPhone development tagged , , , , , , , , , , , , at 11:14 pm by tetontech

The second beta of QC 1.5 is now available for download from the SourceForge link found in the right-hand bar of this blog.

It contains several changes and fixes requested by you as well as the new Charting and Graphing Library.  Using this library you can create Pie, Line, Filled Line, and bar charts quickly and easily.  If you take a look at the source code for the library you will find that it uses the new HTML5 canvas tag and JavaScript.  You can now create this easily from within your JavaScript application.

Another change is the inclusion of Xcode code completion macros for the common QuickConnect JavaScript functions.  Also included are macros for inserting the new pie, line, and bar charts.

I’ll make a video of how to use these.

I will also make a video on how to use the new Dashcode snippets for creating the charts.

Here are the changes, not including the earlier beta 1 changes, for beta 2.

Changes for 1.5 beta 2

1.  Charting library added (line, filled line, bar, and pie charts).

2.  apostrophe’s and ampersands now can be used in native database data without issue.

3.  Links in your html files are now handled by launching of all known and custom applications.

a.  http://, https://, feed:// – launches Mobile Safari

b.  mailto:// – launches Mail app

c.  http://maps.google.com – map app

d.  http://www.youtube.com – YouTube app

e.  itms:// – iTunes store app  (get the full URL from running iTunes onyour desktop machine);

f.  http://phobos.apple.com – App Store app(get the full URL from running iTunes on your desktop machine)

g. tel:// – iPhone only.  Dial a phone number (any phone number entered automatically becomes a link)

h. sms: – iPhone only.  Launch the sms app (notice that there are no // characters)

i. yourCustomURL:// – a custom URL for an application you have created.

4.  The play() JavaScript function now automatically detects if the audio file name passed as a parameter is part of your application package resources and plays it if it is.  If it is not, it will look to see if it is a recorded audio file and then play it.  Supported audio file types are:

a. mp3

b. wav

c. aifc

d. aiff

e. m4a

f. mp4

g. caf

h. aac

5.  Language, region, and TimeZone are now included in the device description received from the call to the getDeviceDescription() JavaScript function.

6.  Custom Dashcode code snippets that let you drag and drop QuickConnect functionality to your JavaScript application

a. Pie Chart

b. Line Chart

c. Bar Chart

7.  Custom Xcode JavaScript auto-completions that let you quickly add available QuickConnect functionality to your JavaScript application

a. piechart – insert pie chart creation code

b. barchart – insert bar chart creation code

c. linechart – insert line chart creation code

d. draggable – code to make an element draggable

e. resuzable – code to make an element resizable

f. changeable – code to make an element draggable and resizable

g. vmap – mapCommandToVCF call

h. bmap – mapCommandToBCF call

i. emap – mapCommandToECF call

j. valmap – mapCommandToValCF call

k. smap – mapCommandTo SCF call

l. vcf – create a View Control Function

m. bcf – create a Business Control Function

n. ecf – create an Error Control Function

o. valcf – create a Validation Control Function

p. scf – create a Security Control Function

q. debug – code to make a debug message call

r. logerror – code to log an error

s. findloc – findLocation call

t. device – getDeviceDescription call

u. showmap – showMap call

v. syssound – playSystemSound call

w. vibrate – vibrate call

x. showpicker – showPicer call

y. recordaudio – recordAudio call

z. playaudio – play call

aa. stopplayaudio – stopPlaying call

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.

November 29, 2008

QuickConnectiPhone 1.0 RC3 available

Posted in iPhone development, mac development, misc, PHP tagged , , , , , , , , , , , , , , , , , , , , at 7:38 am by tetontech

The latest release candidate, 3, is now available for QuickConnectiPhone a framework that allows you to build your installable iPhone applications in HTML, CSS, and JavaScript. If you want to create an iPhone application but don’t have time to or maybe don’t want to learn Objective-C you can use QuickConnect instead.

This release, like RC 2, includes an installer.

It also includes support for embedding Google maps in your installable JavaScript application. This new functionallity, in addition to the previously added capabilities of GPS location, acceleration, JavaScript debugging in Xcode, device vibration and sound, etc., adds new power to your applications easily. All you need to do is make one JavaScript method call that includes the locations where you want a pin dropped and a description. The framework does the rest and your custom map is displayed.

Database access is just as easy. A wrapper for the SQLite database used natively on the iPhone is included in the framework. It supplies you with two methods, getData and setData, that are easily used to access and modify your data.

AJAX is also supported by a wrapper with getData and setData methods.

In addition, this installer will install QuickConnectMac. You can now quickly port your JavaScript application from your iPhone to a Mac. Most of this porting will consist of changing your HTML and CSS to fit the larger screen.

Also, QuickConnectPHP is included. This is an implementation of the QuickConnect framework in PHP. It allows you to create web applications quickly and easily using the same engineered approach that you use for your iPhone and Mac applications. It includes a MySQL wrapper that supplies both of the getData and setData methods as well.

October 30, 2008

QuickConnectiPhone 1.0 Available

Posted in iPhone development tagged , , , , , , , , , , , , , , at 6:19 pm by tetontech

Update!  Many new features and examples available.

QuickConnectiPhone version 1.5  and 1.6 beta, a framework for creating installable JavaScript iPhone applications, is now available on sourceForge.

Included in the download are many examples of how to use the framework.  One is a Dashcode project file that implements an application completely in JavaScript.  It includes using the sqlite database as well as AJAX.

The second example is how to interact with the iPhone or iPod Touch.  This is a JavaScript application that can get the GPS information from the device.  It can also get the accelerometer information.  You can also use it to vibrate the phone and play system sounds as well as record and play audio.

One of the limitations of the UIWebView is that the pickers displayed when the user selects pull-downs in HTML.  This same example shows you how to use the more useful native pickers from within JavaScript.

This same example shows you how to write out debugging messages in JavaScript and have them show up in the Xcode console.  This is very handy since alerts are not allowed on the iPhone and alerts are a bad way to debug anyway.

These two examples are actually the examples from the book I have in progress.  More of the examples from the book will be added to create RC2 as well as any fixes that need to be made.  One of the examples included will be how to embed Google maps in your application that looks like the Map iPhone app.

Other examples cover everything from how to consume data feeds to doing enterprise data synchronization between the sqlite database on the device and ANY remote database.

I am currently deciding what the last chapter of my book should be. A rough cut of the first four chapters is available on Amazon.com. The title is:

Developing Hybrid Applications for the iPhone: Using HTML, CSS, and JavaScript to Build Dynamic Apps for the iPhone. It is being published by Pearson.

If you have any ideas for things you would like to see how to do with the iPhone please post them here.

The books current chapters are:

  • Creating iPhone Hybrid Applications Using JavaScript
  1. Developing with Dashcode and Xcode           – using both apps to create a hybrid application
  2. JavaScript Modularity and iPhone Applications – the QC Architecture explained
  3. Database Access and iPhone Applications       – using sqlite
  4. Remote Data and Hybrid iPhone Applications  - using AJAX
  • Section 2: Creating iPhone Application User Interfaces
5.  Creating an iPhone User Interface                     – Apple’s rules and other good ideas

6.  Hybrid Applications, GPS, Acceleration and

Other Native Functions                                  - calling objective-c from JavaScript and the QC Obj-C implementation

7.  Embedding Usable Google Maps                       – how to insert Google maps in your application so they look like the Map application that ships on the device.

8.  ??????

Appendices
A.  An introduction to JSON
B.  Intstalling the QuickConnectiPhone Hybrid Templates
C.  JavaScript Objects

July 16, 2008

Installing the QuickConnect iPhone plugins

Posted in iPhone development tagged , , , , , , , , , at 4:48 am by tetontech

Based on requests for information it seems I have not stated how to install the QuickConnect Xcode and Dashcode plugins.

Assuming you have installed the developer tools put the QuickConnect iPhone Hybrid Application folder in the folder:

HardDrive\Developer\platforms\iPhone\Developer\Library\xCode\Project Templates\Application

To install the dashcode plugin right click on the Dashcode application and select ‘Show Package Contents’.

Copy the TemplateQuickConnectiPhone.wdgtTemplate folder into the Contents\Plugins folder.

June 11, 2008

Hybrid Mac applications

Posted in misc tagged , , , , , , , , , , at 10:45 pm by tetontech

The code example here is now included in a framework called QuickConnectiPhone.  If you want to know more have a look at this post as well as others in this blog.

In a previous post I showed how a UIWebview can be programmatically inserted into an application running on the iPhone using the new SDK.  In this post I will explain how to insert a WebView into a Cocoa application running on the Mac.  This example will show how to use the new Interface Builder that ships with the new SDK.  I will also cover this soon for the iPhone.

There are a series of step that you should go through to accomplish this task.  The names for items created in this example should be replaced with what you want them to be.

Steps:

  1. Select ‘New Project’ in the file menuThe project type selection window
  2. Select the ‘Cocoa Appliction’ project template
  3. Name the new project.  Mine will be called ‘example3′entering the name of the new project
  4. Create and name a new Objective-C file.  I will call mine AppDelegatethe Cocoa file creation window
  5. Open AppDelegate.h and add ‘IBOutlet id webView;’ to the class.  This is the name that will be associated with the WebView that we will later drag and drop when we are using Interface Builderadding an outlet to the header
  6. Add the WebKit Framework to the project.  On my machine this is located in
    ‘/Developer/SDKs/MacOS10.5.sdk/System/Library/Frameworksthe dialog used to select the WebKit framework
  7. Open the MainMenu.xib file by double clicking it.  This will open Interface Builder.  The xib file is found in the Resources group in your project.
  8. Open the library window by selecting it in the ‘Tools’ menu.
  9. Drag the ‘Object’ cube from the library to the ‘MainMenu.xib’ windowa screen shot showing an Objective-C object being added to the xib file
  10. Select ‘identity’, the ‘i’ tab in the inspector window labeled ‘Object identity’ and change the Class to be ‘AppDelegate’ or what ever you named the Objective-C class you created in step 4.  This will create a link between the xib file and the Objective-C class.  Notice that as soon as you rename the class the id you created in the header file in step 5 is now listed for the object in Interface builder as an outlet.  This is what will allow us to gain access to the WebView we will soon create in Interface Builder.rename the object to link it to the Objective-C files created earlier.
  11. Add a WebView to the ‘Window’ window by selecting ‘Web Kit’ from the ‘Objects’ tab of the library window and then dragging the WebView element to the ‘Window’ window.  A WebView will now appear in the ‘Window’ window that you can resize and locate anywhere in the window you would like.  I will make mine slightly smaller than the containing window.  You will also want to select the ruler tab in the ‘inspector’ window.  By clicking on the light red arrows within the box in the ‘Autosizing’ section your WebView will stretch as the window stretches.placing the WebView element in the main app window
  12. Select the App Delegate item in the MainMenu.xib window and display the connections tab, select the ‘->’ in the blue circle. A small circle will exist to the right of the outlet ‘webView’.  Drag it onto the WebView in the ‘Window’ window.  This will cause an outlet connection to be made.  This means that in the code your Xcode Objective-C code the ‘webView’ you added to the header file in step 5 will in essence be a pointer/reference to the WebView you created in Interface Builder in step 11.linking the WebView to the outlet
  13. In the ‘Referencing Outlet’ section of this same inspector window for the App Delegate there is a line that says ‘New Referencing Outlet’.  Select the small circle on the right and drag it over ‘Files Owner’ in the ‘MainMenu.xib’ window.  A popup will be shown that says ‘delegate’.  Select it.  You class ‘App Delegate’ will now be used as the delegate for the application.  This will allow you to now create functions that are triggered for events that happen in the application.  Step 14 will be the implementation of one of these.linking the AppDelegate class to be the delegate for the application
  14. Save the you changes by saving within Interface Builder.
  15. Implement the applictionDidFinishLoading method in AppDelegate.m.  This is where you can write out to the log file using NSLog and tell the WebView to load a specific web page as well as other actions you may want to have happen when the application has completed loading.  In this example we will load a page found locally on the machine that is part of the application itself.  It is called ‘index.html’ and can be found in the ‘Resources’ group in the Xcode project.  The code in the image shows you how to load this web page.implementing the application Did Finish Launching method
  16. Compile and select the ‘Build and Go’ icon to run the application.the application running

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: