07.16.08
Installing the QuickConnect iPhone plugins
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.
Andrew Lunde said,
July 16, 2008 at 9:05 am
Despite following your install directions, I can’t get the template to show up in DashCode.
A end-to-end tutorial on how to use your framework with iPhone would be great. It looks like just what I’m looking for.
-Andrew
tetontech said,
July 16, 2008 at 1:32 pm
After you install it will show up if you select ‘Dashboard Widget’ instead of application and scroll to the bottom.
I’m not yet sure why it shows up there instead of under ‘Web Application’. I have looked through all the plist files and haven’t found anything there.
Andrew Lunde said,
July 16, 2008 at 9:00 pm
Still no go. It’s not under “Web Application” or “Dashboard Widget”. When I find Dashcode in the Finder and right click, I see the folder under Contents/Plugins so I think it’s in the right spot. I did notice that some of the templates are named with “Mobile” in the name such as TemplateMobileCustom.wdgtTemplate and that those appear under “Web Application”. Not sure if that means anything or not.
It seems to me that your efforts here are exactly what I’m looking for. Unfortunately, I’ve only been working with the iPhone Dev Tools for 2 days now so I’m sure I’m missing something basic.
Do you have a bit of a tutorial or step-by-step procedure? If I can get things going, I would be inclined to write one in order to help out.
-Andrew
Andrew Lunde said,
July 16, 2008 at 9:01 pm
BTW, I just got my iPhone on Monday and am using all the latest versions of the tools.
-A
tetontech said,
July 19, 2008 at 1:44 am
I just went through the process with my new machine as I described above and it worked great.
There really is only the one step installation process.
Changing the name to include mobile doesn’t make any difference on my machine.
You have to make sure you scroll down in the template selection window.
Lee
Keith said,
July 28, 2008 at 5:07 pm
I am having some trouble with the quick connect in xcode. It seems to run fine on the simulator but once I try to switch it over to an ipod with the 2.0 upgrade for testing, I go to build and get 430 errors and it fails. Anyone have any ideas?
tetontech said,
July 28, 2008 at 7:46 pm
What kind of errors?
Make sure that you follow the instructions in the dashcode to xcode.txt file in your xcode project.
Keith said,
July 30, 2008 at 4:39 pm
I have the first couple as an example.
Is there a way to copy the whole debug log into text.
Here is the first batch of errors I receive:
error: i386/types.h: No such file or directory
error: syntax error before ‘__darwin_blkcnt_t’
error: syntax error before ‘__darwin_blksize_t’
error: syntax error before ‘__darwin_dev_t’
error: syntax error before ‘__darwin_gid_t’
error: syntax error before ‘__darwin_id_t’
error: syntax error before ‘__darwin_ino64_t’
error: syntax error before ‘__darwin_ino_t’
error: syntax error before ‘__darwin_mach_port_name_t’
error: syntax error before ‘__darwin_mach_port_t’
error: syntax error before ‘__darwin_mode_t’
error: syntax error before ‘__darwin_off_t’
error: syntax error before ‘__darwin_pid_t’
error: syntax error before ‘__darwin_sigset_t’
error: syntax error before ‘__darwin_suseconds_t’
error: syntax error before ‘__darwin_uid_t’
error: syntax error before ‘__darwin_useseconds_t’
It is strange that it will work with the iPhone simulator but once I switch over to the Device debug it gives me 430 errors similar to the ones above.
tetontech said,
July 31, 2008 at 3:24 pm
These appear to be library inclusion errors. Is there a library you included in your target for the simulator but not the device build?
Keith said,
July 31, 2008 at 4:45 pm
I was able to get past these errors. Only thing I come across now is that I am trying to get multiple html pages embedded in the application to link but I am not sure of the inner file path structure works. Are there any examples on how to display an image and link between multiple html pages?
Thanks,
Keith
tetontech said,
July 31, 2008 at 5:48 pm
if you had a page called index.html and you had a link to a page called second.html the anchor tag would be fdsa.
Since Xcode doesn’t use directories. It uses groups. So all of your links should have no directory structure included.
Keith said,
July 31, 2008 at 6:48 pm
Thanks for the insight. I am still not sure how the fdsa anchor works. Could you please send me a sample of a string including this anchor in it.
Thanks,
Keith
keithg0103 at yahoo dot com
tetontech said,
July 31, 2008 at 9:36 pm
It is just a standard link using the anchor tag. where the internal portion of the link looks like
href=’second.html’
Laurent said,
August 8, 2008 at 11:06 pm
It would be great to play sounds or ask ObjC to grab a picture and have it callback a javascript function.
Since we apparently can’t call ObjC from javascript, ObjC could poll specific methods frequently, and the javascript function would pass back what it wants the objc-side to perform.
Also, do you think that if we do in javascript something like:
window.location = ‘javascript:playsound(”sound1.mp3″)’
is it possible for the ObjC to trap this navigation event from the UIWebView, look at the URL being navigated to, cancel it if it recognizes it as a command (e.g. playsound) and perform the desired function in the ObjC-side?
Laurent.
tetontech said,
August 9, 2008 at 3:37 pm
Laurent,
The polling is one way it could be done. I have hesitated to employ this approach because polling can lead to bad habits and bad design.
Recently I considered creating a tiny ultra thin http server to embed in the objective-c QuickConnectWrapper. I was stopped by the existence of the needed libraries in the simulator frameworks and their absence in the phone libraries.
As per the trapping of specific javascript calls, that would be very difficult if not impossible. You would somehow have to tap into the underlying WebKit engine. I would suppose you would attempt this by inheriting from UIWebView and somehow giving yourself this access and then overwriting the functionallity of the WebKit engine itself.
I can only assume that even if you were able to take on this huge task and complete it successfully that Apple would never allow the app to be put on the app store. Such manipulation might open security holes.
Laurent said,
August 12, 2008 at 9:32 pm
I found this post:
http://softwaredev.meetup.com/92/messages/3284457/
“You could also pass messages from JS to Objective-C by packaging your
message into a custom URL: Within your JS set window.location to this
custom URL, and then capture it in Objective-C via
webView:shouldStartLoadWithRequest:navigationType: (making sure to
return NO to prevent the page from changing location).”
tetontech said,
August 13, 2008 at 12:17 am
Laurent,
I am experimenting with this now and will post my results soon. Thanks for the idea and the link.
John said,
November 4, 2008 at 4:00 pm
I can’t find the Contents\Plugins folder.
Could you please post the absolute path?
Thanks
tetontech said,
November 4, 2008 at 5:36 pm
John,
control click the Dashcode application and select ’show package contents’. The Contents\Plugins folder will be inside the Finder window that is then displayed.
John said,
November 5, 2008 at 11:18 am
Thanks, I got it now, I didn’t get you were talking about the icon that starts DashCode.
In your Xcode example I see that the web page bounces when you scroll to the end of the screen. I seen some examples online where they set AllowsRubberBanding, would it be possible to incorporate that in your framework?
Thanks,
John
tetontech said,
November 5, 2008 at 3:38 pm
John,
I have checked UIWebView, UIWebViewDelegate, UIScrollView, UIScrollViewDelegate, and UIView. I don’t see this as a method or attribute. I also searched the documentation for AllowsRubberBanding and came up empty. I did a google search and found nothing as well.
What examples are you referring to?
John said,
November 5, 2008 at 4:03 pm
It’s actually called setAllowsRubberBanding, and was used before the SDK came out:
http://books.google.com/books?id=Sk5V6jqk8sQC&pg=PA238&lpg=PA238&dq=setAllowsRubberBanding+how+to&source=web&ots=Yb9VG2DSC6&sig=wppfE4cL3_ASpfgEtYomQuHJwbs&hl=en&sa=X&oi=book_result&resnum=6&ct=result
I could’t find it back in the SDK either, but I think this guy got it working:
http://idevkit.com/forums/tutorials-code-samples-toolchain/25-uiwebview-uiscroller-uinavigationbar-reload-button.html
tetontech said,
November 5, 2008 at 4:47 pm
It appears that setAllowsRubberBanding is part of the private portion of the UIScrollView API. Access to the embedded UIScrollView from the UIWebView that contains it is also part of the private API.
For applications to be able to be placed in the App Store no private API’s can be used.
If I added this functionality to the framework no applications could be created with it and then distributed via the standard channel.
I want to keep applications created with the framework open to the standard distribution channel. If you want to add this functionality to your copy of the framework feel free. Just realize that it will only work on phones that have been cracked using JailBreak.
John said,
November 5, 2008 at 4:59 pm
That is a shame… Apple seems a bit too restrictive for no reason…
Was that the only way to give a hybrid app more of a native app appearance?