Giter Club home page Giter Club logo

template-android's Introduction

Template Android

This project is a template for an android project that used the following libraries 👇

  • Navigation (Fragment transitions)
  • View Binding (Bind views)
  • ViewModel (Store and manage UI-related data)
  • LveData (Observable data)
  • Kotlin Coroutine (Light-weight threads)
  • Dagger2 (Dependency Injection)
  • Hilt (Dependency Injection for Android)
  • Retrofit (HTTP client)
  • Multi Module App
  • Mockito
  • Compose
  • Room
  • KotlinDsl

It is also configured to work with compose and dynamic modules

Refactoring

In order to change the versions and dependencies access the buildSrc module. It contains everything related to versions and packages names

Modules

The project contains the following base modules:

  • App ( Initial module with the main activity of the project. Because single activity was used on the project )
  • Base ( Contains the navigation between the UI modules and generic classes )
  • Data ( Used for making request to the API and the the local BD)
  • Model ( Declares all the entities used in the project )
  • ⚠ For the UI you are supposed to build new modules that can be dynamic or a feature module

Architecture

This app was build using MVVM and following the guidelines explain here. This app also makes use of the pattern single activity.

All the transitions for the app where made using Navigation

Run the app locally

As the app makes usd of dynamic modules in order to test it locally you need to generate a universal version containing all the modules. The following commands allow to generate the apk 👇

//Windows
gradlew :app:packageDebugUniversalApk
//Mac/linux
./gradlew :app:packageDebugUniversalApk

🚨 Dependency Issues

List of issue related to version of dependecies and limitations

  • Compose navigation dont not allow to use dynamic modules natively- Google issue here

Sources

Testing 🧪

  • data:api -> network client test
  • data:database -> read and write instrumented test
  • base: -> viewmodel functions test
  • feature:feed -> viewmodel functions test ...

Tagging ( AndroidJUnit4 )

in case of unit test remember to use the tag @SmallTest for integrated test @MediumTest and for UI test @LargeTest

Author

Licence

Copyright 2021 Renato Mercado.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Stuff to do 👨‍🏭

  • add a widget that shows a different quote each day to the the user making use of the new API for android 12 also this needs to use the preview view for widgets and the device template
  • also widgets can interact with audio should I added ?
  • automate test when all module test complete
  • rearrange modules as in minimise app https://github.com/hitherejoe/minimise ( such as design module )

template-android's People

Contributors

merren22 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.