Re:Why Trigger.io doesn’t use PhoneGap – 5x faster native br...
by theoj on Friday February 24, 2012 @01:11PM
(#3630185)
Would be curious to know why Trigger didn't use the URL interception method in Android. Is that significantly slower?
[ Parent
| on HN ]
Re:Why Trigger.io doesn’t use PhoneGap – 5x faster native br...
by Connorhd on Friday February 24, 2012 @01:20PM
(#3630230)
I'm not quite sure I understand what you mean (so if this is the wrong answer let us know). But if you mean why do we use a different method on Android compared to iOS: we can communicate directly from Javascript to Java as part of the WebView in Android, which is very fast. The URL interception method is actually the slowest part of iOS but there is no way around it.
Re:Why Trigger.io doesn’t use PhoneGap – 5x faster native br...
by ynniv on Friday February 24, 2012 @01:26PM
(#3630262)
You can call Objective-C from JavaScript on iOS: [ https://developer.apple.com/library/mac/#documentation/Apple... ]
Re:Why Trigger.io doesn’t use PhoneGap – 5x faster native br...
by Connorhd on Friday February 24, 2012 @02:28PM
(#3630594)
I believe this is a Mac OS X feature that isn't supported on iOS.
Re:Why Trigger.io doesn’t use PhoneGap – 5x faster native br...
by theoj on Friday February 24, 2012 @01:32PM
(#3630298)
Thanks for the answer. Sorry I wasn't clear... I was referring to this part of the article, in which you describe how the HTML / JavaScript communicates with Objective C on the iPhone:
>> We then make a request to a fake URI (forge://…) which we intercept in native code
Have you tried doing the same for Android? Do you have any numbers that compare the performance of this method with the JS -> Java bridge?
Re:Why Trigger.io doesn’t use PhoneGap – 5x faster native br...
by Connorhd on Friday February 24, 2012 @02:27PM
(#3630590)
Ok, that makes sense, the JS -> Java communication in Android is already very fast as it is something that can be done as part of the WebView. The fake URI request is a workaround on iOS as this feature doesn't exist. I don't have any numbers offhand, but the JS -> Java communication is definitely a very quick part of the bridge.