Giter VIP home page Giter VIP logo

vmadalin / android-modular-architecture Goto Github PK

View Code? Open in Web Editor NEW
2.4K 99.0 388.0 97.62 MB

๐Ÿ“š Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Home Page: https://proandroiddev.com/android-components-architecture-in-a-modular-word-7414a0631969

License: Apache License 2.0

Kotlin 99.83% Shell 0.17%
kotlin clean-architecture clean-code testing component-architecture architecture solid-principles mvvm-architecture android-architecture android

android-modular-architecture's Introduction

Cover

Hi, I'm Madalin ๐Ÿ‘‹

The Programming and Computer Science are my passions. I'm a Mobile Software Developer with over 6 years of experience. Enthusiast on clean, modular and components architecture, focused on make software design more understandable, maintainable, scalable, robust, and last and not least testable. Applying design patterns, SOLID principles and good practices, making the code not only to compile.

I love collaborating with open source, keep me update with the community tendencies, writing technical articles, make personal projects and participating in hackathons or any type of challenges.

Honors & Awards:

Stats:

GitHub stats

Personal info:

LinkedIn Twitter Medium Website

android-modular-architecture's People

Contributors

rvasseur31 avatar vmadalin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-modular-architecture's Issues

How to create a release apk that can be installed on device

Description

I'm trying to use this project as a sort of bootstrap for a new android project, when a signed release apk is created by android studio and installed it crashes instantly due to being unable to find the dynamic module fragments.

Basic Information

  • OS version: Linux
  • App version: android studio 3.5.3

Details

Using android studios Build -> generate signed apk -> normal apk
If you install that generated apk it will crash with a classpath issue with Coil, if you fix that (I added it to core's dependencies) then you get

Process: com.vmadalin.android, PID: 18602
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vmadalin.android/com.vmadalin.android.SampleMainActivity}: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class fragment
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3430)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
        at android.os.Handler.dispatchMessage(Handler.java:112)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7625)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
     Caused by: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class fragment
     Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class fragment
     Caused by: androidx.fragment.app.Fragment$e: Unable to instantiate fragment com.vmadalin.dynamicfeatures.home.ui.HomeFragment: make sure class name exists

I assumed as all dynamic modules are set to install time delivery a monolith apk should work. I also tried creating an aab, using bundletool to create a universal apk and installing that but I ended up with the same error.

What is the correct way to do a release APK?

Migrating from Fabric to Firebase

Description

I wanted to request that you migrate your code from Fabric to Firebase.

Basic Information

  • Device type: Android
  • OS version:
  • App version:

Build process

Hi,

I am not able to build this project in Android Studio 3.5.2

It doesn't seem to trigger the build in the right order and the order is not clear from your instructions. Do i need to initiate a gradle build manually for the modules in the right order ?

If so, that is the order and the suggested command ?

Thanks

No cancellation method for coroutines

First off all, thank you for this great repository with latest Android frameworks. I noticed that there is no cancel call for coroutine scopes. Is this caused for memory leaks?

[ClassNotFoundException] Release build crashing

Description

After running assembleRelease gradle task and installing app-prod-release.apk/app-dev-release.apk the app is crashing with below exception.
I suspect the proguard-rules.pro should contain a keep rule for "coil.util.CoilContentProvider"

[Edit]
add
-keep class coil.util.CoilContentProvider
to proguard-rules.pro file in ":commons:ui"

add
consumerProguardFiles("proguard-rules.pro")
to defaultConfig in buildSrc package commons

does not resolve the issue.

Basic Information

  • Device type: Pixel 3a emulator
  • OS version: Android 10 (Api 29)
  • App version: 1.0

Details

