Electron on iOS / Android?


#1

My apologies for this newbie type of question but i couldn’t find anything definitive on the subject. Are there any plans to make Electron apps run on iOS / Android? Thank you!


#2

There haven’t been any official statements of plans of that kind that I’ve seen, no.


#3

There has been some discussion on that topic though, but since the Node support on mobile is still a bit shaky, it hasn’t been looked at in seriousness yet.


#4

Taking in consideration that the iOS store prohibits the use of a different browser engine (chrome is just a GUI on top of the iOS webkit), I doubt this can be achieved as it is in that platform.


#5

Yeah, that sucks to no end.
But at least Android should be able to get Atom’s magic, sooner or later.

Has anyone tried JXCore? It should be Node compatible, and ready for Android.


#6

Considering we can now side load apps and most people using Atom could probably figure out how to side load a Xcode project, would it be a bad idea to develop it and just let people download it and side load it.


#7

Hey, I actually came in from the other side. I built an iOS and Android app using ionic and have had great success converting them to desktop apps using electron. Things just worked.
https://github.com/pliablepixels/zmNinja (scroll down for desktop app links)


#8

Can you add a little more detail to this? Did you take your Ionic app as-is and compile it with Electron? Were there any conversion steps at all?


#9

Happy to.
The desktop preparation script is here https://github.com/pliablepixels/zmNinja/blob/master/make_desktop.sh

Overall process:
a) I downloaded the electron packages from here and unzipped them to a directory

b) As per their instructions, I have a main.js and packages.js for my app . The main.js was modified to make it work reliably on my mac - but its the same file for all ports

c) In my main ionic code, I had to find alternatives to cordova plugins (as they don’t exist in desktop land). An example is here - where I see if window.cordova exists (device) and do something vs. a diff. action on desktop. Or take this example (a better one), where I am saving an image of a live feed to my disk. If its mobile, I am using a cordova plugin, if its desktop, I’m using a different JS plugin (canvas2plugin)

d) And then the “make desktop” script just copies the files inside the resource directory of the electron package, and then to keep it pretty, packs the app into an “asar” archive - which is not necessary, but I like doing it - it also avoids newbie fiddlers from meddling with the code.

Hope this helps.


#10

Nice, great stuff. Thanks for sharing!


#11

@leedohm
In two or three weeks Android will officially run on desktops as ChromeOS is getting extended. Official support would be a good opportunity to run Electron apps on there.


#12

Most likely, Native Script may help you integrate it with iOS/Android.


#13

I actually build my Electron apps in Cordova (targetting the ‘browser’ platform), and maintain a file in my project that sets a bunch of functions that Cordova fulfils using plugins and Electron fulfils using Node.


#14

can you tell me more details? im trying to do the same here


#15

There are still no plans to make Electron run on iOS or Android.


#16

If you’re talking particularly about a Cordova/Electron app, what kind of information are you after?
My app is Cordova-first, so it’s structured as a standard Cordova app, I build out to the browser platform and build my Electron builds from the output (although there is an Electron platform which I’ve not used yet).

Then for both Cordova and Electron, I have a JS file that wraps all native functions (either Cordova plugins or Node libraries), so that I can use a single set of functions reliably across both Cordova and Electron.


#17

There is chrome and node.js on Android.
Why not support Android first?
Cordova, ionic, appcan, mui, even Xamarin will all not be the right way to develop mobile app if we have Electron to do this.


#18

I’m not sure I understand your logic, @taoqf.

How do you think an Android version of Electron would differ from Cordova? It’s still a Chromium WebView wrapped in a native shell with native functionality. I can’t see what reason there would be for this to be the ‘wrong’ way.

Honestly, while you might be able to use Node on Android, I’m not convinced you could use it in the way that you’d want, at least as easily as you’d like, as it’d likely require polyfilling Node modules to fit the Android ecosystem.

At the root of it, it’s out of Electron’s scope and it’s definitely outside of Atom’s.


#19

With termux https://termux.com/ we can install nodejs on android https://www.youtube.com/watch?v=lnlH_yvYwE0
Could it be possible to wrap in a unique app, termux, nodejs a server and a webview which comunicates with the server to call the functions of nodejs? In this way we would use the node library instead of cordova plugin and then major portable code written for electron app.


#20

Would be amazing with the upcoming Samsung Galaxy S8 , Windows Mobile Continuum clone. I mean there is no serious IDE for android.

This would also enable electron / the IDEs to run on chromebooks through the android runner