Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Android Support [$50] #94

Open
subtleGradient opened this issue Oct 17, 2012 · 111 comments
Open

Add Android Support [$50] #94

subtleGradient opened this issue Oct 17, 2012 · 111 comments

Comments

@subtleGradient
Copy link

Yes.

There is a $50 open bounty on this issue. Add to the bounty at Bountysource.

@subtleGradient
Copy link
Author

@zcbenz
Copy link
Contributor

zcbenz commented Oct 18, 2012

It's possible to provide an Android port of node-webkit, but I don't have plan for that in near future, supporting all three major desktop platforms has already taken all of my time.

@sequoiar
Copy link

In case Chrome need V8 Android bridge, it should be done there.

at least three things to do:

  1. porting Chrome's V8 to node.js.
  2. cross compile node.js with Android NDK
  3. poring what else in content-shell to Android

@donaldpipowitch
Copy link

If it's technically possible that would be awesome. Could game developers even use WebGL on Android with this way?

@zcbenz
Copy link
Contributor

zcbenz commented Oct 22, 2012

Not sure, I'm not familiar with Chrome on Android.

@donaldpipowitch
Copy link

Hmm... nope. The current version of Android for Chrome doesn't support WebGL :(

@rogerwang
Copy link
Member

@donaldpipowitch , I'm sure it will get better :)

@allencblee
Copy link

@subtleGradient, why not use Phonegap?

@donaldpipowitch
Copy link

PhoneGap neither uses V8 nor Node. It just uses the native WebView and adds some API bridges.

@donaldpipowitch
Copy link

FIY:
Great news. The recent Chrome for Android Beta features WebGL hidden behind a flag: http://blog.tojicode.com/2013/01/get-webgl-working-on-android-chrome-beta.html?m=1

It would be just so sweet to get node-webkit running on an OUYA :)

@kevsmt
Copy link

kevsmt commented Jan 11, 2013

This is epic if possible :)

@zhizhangchen
Copy link

Even if it's technically possible to enable node APIs on Andorid, will Google allow such an application being installed? Basically it can access all the resources in the device and user will have no way to control it.

@donaldpipowitch
Copy link

I think you would have to use the regular Android way and declare a AndroidManifest.xml to set permissions.

@Mithgol
Copy link
Contributor

Mithgol commented Apr 19, 2013

@Mithgol
Copy link
Contributor

Mithgol commented Jun 18, 2013

Meanwhile, the nodejs/node-v0.x-archive#5514 patch has been merged into the core of Node.js.

@smolleyes
Copy link

hi

what s up with node-webkit on android ?

thx

@yapcheahshen
Copy link

FYI, here is an attempt to provide a pure javascript development environment for native Apps,
by using V8 on Android and spider-monkey on iOS.
http://sourceforge.net/projects/yaui/

@albi90
Copy link

albi90 commented Aug 26, 2013

Any progress on this?

@tarwin
Copy link

tarwin commented Sep 27, 2013

If it would be possible to get it working, I may be interested in paying someone (a grand or two?) to get this going. Requirements would be that it has WebGL available (ie latest Chrome).

@donaldpipowitch
Copy link

FYI: With the new JS-to-ObjC-Bridge in iOS7 it should be possible to polyfill Node on iOS, so generally it should be possible to do node-webkit on iOS7, too?

@albi90
Copy link

albi90 commented Oct 1, 2013

its definitely possible, i have just converted one of my projects from node-webkit to android using the chromium content shell for android from https://github.com/davisford/android-chromium-view doesent have nodejs but the JS bridge works so i was able to recreate the required nodejs functions in java and pass the information back over the bridge.

@jmorvan
Copy link

jmorvan commented Jan 17, 2014

It would probably need a native app shell and then define a JNI to map webview's js calls to node. (in theory!)

@albi90
Copy link

albi90 commented Jan 17, 2014

You could probably modify webinos, to emulate node-webkit from what I have read its the chromium content shell smashed together with anode.

https://github.com/webinos/webinos-android