2020-10-05 15:03:00.786 13091-13091/com.vmadalin.android.dev E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.vmadalin.android.dev, PID: 13091
    java.lang.RuntimeException: Unable to get provider coil.util.CoilContentProvider: java.lang.ClassNotFoundException: Didn't find class "coil.util.CoilContentProvider" on path: DexPathList[[zip file "/data/app/~~jPJiP2XBCKXTWxQ3bLufAA==/com.vmadalin.android.dev-1EJOzTC0mWHGgspZplp8Yg==/base.apk"],nativeLibraryDirectories=[/data/app/~~jPJiP2XBCKXTWxQ3bLufAA==/com.vmadalin.android.dev-1EJOzTC0mWHGgspZplp8Yg==/lib/x86, /system/lib, /system_ext/lib]]
        at android.app.ActivityThread.installProvider(ActivityThread.java:7244)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:6780)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6697)
        at android.app.ActivityThread.access$1300(ActivityThread.java:237)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "coil.util.CoilContentProvider" on path: DexPathList[[zip file "/data/app/~~jPJiP2XBCKXTWxQ3bLufAA==/com.vmadalin.android.dev-1EJOzTC0mWHGgspZplp8Yg==/base.apk"],nativeLibraryDirectories=[/data/app/~~jPJiP2XBCKXTWxQ3bLufAA==/com.vmadalin.android.dev-1EJOzTC0mWHGgspZplp8Yg==/lib/x86, /system/lib, /system_ext/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.AppComponentFactory.instantiateProvider(AppComponentFactory.java:147)
        at androidx.core.app.CoreComponentFactory.instantiateProvider(Unknown Source:0)
        at android.app.ActivityThread.installProvider(ActivityThread.java:7228)

Repository is not glued to Interface

Thank you for the great sample. I wonder why You do not have an interface for MarvelRepository or any other Repositories in your core module. You are following SOLID principles, and that is D is SOLID to follow dependency inversion.

High-level modules should not depend on low-level modules. Both should depend on abstractions (e.g., interfaces)

Using interfaces will also simplify unit testing.

Were there any specific reason that you did not use interface for Repository?

Question about code coverage

Description

Can you elaborate on how you exclude the app directory from your code coverage in codecov?

Basic Information

  • Device type: Android
  • OS version:
  • App version: latest

Details

I see that in your diagram you don't have things like SampleMainActivity tested because they are excluded from the graph?

image

I was wonder how you did this because I see no ignore flags in your codecov/config.yml nor are there any exclusions in your jacoco configurations, at least that I can find!

Thanks!

[KaptException] Can't get project to build

Description

I can't get the project to build. Please see below stack trace.
Any idea on how to solve this issue?
Thanks null

Basic Information

  • Device type: -
  • OS version: -
  • App version: 1.0

Details

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':commons:ui:kaptDevDebugKotlin'

........

Caused by: java.util.ServiceConfigurationError: javax.annotation.processing.Processor: android.databinding.annotationprocessor.ProcessDataBinding Unable to get public no-arg constructor
	at kotlin.collections.CollectionsKt___CollectionsKt.toCollection(_Collections.kt:1155)
	at kotlin.collections.CollectionsKt___CollectionsKt.toMutableList(_Collections.kt:1188)
	at kotlin.collections.CollectionsKt___CollectionsKt.toList(_Collections.kt:1179)
	at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.doLoadProcessors(ProcessorLoader.kt:80)
	at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.loadProcessors(ProcessorLoader.kt:45)
Caused by: java.util.ServiceConfigurationError: javax.annotation.processing.Processor: android.databinding.annotationprocessor.ProcessDataBinding Unable to get public no-arg constructor

	at org.jetbrains.kotlin.kapt3.base.Kapt.kapt(Kapt.kt:42)
	... 29 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
	... 35 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
	... 35 more

Material Theming Issues in Modules

Material Theming Issues in Modules

After adding Material theming, the dynamic libraries don't pick the custom theme.

Details

Add

theme.xml
type.xml
shape.xml

Reference Custom Theme in theme.xml in one of the module.
Rebuild and run the app.
Theme doesn't not reflect.

Why not Hilt?

Why don't you use Hilt? Google says

Dagger and Hilt code can coexist in the same codebase. However, in most cases it is best to use Hilt to manage all of your usage of Dagger on Android.

I don't understand how id(BuildPlugins.NAVIGATION_SAFE_ARGS) works

Description

Trying to use this as the base for a new project, but I can't get past this line in app/build.gradle.kts

    id(BuildPlugins.NAVIGATION_SAFE_ARGS)

I get the following error when syncing gradle files

org.gradle.internal.exceptions.LocationAwareException: Build file '/home/calin/Projects/reasig/android/app/build.gradle.kts' line: 1
Plugin [id: 'androidx.navigation.safeargs.kotlin'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:214)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$resolvePluginRequests$4(DefaultPluginRequestApplicator.java:146)
	at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:207)
	at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:201)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolvePluginRequests(DefaultPluginRequestApplicator.java:144)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:84)
	at org.gradle.kotlin.dsl.provider.PluginRequestsHandler.handle(PluginRequestsHandler.kt:48)
	at org.gradle.kotlin.dsl.provider.StandardKotlinScriptEvaluator$InterpreterHost.applyPluginsTo(KotlinScriptEvaluator.kt:198)
	at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost.applyPluginsTo(Interpreter.kt:360)

Dependency Generator generates tasks in every module

Description

Dependency Generator generates tasks in every module resulting graph is generated in every module build, I think its better to keep it lean and generate task only on rootProject

and also it'd be awesome if we could add custom generator task that has local module filter

Basic Information

  • Device type:
  • OS version:
  • App version:

Details

Question about using plugin in the id of plugins

Description

In regards to this project it is a great learning tool and I was curious to walk through it! My question is in the BuildPlugins file you set all the plugins to use plugins.xxxx. for example BuildPlugins.detekt, yet when I try to build it says that it cannot find a plugin with an id plugin.detekt. But if I use the following: io.gitlab.arturbosch.detekt it is found and moves to the next error in the build. Can you elaborate on that?

Thank you so much

Possible Build Failure

https://github.com/VMadalin/kotlin-sample-app/blob/3df81dd8c557a2cf787df9a0dbd4722e5aab3a3d/commons/views/src/main/kotlin/com/vmadalin/commons/views/ProgressBarDialog.kt#L62

As per the source code:

 /**
     * Returns a localized string from the application's package's
     * default string table.
     *
     * @param resId Resource id for the string
     * @return The string data associated with the resource, stripped of styled
     *         text information.
     */
    @NonNull
    public final String getString(@StringRes int resId) {
        return getResources().getString(resId);
    }

I guess calling the line viewBinding.message = context.getString(messageRes) will result in build failure.

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.