Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am aware of the PhoneGap toolkit for creating mobile applications for virtually all mobile platforms with a significant market share. However, the code in PhoneGap that is shared between the different platforms is written in JavaScript. While I like JS, I think it's hardly appropriate for computationally intensive tasks. The situation with Titanium is pretty much the same.

So, is there any way that I can create a cross-platform mobile app that has the computationally intensive code shared between the platforms?

Some context: Obviously, I don't want to implement the time consuming algorithm in many different languages, since this violates DRY, increases the chance for bugs slipping in at least one version and require boilerplate code to work.

I've looked at Xamarin's MonoTouch and Mono for Android tools, but while they cover iOS and Android, they're not nearly as versatile for deployment as PhoneGap. On the other hand, (IMO) the statically typed nature of C# is more suited for intense computation than JS.

Are there any other SDK/tools appropriate for the task that I don't know about or a point about the mentioned above that I've missed?

Also, uploading data to a web service for processing is not an option, because of the traffic required.

share|improve this question
    
Maybe callbacks could solve JS computation problem, at least that is what Node.js does. Also, there is RiverTrail, IBM JS multithreading, and Firefox OS is new from B2G. WebGL uses graphics memory to calculate 75 thousand triangles a second. Not sure if they help but maybe worth looking at. All advanced JS though. –  ClintNash Jul 7 '12 at 2:55
1  
@ClintNash My main issue with JS is that the numeric type is float, which makes it really hard to reason about any code. –  K.Steff Jul 7 '12 at 10:51
add comment

1 Answer

up vote 3 down vote accepted

Phonegap and other similar solutions proposes a really abstracted wrapper to the real platform, so they make you loose a lot of perfomance, your best option is to write your application in C and/or C++.

Starting from Windows Phone 8 the Windows Phone OS will start to give full support for the C and C++, Android already has that kind of support thanks to the NDK and is also possible to use this languages under iOS. RIM is also offering a native SDK with support for C and C++ for Blackberry.

C# is statically typed and this is true, but it runs under a virtual machine, so this also make you loose some resources, also a good codebase written in C and/or C++ can make your app/library portable on desktop with a minimum effort.

share|improve this answer
    
+1, I did not know Windows Phone 8 will have support for native code... Does RIM offer an SDK for their tablet only, or for all devices? –  K.Steff Jul 7 '12 at 11:46
    
yep, just tablet support for the RIM native SDK developer.blackberry.com/native/download –  user827992 Jul 7 '12 at 11:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.