Thanks
Albi90

@raitucarp
Copy link

bump

@ghost
Copy link

ghost commented Mar 12, 2014

Very interested in html5 nodejs (node-webkit) for my new android tablet

@kenchris
Copy link

If what you care about is a full-performance Chromium fullscreen window on Android showing your web app, well then I suggest that you look into using Crosswalk (http://www.crosswalk-project.org).

If you really depend on the node.js support, well then you can stop reading here, at least for now :-)

There is even an APK generator here: https://github.com/crosswalk-project/crosswalk-apk-generator.

So what is Crosswalk and does it make sense for you? (some extracts from my upcoming article for html5hub.com)

Crosswalk brings the full performance of Blink/Chromium to web applications on all Android devices from version 4.0 onwards, as well as some additional standards-based web features requested by app developers, such as orientation lock, raw sockets, WebRTC and WebAudio and even WebGL :-)

I guess some readers know that the latest Android (4.4, KitKat) now brings a WebView based on Chrome and Blink, so why not just use that?

Well, the new WebView is only available to people running the latest major version of Android and furthermore, the performance characteristics and features differ somewhat from Chrome, depending on the Android API level used by the embedding application.

This is because the new WebView in KitKat has to match the behavior of the previous WebView to avoid breaking existing applications, which means supporting legacy features, workarounds etc. In some cases this negatively affects layout and performance. In particular canvas performance seems to be hurt and features such as WebGL are left out for now.

As Crosswalk doesn't need this compatibility, it can follow a design very similar to that of the Chrome browser, and it is in fact built on top of Chromium components such as the content module and the Blink engine which makes it blazingly fast and very standards compliant.

@ghost
Copy link

ghost commented Mar 13, 2014

What I would like to do is: Do all my development of Android app's on the tablet (Android OS).
For me this has two advantages:

  1. I don't have to carry around a 4lb laptop.
  2. I don't have to run an android simulator and then reconfirm its
    actual operation in the Android environment.
    Then there is the added time of keeping the simulator in sync
    with the Android OS. And the publishing and transfer between
    the two platforms. Do I really need all of this complication?

@albi90
Copy link

albi90 commented Mar 14, 2014

Hi Guys

If you want i have the latest chromium content shell refracted into an android studio project, i cant take any credit for it, its based on Davis Fords github project (now private), but updated.

just add a javascript bridge to communicate between your java and javascript.

Thanks
Albi90

@jumanja
Copy link

jumanja commented Feb 22, 2016

Hi, Just to add a summary of current (2016) situation :

