For syncing project structure and frameworks, a case for using Redux
As a software development agency, Oursky handles many simultaneous projects that include mobile and web apps, code diagnostics, and research projects to name a few. In order to allow team members to initialize or switch projects efficiently, the team uses the Redux framework for web apps. However the multiple states problem not only happens on web platforms, but is also common in apps. That’s why we also extended the Redux pattern to platforms such as iOS and Android and built an Android skeleton for our internal use.
There are boilerplates for Redux Web projects, but when it comes to Android, it’s less trivial. That’s why we created an in-house standard template for Android apps that also comes with a simple NodeJS backend minimal set up with Docker.
Disclaimer: Not all Oursky engineers agree with the Redux pattern. Some may use VIPER, MVVC, MVC. Still, Redux is great for syncing a single project across different platforms.
We’ve opensourced our GitHub repository includes 3 skeletons, including templates for
- Android Kotlin Project
- Android Java Project
- NodeJS backend
The template includes recommended libraries from Oursky’s engineers to handle daily operations in Android app development.
Initializing apps are standard but repetitive, so…
If you’re still wondering why we did this, below are some reasons:
- Kickstarting a bootstrap project is faster with a template
- Fits into our CI and testing workflow
- Enforces and stantardizes the lint rules
- Includes recommended libraries by default
- Custom fonts: Included
android.support.v4.content.res.ResourcesCompat
, so that developers can load Typeface (such as .ttf)easy withhelper.font(fontName)
- Localization: Initialized strings.xml a few localizations (EN, CN, HK and TW). It makes localization supported by default.
- Fresco: nearly every app needs image management. Fresco is a Facebook library for fetching and caching images on Android platform efficiently.
- Flexbox: Google flexbox library brings a CSS-like flexbox layout to Android. It helps our developers to create views with custom sizes and arrange them with less hassle.
- Custom fonts: Included
What’s included in the repo?
So here’s the list of features and supports implemented:
Android-java:
- lint rules
- i18n with
string.xml
- Custom font with
ResourcesCompat.getFont(context, fontId);
- Redux store with Reductor, RxAndroid, RxJava
- Navigation with Conductor
- Fresco
- Flexbox
- A dummy webclient workflow with login action
Android-kotlin:
- lint rules and ktlint
- i18n with
string.xml
- Custom font with
ResourcesCompat.getFont(context, fontId)
- Redux store with redux-kotlin, RxAndroid, RxJava, RxKotlin
- Navigation with Conductor
- Fresco
- Flexbox
- A dummy webclient workflow with login action
Backend-nodejs
- lint rules
- standard package
- Typescript
- docker with redis & mysql
Your turn! How did you use this in your project?
Follow the guides in Our GitHub repository https://github.com/oursky/skeleton
For the Android skeletons, you can copy and use the whole project in skeleton/android-java
or skeleton/android-kotlin
, and modify the app name, manifest and build configuration to your new app. Don’t forget to rename the package name (it comes with com.oursky.skeleton) to your own as well.
There are also many great things to be included in the standard kit, such as Buddybuild or Travis CI for Continuous Integration. Do you have any must-have starter libraries? Let us know – or send us a Pull Request directly!
Building an app? Our free developer tools and open source backend will make your job easier.