The goal is to record and analyze GPS tracks:
It is OK to have some platform-specific code, but I'd like to share "analyze" part between iOS, Android and Web AND to be able to run this code while iOS/Android app is backgrounded.
I have some "analyze" code written in JavaScript, so I started looking for options in this order:
1) Do everything in a web app
iOS Safari stops running JavaScript when backgrounded.
No luck.
2) Use PhoneGap or alike
JavaScript stops when backgrounded. It is proposed to write ALL service code as native plugin.
No luck.
3) Use Titanium
Spent two weeks only to find that Android Service implementation in Titanium is incomplete. It lacks startForeground(..), which is used to ask Android to not kill the service. Someone tried to implement native module for this, but reports that while service itself is running, JavaScript don't.
4) Use Marmalade for mobile and compile C++ to JavaScript for Web
Quick googling said C++ code can't be run from service
5) Use MoSync for mobile and compile C++ to JavaScript for Web
Quick googling said they do not support services. On the other hand I saw startForeground(..) in their sources, so maybe worth rechecking.
7) Write in C: native for iOS, JNI for Android, compile to JavaScript for Web
Haven't checked yet
6) Use Codename One for mobile and compile Java to JavaScript for Web
Haven't checked yet
And my questions:
Q1. Can you confirm for each above option if it can or can not be used for such an app
Q2. I specifically interested in Titanium (as already invested in it). I'm thinking of a native Android module with dummy Service that does nothing but asks Android to not kill its process where real Titanium service is running along side with an Activity.
Will it work?
Q3. Other options / general advice?
Thank you.
When we met the "super-duper" framework limitations I came with native knowledge: add a plugin for Phonegap learn how to link it, write for both platforms.
Titanium no experience, sorry. I don't think I would even open they page to read they hello word.
Back to your original task, just look again outside of your shoes ( as I would ask it and you should respond)
"The goal is to record and analyze GPS tracks: I'd like to share "analyze" part between iOS, Android and Web AND to be able to run this code while iOS/Android app is backgrounded."
Suggestion 1: Just re-write the code in C / C++. Compile the .so Link with Android SDK / NDK and iOS.
Suggestion 2: "I have some "analyze" code written in JavaScript, so I started looking for options " Move the code to server side, where you will run a node.js and your existing code. Your apps will get a notification with result.
Suggestion 3: Write the real platform specific app finally and use the hardware + OS capabilities fully. The JavaScript purpose it is other then do hard maths.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With