Giter Site home page Giter Site logo

androidstarters / android-starter Goto Github PK

View Code? Open in Web Editor NEW
512.0 27.0 68.0 1.88 MB

[Android Architecture] Android starter based on MVP/Dagger2/RxJava2/Robolectric/Espresso/Mockito. It provides a generator to fast create a Android template project.

Home Page: https://git.io/v9UjE

Java 97.29% Shell 2.71%
android findbugs robolectric pmd espresso architecture mockito checkstyle rxjava mvp-architecture

android-starter's Introduction

AndroidMvpStarter Build Status

Backers on Open Collective Sponsors on Open Collective Android Arsenal Join the chat at https://gitter.im/android-starter/Lobby

An MVP Boilerplate to save me having to create the same project over from scratch every time! :)

This project uses:

Create new project using yeoman generator-android-mvp-starter

npm install -g yo
npm install -g generator-android-mvp-starter
mkdir NewApp && cd $_
yo android-mvp-starter

Building

To build, install and run a debug version, run this from the root of the project:

./gradlew app:assembleDebug

Testing

To run unit tests on your machine:

./gradlew test

To run instrumentation tests on connected devices:

./gradlew connectedAndroidTest

Code Analysis tools

The following code analysis tools are set up on this project:

./gradlew pmd
./gradlew findbugs
./gradlew checkstyle

The check task

To ensure that your code is valid and stable use check:

./gradlew check

Jacoco Reports

Generate Jacoco coverage reports for the Debug build. Only unit tests.

app:testDebugUnitTestCoverage

Generate Jacoco coverage reports for the Release build. Only unit tests.

app:testReleaseUnitTestCoverage

Generate Jacoco coverage reports for the Debug build. Both unit and espresso tests.

app:unitAndEspressoDebugTestCoverage

Generate Jacoco coverage reports for the Release build. Both unit and espresso tests.

app:unitAndEspressoReleaseTestCoverage

Created & Maintained By

Ravindra Kumar (@ravidsrk)

