Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > iphone - phonegap performance

iphone - phonegap performance
Thread Tools
Fresh-Faced Recruit
Join Date: Mar 2009
Status: Offline
Reply With Quote
Mar 6, 2009, 03:27 PM
 
Hi!

I'm developing for iphone and android using phonegap. ( http://phonegap.com )
my app needs some objective-c <-> Javascript bridging to pass events
back and forth,
because i need js code and native obj-c code to act at the same time
(!) on the same touchevents/gestures.

what i found out so far is that the method of using
document.location="gap:commandarams" for executing native code from
javascript is very very slow. (e.g. my obj-c code gets called once a
second)
has anyone made any  different experiences?
is there some way to speed this technique up in a serious way?

my 2nd approach is to instantiate a JS object und funcs from obj-c
with stringByEvaluatingJavaScriptFromString , push js-event data into
an JS array
and read that data back form obj-c via [self performSelector:@selector
(readJavascriptLogger) withObject:nil afterDelay:0.1] every 0.1 secs
as described here in the 1st comment:
http://drnicwilliams.com/2008/11/10/...ur-iphone-app/
this works a lot better, but still is not as fast as i would like it
to be.
does this technique has some serious drawbacks?
is there any way to boost performance here?
is there any way to generally boost JS performance on the iphone? (e.g
some dos & donts)

your help is much appreciated!
sam
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:53 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2