Moving Android PWA to Capacitor
0
0
![](https://cdn-images-1.medium.com/max/1024/1*N3f_QwieDTkWHrLO6fEG7A.png)
Previously, we used pwabuilder.com for building the Android app with several limitations:
- Doesn’t support configuring the target API Level
- No control over native code
- No automation
With the PWA v4.7 update, the ADM’s Android app moved to Capacitor.js for:
- Full control of native code
- Ability to run native code (like Push, Camera etc.) using Cordova API
- Code optimization
- Custom plugins
- CI/CD automation
You can download the new version of the Android ADAMANT app from Google Play.
Why Capacitor.js?
ADAMANT Messenger is a step-ahead decentralized messaging platform. Our primary goal is to ensure the app is highly performant, secure, and easy to maintain. Here’s why we chose Capacitor.js:
- Ease of Integration: Capacitor integrates seamlessly with modern web frameworks like Vue.js
- Cross-Platform: Build once and deploy across multiple platforms (iOS, Android, Web)
- Native Functionality: Access to native APIs without sacrificing the web experience
- Community and Support: Active development and robust documentation
Comparison: Native Android, PWABuilder, and Capacitor.js
To understand our choice better, look through this comparison.
Native Android Development
Pros:
- Full access to all Android features and APIs
- High performance and optimized for Android devices
- Granular control over the UI and functionality
Cons:
- Requires knowledge of Java/Kotlin
- Separate codebase for each platform (iOS, Android)
- Time-consuming and higher development cost
PWABuilder
Pros:
- Easy to convert PWA to native app
- Quick deployment with minimal setup
- Good for simple apps with limited native functionality
Cons:
- Limited access to native device features
- Performance may not match fully native apps
- Dependent on third-party service for conversion
Capacitor.js
Pros:
- Cross-platform with a single codebase
- Access to native APIs and plugins
- Modern web development tools and frameworks support
- Active community and continuous updates
Cons:
- Slight learning curve if unfamiliar with web-native bridges
- Some native functionality might still require custom plugins
Technical implementation
We build the Android app natively using Capacitor.js and Github Actions:
- Added GitHub Actions workflow
- Added Capacitor configuration
- Added Manifest files
- Included Splash screen images and app icons
- Wrote a build script
You can revise the full changes in the Pull request.
Moving Android PWA to Capacitor was originally published in ADAMANT on Medium, where people are continuing the conversation by highlighting and responding to this story.
0
0