If you found this repo helpful or you learned something from the source code and want to thank me, consider buying me a cup of โ˜•

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! ๐Ÿ™ [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

MIT License

Copyright (c) 2017 Ravindra Kumar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

android-starter's People

Contributors

adityaladwa avatar gitter-badger avatar hynekslahunek avatar ravidsrk avatar revedko avatar shivamdev31 avatar tranngoclam avatar xdamman 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

android-starter's Issues

Using all these components into a full application

Hi guys,
I applaud you for the great work u are doing. Repo looks good.
However, it seems overwhelming and has many corners that at times seem confusing to use together into a single, fully fledged android app.
Is there an example or a tutorial on how i can use these amazing architecture and components into an android application?

No proguard rules

There are bunch of libraries and there are no proguard rules for them.

Execution failed for task ':app:checkstyle'.

Detail stack trace below

Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:checkstyle'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) Caused by: : Unable to create Root Module: config {/Users/harshitaahuja/Downloads/android-starter-develop/config/quality/checkstyle/checkstyle-config.xml}, classpath {null}. at com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.createRootModule(CheckstyleAntTask.java:429) at com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.realExecute(CheckstyleAntTask.java:312) at com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.execute(CheckstyleAntTask.java:295) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:78) at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:479) at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:191) at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:160) at org.gradle.api.internal.project.antbuilder.AntBuilderDelegate.nodeCompleted(AntBuilderDelegate.java:118) at org.gradle.api.plugins.quality.internal.CheckstyleInvoker$_invoke_closure1.doCall(CheckstyleInvoker.groovy:58) at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:71) at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:53) at org.gradle.api.internal.project.antbuilder.DefaultIsolatedAntBuilder$2.execute(DefaultIsolatedAntBuilder.java:152) at org.gradle.api.internal.project.antbuilder.DefaultIsolatedAntBuilder$2.execute(DefaultIsolatedAntBuilder.java:134) at org.gradle.api.internal.project.antbuilder.ClassPathToClassLoaderCache.withCachedClassLoader(ClassPathToClassLoaderCache.java:134) at org.gradle.api.internal.project.antbuilder.DefaultIsolatedAntBuilder.execute(DefaultIsolatedAntBuilder.java:128) at org.gradle.api.internal.project.IsolatedAntBuilder$execute$0.call(Unknown Source) at org.gradle.api.plugins.quality.internal.CheckstyleInvoker.invoke(CheckstyleInvoker.groovy:51) at org.gradle.api.plugins.quality.Checkstyle.run(Checkstyle.java:153) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:780) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:747) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92) ... 29 more Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - Property 'maxLineLength' in module LeftCurly does not exist, please check the documentation at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:464) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:186) at com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.createRootModule(CheckstyleAntTask.java:426) ... 61 more Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property 'maxLineLength' in module LeftCurly does not exist, please check the documentation at com.puppycrawl.tools.checkstyle.api.AutomaticBean.tryCopyProperty(AutomaticBean.java:213) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:179) at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:170) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:186) at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:459) ... 63 more

Errors when opening the generated project in Android Studio 2.3.3

Hello,

It seems the generated project is not compatible with Android Studio 2.3.3. Error is:

Android Gradle plugin 3.0.0-alpha5 must not be applied to project {project path} since version 3.0.0-alpha5 was already applied to this project.

After modifying build.gradle to use:
classpath 'com.android.tools.build:gradle:2.3.3' instead, I got more errors.

Broken imports in yo android-mvp-starter bundle

Created a new project using yo android-mvp-starter and ran into some issues with a broken imports.

data/remote/MvpStarterServiceFactory
It still has an import for com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
which should be importing retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory instead

util/NetworkUtil
has import for com.jakewharton.retrofit2.adapter.rxjava2.HttpException
which should be retrofit2.HttpException

Looks to be fixed in the source code here, just needs an update in the yeoman bundle.

recreate fragment view error when onbackpress

when fragment onBackpress to previous fragment that fragment is recreate view how to handle that issuse .

coz i want to use fragment share element transaction with imageview from fragment to fragment !

Cannot resolve symbol DaggerTestComponent

Hi,
Firstly , thanks for such a wonderful boilerplate generator with all the useful libraries.
When I tried creating and download the codebase from android starters , it shows me error "cannot resolve symbol DaggerTestComponent in the com(test)-> common-> injection -> TestComponentRule class . Have tried various things in SO for overcome this but could not fix . Please help . Thanks in advance.
reference screenshot:
https://imgur.com/a/XFLgmj3
https://imgur.com/a/XFLgmj3

Jo

Could not read script '/path/to/project/app/dependencies.gradle' as it does not exist.

Hi guys,
First Thanks for this great tool for generating Android project.

I'm new on it and just generate one project and face error when building it in command line and also via Android Studio

That is the output:

FAILURE: Build failed with an exception.

  • Where:
    Build file '/path/to/project/app/build.gradle' line: 98

  • What went wrong:
    A problem occurred evaluating project ':app'.

Could not read script '/path/to/project/app/dependencies.gradle' as it does not exist.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Don't know how to bypass it, please.
Thanks in advance.

Firebase

I'm unable to initialize Firebase in this boilerplate.
Error is Make sure to call FirebaseApp.initializeApp(Context) first

Looks like I'm unable to call the FirebaseApp.initializeApp(Context) in the main process.
So far I tried in

  • MainActivity
  • Application class (myName extends Application)

I'm completely unable to use any Firebase-enabled service.

Please help

Contribution guide

Hello! There is no contribution guide. How can I setup the project if I want to contribute.

Unable to inject SharedPreferences.

PreferencesHelper is not actually used anywhere in the project so the app compiles just fine, but try to inject it or SharedPreferences anywhere and you'll get compilation error:

Error:(22, 17) error: android.content.SharedPreferences cannot be provided without an @Provides-annotated method.
android.content.SharedPreferences is injected at...

Base Fragment usage

can you please provide example on fragment , the sample contain only activities , so what is the best practices to use fragment ??

Configuration change issue

Among different choices of MVP boilerplate template

  1. official android architecture todo-mvp-dagger
  2. mindorks mvp-architecture
  3. marvel villians and heroes
  4. Dribble just-another-android-app

I found your project most simple and easy to understand.

I am deciding to change my production app to follow your project, but there is 1 issue I found.

On orientation change, the state is not retained, Activity is performing network operation again, which is incorrect

Could you please fix that issue in this template.

And is it possible to add Navigation View and View Pager if possible.

Thanks

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.