I practically create an entire app on windows using Node-webkit + HTML5 + sqlite, then I use same exact folder as a base for an android project using the free Intel XDK (https://software.intel.com/es-es/intel-xdk), which uses Cordova. Despite the fact it will not be a native application for Android, it allows me (as per intel-xdx documentation) to publish also in iOS, so practically with NWjs development you now are covering pc, mac, linux, android, iOs. Blackberry is even opening (or already opened, not sure) to publish android apps, so I think we finally have a great option for multi-platform, as you may publish with little changes same app in a web server (node.js) server and connect to a more robust BD (to replace sql) if needed.

Am I right ? or do you guys think we need to wait for more to have a real multi-platform solution ? By the wat, if you want to see app sample is free on google play (hope this will not be considered as spam) here: https://play.google.com/store/apps/details?id=net.LuzEnTuVida (in spanish)

@v3ss0n
Copy link

v3ss0n commented Feb 23, 2016

Our experience with IOS , it is broken. IOS devices do not support many CSS3 features that Material Design Lite won't work. Android is fine tho.

@erikreppen
Copy link

iOS 9+ should support more modern CSS if you use a UIWebkit view controller. Doable in 8 but needs a workaround for loading local files. Also, js performance should be an order of magnitude improved. I'm leaning more hybrid app with handrolled mobile-specific normalization nowadays for apps with basic mobile OS needs. Wrapper quirks and unsupported features are as much to learn/overcome as android/iOS shenanigans in a lot of cases.

@ghost
Copy link

ghost commented May 9, 2016

Wow you are good hero for Smartphones and Tablets!

Very interesting with Android and iOS yeah and where is FirefoxOS, Tizen and BlackArray OS and FreeBSD OS. You know I really miss sometimes node.js and nw.js for FreeBSD - If you have installed FreeBSD / OpenBSD on box than. But FreeBSD is not same Linux because FreeBSD is like so close Darwin ( very unix usable )

For unsupported platform with software-3D ( like old voodoo 3D without graphic cards )
Use only Java Runtime ( Why not )
node.js and nw.js should as *.jar and if your own nw file into jar than you can run jar.

How does sofwtare-3D work? I know it is very slow if you have big 3D project into jar. impossible???

I hope you develop hard

@axinging
Copy link

axinging commented Jul 15, 2016

Hi, I successfully run node on crosswalk for Android(Crosswalk provides an alternative for Android WebView), including native node addon.
If any of you are interested, please refer to:
https://docs.google.com/document/d/1OUCesuzWHHQBoeo4vRWunRQjK06qYtOcP5uKfMY0iA8/

@mQckingbird
Copy link

I'm trying to implement it as well, @axinging
Is that real?
Can I develop a Node.js app inside a Crosswalk Webview and deploy it to Android App Store?
Do I have to be root? Does it have everyone's to be root?

@axinging
Copy link

@matikbird For node js itself, no need to root.
For native addon, if you put the addon inside your apk, then no need to root.

Due to android's limitation, if you want to execute native addon at /data/local/tmp, you need to root your devices.

@mQckingbird
Copy link

mQckingbird commented Jul 30, 2016

That's amazing, I'm still trying to make it work.
Do you have an uploaded example?

I'm speachless. I trully can't believe it's possible.
I mean, if I install, like.. «npm install --save medium-editor» (which's not a native node module, it's fully written in JavaScript), I will be able to do: require('medium-editor') and it would work? (without using browserify, just plain Node.js)

If that happens, you earned yourself a new fan.
Like I said, I'm still trying to make it work, though the guideline it's not very clear.

So far, what I've done to make an hybrid app was:
Install Node.js (and NPM), and then: npm install -g cordova. Then, I added the crosswalk plugin.. but that guide it's like another whole new thing.

If I do what I've always done, I don't think Node will be avaible.
Can you elaborate how it works?
I'll thank you forever. And thanks for the quick reply!

@dalisoft
Copy link

@axinging @matikbird Hi, i'm too interested on this. But i basically not develop mobile or desktop apps, just interest. Let me know if you're done. Thanks.
For iOS (WebApp - From Safari, link to home screen) like native or via "Profile Installation"
For Android (like iOS send to homescreen), just link bar shows (not good).
For WP - IMPOSSIBLE, but via Phonegap can be done (maybe, no NODE, just HTML/CSS/JS)
For BB - Exactly like WP.

@kailniris
Copy link

Just a side note I am using for some time now.
You can install node.js and run it on any android phone.

Steps:
Install Termux from play store.
In Termux use apt install nodejs (it will download and install the arm build for nodejs and npm)
now you can use npm and nodejs

@axinging
Copy link

axinging commented Jul 31, 2016

Will upload a workable apk soon.

I didn’t try npm’s way. I am not sure if npm works on android. Also, for native addon, they are most built for x86.
So for native addon, I bypassed npm, built native module and push it into android devices.
But for js addon, it works on rooted devices. For non-rooted devices, I will verify if it works soon.

For crosswalk cordova, node’s support was not officially support. This was just my personal’s interest.

@mQckingbird
Copy link

«Yes, but I don't want to install Node.js & NPM in my device» ─ The users, everytime I ask them to install my app.

I meant if it was something like Electron, where you can work with Node.js in a development enviroment, and deploy your apps to all users. Access to LevelDB and stuff, fs filesystem (cordova has it, but whatever). I am not sure if my question was understood, I'm sorry.
Now I am more confuse about this.

@axinging
Copy link

axinging commented Aug 1, 2016

You can download apk here: https://github.com/axinging/node4android_demo/tree/master/apks.
Js addon works on non-rooted devices. One js module sample code: https://github.com/axinging/node4android_demo/tree/master/jsmoduledemo
Please put nodeconv.html /sdcard/, and converter.js at /sdcard/node/.

When the apk is started, type: file:///sdcard/nodeconv.html.

@bitnom
Copy link

bitnom commented May 10, 2017

There is a Node for Android now called Dory in the Play Store.

@ghost
Copy link

ghost commented Oct 24, 2017

bump

@IssueHuntBot
Copy link

@loadbalance-sudachi-kun funded this issue with $256. Visit this issue on Issuehunt

@ghost
Copy link

ghost commented Sep 17, 2018

Woah

@IssueHuntBot
Copy link

@rororofff has funded $2.00 to this issue.


@trusktr
Copy link

trusktr commented Feb 4, 2020

My theory is that someone will eventually learn to do something similar to Termux, to find a way to run NW.js (headlessly?) inside an Android application that has a Termux-like environment (basically a Linux/Debian-like environment), and finally pipe the NW.js graphics to an Android Activity (or similar) within the same Android application. Then they'd also need to pipe user events from the Android Activity the other way back to the NW.js instance so it can process them. Maybe there's a better way, but so far that's one way I think is possible.

@trusktr
Copy link

trusktr commented Feb 5, 2020

Apparently people are installing Arch Linux and installing Linux GUI applications inside Termux. https://wiki.termux.com/wiki/Arch

So, the doorways are already open. Someone needs to package it into a convenient helper that takes an NW.js app and bundles it into an app that runs it in that environment. I wonder how GPU support is.

@trusktr
Copy link

trusktr commented Feb 5, 2020

xvfb is available for Termux. termux/termux-packages#626 and https://github.com/termux/x11-packages/tree/master/packages/xorg-server-xvfb

This means that we can run things like NW.js headlessly.

This is a possible high-level list of steps to take:

  • For Termux. https://github.com/termux/termux-app
  • Tweak it so that it has pre-installed any regular Linux requirements for running NW.js
  • Make a script that takes an NW.js app and bundles it into the Android application.
  • Make it so when the Android app starts, it runs the Arch Linux environment (preferably this is installed into the app from a working image, so not always pulling the latest possibly-breaking changes from Arch).
  • And when the Arch Environment starts, it should launch the NW app in full screen mode.

Of course, there will be many smaller details to take into consideration.

Another possibility other than using Arch is to use the WIP termux-x11 stuff, or even some other distro. Whoever does this would probably want to try different approaches to see which works best.

A benefit of wrapping NW.js apps in a Termux- Linux-like environment is that NW.js would itself still only support three OSes. Then this would be a wrapper around NW.js. Making NW.js natively support Android would be more ideal, but that might be more difficult (though I could be wrong).

@UtterDonkey
Copy link

Is this thing still going or has it been given up on? I'm personally quite interested in it.

@baconbrad
Copy link

@UtterDonkey No one is working on this. While the demand is there the devs that can work on such a big endeavor are not. Most developers have prepped their codebase to build using NW.js or Electron for desktop and Cordova for mobile.

@UtterDonkey
Copy link

@baconbrad Okay, thanks for the update!

@nikhilCad
Copy link

can anyone open nw js games with exagear on android?

@ZhymabekRoman
Copy link

can anyone open nw js games with exagear on android?

Use Wine

@TheJaredWilcurt
Copy link
Member

For those looking for an all-in-one way to build for Windows, OSX, Linux, Android, and iOS. I've made a Vue.js boilerplate for the desktop side, which was forked and someone from the NativeScript team added NativeScript to it, so it should be able to build for mobile too. I don't know how well maintained that repo is/will be, but can be a good starting point.

You will need to learn:

  • NW.js
  • NativeScript
  • Vue.js

to be able to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests