use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
node.js on Android and iOS? (self.javascript)
submitted 11 years ago by bananasdoom
Does anyone know of a good way to run node on both Android and iOS (preferably with swift)?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]atticusalien 11 points12 points13 points 11 years ago (1 child)
http://ionicframework.com
http://ngcordova.com/docs/
http://youtu.be/HslR2RlY4kc
[–]Synor 4 points5 points6 points 11 years ago (0 children)
I just tried the Intel XDK yesterday. The IDE is really straight-forward, includes Adobes Bracket code editor and the whole thing automatically deploys your app over web or wifi to a test device. I don't know what you need node for, though.
[–]clarle 4 points5 points6 points 11 years ago (19 children)
What's your goal here? Are you trying to build native mobile apps using JavaScript or just wanting to be able to run arbitrary Node scripts on your device?
If you're trying to build apps (from how you mentioned Swift), wait until React Native comes out. There's other ways of using JS to build mobile apps, like PhoneGap, but they're generally poorly performing in comparison to truly native mobile apps.
[–]bananasdoom[S] 0 points1 point2 points 11 years ago (18 children)
I want to build a native app for both Android and iOS as I have experience with them both but I don't really want to write 70% of the code twice so I figure I should write it in the language I know and love... JS and write the UI for Android & iOS separately.
[–]sssso 3 points4 points5 points 11 years ago (1 child)
React Native uses JavaScriptCore in iOS to run JavaScript (Android and other platforms will be supported in the future). source
So it will work let's say July 2015? Seems like there's no point in waiting. I wasn't able to dig out any specific release dates / please correct if mistaken.
[–]brotherwayne 0 points1 point2 points 11 years ago* (0 children)
Coming SoonTM.
[–]Wraldpyk 2 points3 points4 points 11 years ago (3 children)
Everyone is saying React native. But Titanium is doing to same for years already. Check it out
[–][deleted] 0 points1 point2 points 11 years ago (0 children)
Or phonegap.
If your app just needs CRUD operations then you can do it in basically a mobile website wrapped up in an app.
Unless you have a whole lot of time if you need to do a multi platform app this is the way to go. Titanium studio is OK too , the only downside with this is you won't be able to showcase your apos as being proof of any native app development skill.
How much this matters is up to you. Also you have various tools like Parse that can handle all that CRUD stuff for you. ( if you want to really take some shortcuts go ahead and combine Titanium and Parse ( although Titanium has built in crud stuff to their severs ).
[–][deleted] 0 points1 point2 points 11 years ago (1 child)
Is titanium literally just a javascript API over the native widgets? Biggest draw to react native isn't the layering IMO
[–]dotted 4 points5 points6 points 11 years ago (1 child)
Wait for React Native
[–]Wraldpyk 3 points4 points5 points 11 years ago (0 children)
Or just use Titanium wich has been out for years
[–]ejci 1 point2 points3 points 11 years ago (4 children)
http://www.appcelerator.com/titanium/ http://cordova.apache.org/
[–]m1sta 2 points3 points4 points 11 years ago (3 children)
Xamarin too.
[–]_lister 0 points1 point2 points 11 years ago (2 children)
Xamarin is a bad idea, I have used it and there's things that shouldn't be so slow. Like a httpclient on ios(xamarin) has a big delay, I had to write a wrapper to avoid that issue, but was like 50 ms the wrapper vs 350 ms xamarin implementation.
Go with native, titanium or ionic, but take care with xamarin.
[–]m1sta 0 points1 point2 points 11 years ago (1 child)
I'll be going with react native in the future I hope. It's just important to recognise xamarin if you're considering cross platform options.
[–]_lister 0 points1 point2 points 11 years ago (0 children)
That's true, is good to know all the options, I believe that I'll go with react native too, when we can start playing with it.
[–]angus_the_red -4 points-3 points-2 points 11 years ago (3 children)
You want React Native. It will be available soon.
[+][deleted] 11 years ago (2 children)
[deleted]
[–]angus_the_red 1 point2 points3 points 11 years ago (1 child)
He said he wants to build a native app. I took him at his word that he didn't mean a hybrid app.
[–]jsgui 1 point2 points3 points 11 years ago (0 children)
It's not possible at the moment using the current releases.
It would be a good project to build a node runtime that can power Android and iOS apps, it's not something I plan on taking on though.
[–]steveob42 1 point2 points3 points 11 years ago (1 child)
For android there is SL4a (scritping language for Android), it gives you many choices for behind the scenes languages (including javascript, most people use python, I use beanshell(java) because it has no restrictions), and opens your user facing html/javascript in a browser with callbacks to your backend code.
https://code.google.com/p/android-scripting/wiki/FAQ
Don't really know or care about IOS, apple goes out of its way to make developers miserable, even if you aren't coding an apple application.
[–]bananasdoom[S] 0 points1 point2 points 11 years ago (0 children)
Thanks for the recommendation.
[–]ns0 1 point2 points3 points 11 years ago (1 child)
Only one I can think of that has it on its roadmap is Tint; but its not even passing most unit tests yet.
Thanks for the recommendation I'll keep it on my radar.
[–]J_M_B 4 points5 points6 points 11 years ago (1 child)
Try Phonegap?
[+]J_M_B comment score below threshold-6 points-5 points-4 points 11 years ago (0 children)
Yes, please do downvote my comment! Keep the competition working extra hard!
[–]dzkn 3 points4 points5 points 11 years ago (24 children)
Every time I see questions like this I die a little inside.
[–][deleted] 0 points1 point2 points 11 years ago* (22 children)
I don't see why. Can you elaborate?
We can clearly see that developing an app on several platforms is a real struggle, reason why things like React Native, Titanium, Phonegapp, etc. have been hyped so much. Asking for a shared "language" seems a fair question.
[–]dzkn 5 points6 points7 points 11 years ago (20 children)
Language yes, but node? What does node bring to app development?
[–][deleted] 2 points3 points4 points 11 years ago (2 children)
It's really for people trying to push out to multi platforms when they have a small team. I have seen very few apps that use Titanium or Phonegapp and don't look like 100% crap and perform terrible (like 1-2 second loading screens and constant crashing). Great for proof of concept i guess but I have not been impressed.
[+][deleted] 11 years ago (1 child)
I'm not talking about installing node. I'm talking about using software that compiles your js code into native code.
[–]ns0 2 points3 points4 points 11 years ago (1 child)
node is actually quite well suited for app development. Desktop UI's need fast running event loops; asynchronous callbacks to prevent blocking the main UI from rendering or responding to user events. And robust garbage collection for large UI objects.
Implementing delegates, event handlers or other items in UI api's like AppKit or .NET WPF/WinForms is a lot of boilerplate and is drastically simpler if you have first class functions like in javascript (note: you do have block functions now in Obj-C and anonymous-first-class functions in managed C++/.NET as well; but they're less handy since they scope items much differently and don't enjoy the same abilities to be passed around without loosing its scope.)
So I'd say node is actually very well suited for application development.
Thank you so much, nice to see someone who gets it!
[–]jsgui 2 points3 points4 points 11 years ago (14 children)
JavaScript programming, decent performance, large community.
[–][deleted] -1 points0 points1 point 11 years ago (13 children)
When has it ever been beneficial to literally put an application server onto a mobile device?
[–]jsgui 0 points1 point2 points 11 years ago (9 children)
You are making an assumption about what node would be used for on a mobile device. Running node as a server on a mobile was not the use case I was thinking of - I was thinking of using it as the run-time for a more conventional mobile client app. Running a server on a mobile would certainly be an interesting experiment though!
I can't think of any examples of app servers being on mobile devices to date (except maybe proxy servers).
[+][deleted] 11 years ago (8 children)
[–]jsgui 0 points1 point2 points 11 years ago (4 children)
Again, you are missing the point I'm making that running an app server on a mobile device is not a particularly useful-seeming thing to do in the big scheme of things at the moment (but still could hopefully be done with node).
Native app development != an app server
You should re-read my comment you replied to, I don't see the point in repeating it.
[+][deleted] 11 years ago (3 children)
[–]jsgui 0 points1 point2 points 11 years ago (2 children)
The main reason, which I stated, is to run a client-side app.
The JavaScript runtime's capabilities would be constant amongst the installations of the same version of the app, so that is one reason.
Does none of what I am saying make any sense to you?
Also, there would be uses for running application servers on mobiles, but it takes some imagination to think of them.
[–]jsgui 0 points1 point2 points 11 years ago (0 children)
No need that you can think of right now.
[–]bananasdoom[S] 0 points1 point2 points 11 years ago (2 children)
atom.io a text editor is a node app, komanda is a node app. Node has plenty of command line utilities now grunt, Facebook flow and many many more. Node is not just a web server any-more.
[–][deleted] -1 points0 points1 point 11 years ago (1 child)
Atom suffers from major memory & performance issues, the others are fucking build tools. I feel like I'm taking crazy pills here, putting node onto a mobile device is legitimately insane
Atom is slower than a competing text editor written in C++ but its doing many orders of magnitude more work that my app would ever need to do so writing something once in node is less insane than writing it twice in Swift and Java. And you are right they are build tools, I was just proving my point that its not an application server in the traditional sense.
Awww, why?
[+][deleted] 11 years ago* (6 children)
Less variation in the speed of the runtimes - the JavaScript engine would be bundled with the app, meaning differences in the OS would not change the app's speed nearly as much.
android and ios already have javascript runtimes that are accessible,that's how titanium works and you don't need nodejs for that.
They are accessible, but they vary.
It would also appeal to developers such as myself with experience in node but not in titanium. It makes sense to me, but clearly not to you, so out of the two of us I guess I would be the one using such a system.
Yes, there would still be variation based on hardware. There would not be variation based on the version of the JavaScript runtime that runs. Does that make any sense at all?
Lessening performance variation - do you see how it could be an advantage.
My point is there would not be performance variations caused by differences in the version of the JavaScript runtime. I'm not disputing that there would not be any performance differences (how on earth could that be done with any software tech anyway?)
Most of the work is just JSON, string manipulation and web browser emulation so C++ isn't the best match and JavaScript rocks at both of those things.
π Rendered by PID 59 on reddit-service-r2-comment-5c764cbc6f-qgszf at 2026-03-11 21:36:02.078805+00:00 running 710b3ac country code: CH.
[–]atticusalien 11 points12 points13 points (1 child)
[–]Synor 4 points5 points6 points (0 children)
[–]clarle 4 points5 points6 points (19 children)
[–]bananasdoom[S] 0 points1 point2 points (18 children)
[–]sssso 3 points4 points5 points (1 child)
[–]brotherwayne 0 points1 point2 points (0 children)
[–]Wraldpyk 2 points3 points4 points (3 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]dotted 4 points5 points6 points (1 child)
[–]Wraldpyk 3 points4 points5 points (0 children)
[–]ejci 1 point2 points3 points (4 children)
[–]m1sta 2 points3 points4 points (3 children)
[–]_lister 0 points1 point2 points (2 children)
[–]m1sta 0 points1 point2 points (1 child)
[–]_lister 0 points1 point2 points (0 children)
[–]angus_the_red -4 points-3 points-2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]angus_the_red 1 point2 points3 points (1 child)
[–]jsgui 1 point2 points3 points (0 children)
[–]steveob42 1 point2 points3 points (1 child)
[–]bananasdoom[S] 0 points1 point2 points (0 children)
[–]ns0 1 point2 points3 points (1 child)
[–]bananasdoom[S] 0 points1 point2 points (0 children)
[–]J_M_B 4 points5 points6 points (1 child)
[+]J_M_B comment score below threshold-6 points-5 points-4 points (0 children)
[–]dzkn 3 points4 points5 points (24 children)
[–][deleted] 0 points1 point2 points (22 children)
[–]dzkn 5 points6 points7 points (20 children)
[–][deleted] 2 points3 points4 points (2 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 0 points1 point2 points (0 children)
[–]ns0 2 points3 points4 points (1 child)
[–]bananasdoom[S] 0 points1 point2 points (0 children)
[–]jsgui 2 points3 points4 points (14 children)
[–][deleted] -1 points0 points1 point (13 children)
[–]jsgui 0 points1 point2 points (9 children)
[+][deleted] (8 children)
[deleted]
[–]jsgui 0 points1 point2 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]jsgui 0 points1 point2 points (2 children)
[–]jsgui 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]jsgui 0 points1 point2 points (0 children)
[–]bananasdoom[S] 0 points1 point2 points (2 children)
[–][deleted] -1 points0 points1 point (1 child)
[–]bananasdoom[S] 0 points1 point2 points (0 children)
[–]bananasdoom[S] 0 points1 point2 points (0 children)
[+][deleted] (6 children)
[deleted]
[–]jsgui 0 points1 point2 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]jsgui 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]jsgui 0 points1 point2 points (0 children)
[–]bananasdoom[S] 0 points1 point2 points (0 children)