"Write once, run anywhere"
Alternatives:
Why?
Web App | Native Mobile | Desktop App | |
---|---|---|---|
Perfomance | ✘ | ✔ | ✔ |
Offline | ✘ | ✔ | ✔ |
Time to first click | ✘ | ✔ | ✔ |
Rapid Updates | ✔ | ✘ | ✔ |
Mobile | ✔ | ✔ | ✘ |
Platforms | x4 | x2 | x2 |
Reach | 100% | 60% | 40% |
Skills required | x1 | x2 | x2 |
Budget | x1 | x2 | x2 |
Universal Hybrid App |
---|
✔ |
✔ |
✔ |
✔ |
✔ |
x4 |
100% |
x1 |
x1 |
# Setup
mkdir MyApp
cd MyApp
electron-cli init MyApp
mv MyApp desktop
cordova create MyApp com.dofinity.myapp
mv MyApp mobile
mkdir src
mkdir web
ln -s src desktop/www
ln -s src mobile/www
ln -s src web/app
# Build
cd desktop
electron-build -mlw
cd ../mobile
cordova build
MyApp/
- desktop/ // Electron
-- dist/ // Binaries
-- www/ // Symlink to src
-- ...
- mobile/ // Cordova
-- platforms/android/build/outputs/apk // Binaries
-- www/ // Symlink to src
-- ...
- web/ // Web
-- app/ // Symlink to src
- src/ // App code
App: Math Addict
Web
Binaries