All Projects → vestrel00 → Business Search App Java

vestrel00 / Business Search App Java

Licence: apache-2.0
Showcases object oriented programming in Java, Java Swing, Kotlin, and Android

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Business Search App Java

Android-Starter-Kit
This is up-to-date android studio project for native android application, that is using modern tools and libraries.
Stars: ✭ 16 (-69.81%)
Mutual labels:  mvp, clean-architecture, dagger2, butterknife, rxjava2, retrofit2
Mvpframes
整合大量主流开源项目并且可高度配置化的 Android MVP 快速集成框架,支持 AndroidX
Stars: ✭ 100 (+88.68%)
Mutual labels:  rxjava2, dagger2, mvp, retrofit2, butterknife
Androidstarter
A sample Android app using the MVP architecture.
Stars: ✭ 140 (+164.15%)
Mutual labels:  jackson, dagger2, mvp, retrofit2, butterknife
Base Mvvm
App built to showcase basic Android View components like ViewPager, RecyclerView(homogeneous and heterogeneous items), NavigationDrawer, Animated Vector Drawables, Collapsing Toolbar Layout etc. housed in a MVVM architecture
Stars: ✭ 18 (-66.04%)
Mutual labels:  rxjava2, rxandroid2, dagger2, mvvm, retrofit2
Kotlin Android Mvp Starter
Create/Generate your kotlin MVP projects easily
Stars: ✭ 270 (+409.43%)
Mutual labels:  rxjava2, rxandroid2, dagger2, mvp, retrofit2
Crazydaily
[开源项目] 一款程序员日常放松的App,基于Material Design + MVP-Clean + Weex + Flutter + RxJava2 + Retrofit + Dagger2 + Glide + Okhttp + MTRVA + BRVAH + 炫酷控件 + 炫酷动画
Stars: ✭ 294 (+454.72%)
Mutual labels:  rxjava2, dagger2, mvp, clean-architecture, retrofit2
Dagger2
Kotlin Dagger2 example project
Stars: ✭ 145 (+173.58%)
Mutual labels:  rxjava2, rxandroid2, dagger2, retrofit2, butterknife
Clean Marvel Kotlin
This repository contains a detailed sample app that implements Clean architecture and MVP in Kotlin using RxJava2, Retrofit
Stars: ✭ 27 (-49.06%)
Mutual labels:  travis-ci, mvp, clean-architecture, dagger2, retrofit2
Weather-Guru-MVP
Sample Material-design Android weather application build with MVP architectural approach using Dagger2, RxJava2, Retrofit2, Event-Bus, GreenDao, Butterknife, Lottie etc.
Stars: ✭ 15 (-71.7%)
Mutual labels:  mvp, dagger2, butterknife, rxjava2, retrofit2
GithubApp-android-architecture
Let's learn a deep look at the Android architecture
Stars: ✭ 16 (-69.81%)
Mutual labels:  mvp, clean-architecture, dagger2, rxjava2, retrofit2
Android tmdb clean architecture
Showcase of clean architecture concepts along with Continuous Integration and Development for modular Android applications. Includes test suits (functional and unit tests) along with code coverage.
Stars: ✭ 63 (+18.87%)
Mutual labels:  dagger2, mvp, clean-architecture, travis-ci, retrofit2
Offlinesampleapp
Sample Offline-First MVVM app that uses Android Priority Job Queue, Room, Retrofit2, LiveData, LifecycleObserver, RxJava2, Dagger Android
Stars: ✭ 653 (+1132.08%)
Mutual labels:  rxjava2, mvvm, clean-architecture, retrofit2, butterknife
BakingApp
Udacity Android Developer Nanodegree, project 2.
Stars: ✭ 54 (+1.89%)
Mutual labels:  dagger2, butterknife, rxjava2, retrofit2, rxandroid2
Mvvmarms
Android MVVM Architecture Components based on MVPArms and Android Architecture Components.
Stars: ✭ 425 (+701.89%)
Mutual labels:  rxjava2, rxandroid2, dagger2, mvvm, retrofit2
Bestnote
👊 持续更新,Java Android 近几年最全面的技术点以及面试题 供自己学习使用
Stars: ✭ 841 (+1486.79%)
Mutual labels:  gradle, rxjava2, dagger2, mvp, retrofit2
Android Mvp Mvvm Flytour
🔥🔥🔥 FlyTour是Android MVVM+MVP+Dagger2+Retrofit+RxJava+组件化+插件组成的双编码架构+双工程架构+双语言Android应用开发框架,通过不断的升级迭代该框架已经有了十个不同的版本,5.0之前工程架构采用gradle配置实现组件化,5.0之后的工程架构采用VirtualAPK实现了插件化,5.0之前采用Java编码实现,5.0之后采用Kotlin编码实现,编码架构由MVVM和MVP组成,工程架构和编码架构及编码语言开发者可根据自己具体的项目实际需求去决定选择使用,该框架是Android组件化、Android插件化、Android MVP架构、Android MVVM架构的集大成者,帮助你快速的搭建自己的App项目开发框架,以便把主要的精…
Stars: ✭ 2,948 (+5462.26%)
Mutual labels:  rxjava2, dagger2, mvvm, retrofit2
Mvp Dagger2 Rxjava2
Android 基本mvp+dagger(dagger2.android)+rxjava2+retrofit+ormdb框架。简单组件化架构 with Base Activity,Presenter ,View,Model 的抽象封装,http 请求封装&错误统一处理
Stars: ✭ 274 (+416.98%)
Mutual labels:  rxjava2, dagger2, mvp, retrofit2
UTair-MVP-Sample
Android Clean Architecture + MVP Sample written in Kotlin
Stars: ✭ 27 (-49.06%)
Mutual labels:  mvp, clean-architecture, dagger2, rxjava2
Kotlin Android Mvvm Starter
Android Kotlin Starter is a starter project which implements MVVM Pattern.
Stars: ✭ 276 (+420.75%)
Mutual labels:  rxjava2, dagger2, mvvm, retrofit2
Stocker
Stocker is a currency monitoring app. It offers instant currency rates of banks.
Stars: ✭ 38 (-28.3%)
Mutual labels:  dagger2, mvvm, clean-architecture, retrofit2

Build Status

IMPORTANT!

  1. THE ONLY PRESENTATION APPLICATION THAT IS FULLY FUNCTIONAL IS presentation-java-nogui-mvp
  2. THE ANDROID APPLICATION presentation-java-android-mvp IS RUNNABLE BUT NOT YET FEATURE COMPLETE.
  3. THIS PROJECT IS UNDER HEAVY DEVELOPMENT. BY NO MEANS IS IT CLOSE TO DONE.
  4. COMMITS HAVE BEEN PUSHED DIRECTLY INTO THE DEVELOP BRANCH INSTEAD OF THROUGH PULL REQUESTS.
  5. DEVELOP BRANCH COMMIT HISTORY IS EXTREMELY DIRTY.
  6. ONCE "COMPLETED", ALL CODE WILL BE RE-DONE PROPERLY WITH FEATURE BRANCHES, ISSUES, AND PULL REQUESTS.
  7. AT THAT POINT ALL WORK WILL BE LOGGED IN DOCS/DEVELOPMENT_LOGS.MD AND MERGED THROUGH WELL-DOCUMENTED PULL REQUESTS. IT WILL BE LIKE A HOW-TO / GUIDE TO CLEAN ARCHITECTURE.

Business Search App (Java)

The purpose of this project is to demonstrate how to build Java applications from the ground up using clean architecture principles, Java best practices, and design patterns.

It is less about the application content and more about the code and architecture.

The goal is to showcase object oriented programming in Java, Java Swing, Kotlin, and Android, including:

Derivative Projects

This project has the following derivative projects, which showcases / walks through different portions of this project's architecture.

  1. Android Dagger (2.11-2.17) Butterknife (8.7-8.8) MVP

Application and Features

A simple business search application using the Yelp Fusion (v3) REST API.

This simple business search application is able to:

  • display businesses around a location
  • display businesses around a set of coordinates
  • display business details

Notes

  • The application is kept short and simple with minimal styling and no advanced UI for brevity.
  • The Yelp Android API is not used in order to showcase usage of Retrofit 2

Applications

The application has several different presentations. In other words, there are several different runnable applications that can be installed in different platforms.

  1. presentation-java-nogui-mvp: Plain Java command line / console app written using the MVP pattern.
  2. presentation-java-swing-mvp: Java Swing app written using the MVP pattern.
  3. presentation-java-swing-mvvm: Java Swing app written using the MVVM pattern.
  4. presentation-java-android-mvp: Android app written in Java using the MVP pattern.
  5. presentation-java-android-mvvm: Android app written in Java using the MVVM pattern.
  6. presentation-kotlin-android-mvp: Android app written in Kotlin using the MVP pattern.

All of the above presentations use the same domain and data layer.

Building and Running the Applications

JDK 8 is required to build and run this project.

Using Android Studio

You may open this project in Android Studio (v2.3.1).

  • For plain Java applications, you must Build -> Make Project in order to build them. There are several plain Java applications:

    • presentation-java-nogui-mvp
    • presentation-java-swing-mvp
    • presentation-java-swing-mvvm
  • For Android applications, click Build -> Rebuild Project is enough. However, it will not build plain Java applications as mentioned above. There are several Android applications:

    • presentation-java-android-mvp
    • presentation-java-android-mvvm
    • presentation-kotlin-android-mvp

Since this project contains a mix of plain Java modules and Android modules, the best way to ensure that all modules are built properly is to

  • Build -> Clean Project
  • Build -> Make Project

Running the applications

After building/making the project, the applications may then be run.

  • For plain Java applications, navigate to the ApplicationRunner.java file, right click, and select Run 'ApplicationRunner.main()'. If this does not work in Android Studio, try Using Gradle method in the command line.
  • For Android applications, select the desired run configuration and select Run -> Run '(presentation-module-to-run)'

Using Gradle

To build all modules,

./gradlew build

Note that building all modules may result in parallel build failure due to concurrent file access resulting in file deadlocks. See FIXME about org.gradle.parallel in gradle.properties.

To build all variants of a specific module,

./gradlew :<module>:build

For example, to build the presentation-java-nogui-mvp application,

./gradlew :presentation-java-nogui-mvp:build

To list all tasks for this project,

./gradlew tasks

To list all tasks for a specific module,

./gradlew :<module>:tasks

For example, to list all tasks for the presentation-java-nogui-mvp module,

./gradlew :presentation-java-nogui-mvp:tasks

Running the applications

  • For plain Java applications,

    ./gradlew :<java-presentation-module>:run
    

    For example, to run the presentation-java-nogui-mvp application,

    ./gradlew :presentation-java-nogui-mvp:run
    

    You may also generate and run via jar,

    ./gradlew :<java-presentation-module>:jar
    java -jar <java-presentation-module>/build/libs/<name-of-jar>.jar 
    

    For example, to generate and run the jar of the presentation-java-nogui-mvp application,

    ./gradlew :presentation-java-nogui-mvp:jar
    java -jar presentation-java-nogui-mvp/build/libs/presentation-java-nogui-mvp-1.0.0.jar 
    
  • For Android applications,

    ./gradlew :<android-presentation-module>:install<build_variant>
    

    For example, to install the presentation-java-android-mvp debug application,

    ./gradlew :presentation-java-android-mvp:installDebug
    

Known Issues

  1. If building fails due to a read/write process lock or any file related error, this may be due to org.gradle.parallel set to true in gradle.properties. This allows for parallel tasks which could result in several gradle processes accessing the same files at the same time.

    For example, ./gradlew build builds all projects in parallel, which may result in the following error,

    :presentation-java-android-mvp:transformClassesAndResourcesWithProguardForRelease FAILED :presentation-java-android-mvvm:transformClassesAndResourcesWithProguardForRelease FAILED

    You will need to stop the existing gradle daemons and try again (without cleaning).

    ./gradlew --stop

    You may want to build a specific variant of a specific module to avoid this synchronization issue.

    ./gradlew :<presentation-module>:build<build_variant>

  2. If anything unexpected occurs, clean the project first and try again.

    ./gradlew clean

Architecture

This project's adaptation of the clean architecture guidelines is inspired by the Clean Architecture sample app by android10. Take a look at the Clean Architecture sample app for links to blogs discussing the architecture.

Considerations

Not one project is perfect. Not one architectural pattern is without flaws. There is no 1 size fits all architecture. The same goes for this project. With that said, there are a couple of things to consider about this project's architecture;

  1. Does there need to be separate entities/models for each layer? That is, Entity in the data layer, DomainObjectin the domain layer, and Model in the presentation layers?

    Keeping these objects separate allows each layer to be completely independent from the other layers. It follows one of the clean architecture principles' on the separation of layers. In practical terms, each layer have complete control on what these objects should be. Furthermore, the amount of inter-layer imports are kept to a minimum. This increases the modules's modularity. A change from one layer will not affect the other layers, except for "mappers".

    However, this abstraction comes at the cost of code duplication and having to create "mappers". Given the current state of the project, the advantage of this abstraction does not seem to outweigh its costs. A more pragmatic approach is to only have a data layer and a presentation layer where the data layer provides the entities for the presentation layer to use.

  2. Currently, the domain layer provides interactors / use cases that simply call the repository implementations provided by the data layer. So, why not get rid of the domain layer and just use the data layer directly?

    As mentioned in point 1, this would be the more pragmatic approach. However, the domain layer is important in future-proofing. What if a reporting call needs to be fired when a use case is executed? What if all use cases need to be logged? What if API X needs to be used in use case Y? The domain layer serves as the middleman between the presentation layer and other layers / APIs.

Development Logs

All work has been logged, including:

  • the steps taken in creating this project from start to finish (current code) in chronological order
  • thought process for each step; "why do it this way?", "why use that library?", etc
  • references to issues and pull requests for each step

See more in docs/DEVELOPMENT_LOGS.md.

Tests

Unit Tests

JUnit4, AssertJ, Mockito2, and Robolectric3 are used for unit testing Android and pure Java classes.

To run all unit tests,

./gradlew test

To run all unit tests for a specific module,

./gradlew :<presentation-module>:test

Instrumentation Tests

Espresso is used for Android instrumentation tests.

To run all instrumentation tests,

./gradlew connectedAndroidTest

To run all instrumentation tests for a specific Android module,

./gradlew :<android-presentation-module>:connectedAndroidTest

Note that only debug build types support Android instrumentations tests.

Jacoco Test Report

Code coverage is available through the use of the jacoco plugin.

To generate test reports for all modules,

./gradlew jacocoTestReport

To generate test reports for a specific module,

./gradlew :<module>:jacocoTestReport

Static Analysis

The following static analysis checks are used to enforce high code quality and compliance to standard Java (and Android) code style and patterns:

You can read more about these tools in this blog post.

To run all static analysis checks for all modules,

./gradlew checkQuality

To run all static analysis checks for a specific module,

./gradlew :<module>:checkQuality

Javadoc

Javadoc is available. To generate the Javadocs,

To generate Javadocs for all modules,

./gradlew javadoc

To generate Javadocs for a specific module,

./gradlew :<module>:javadoc

Code Style

Styling is very important in maintaining a codebase with multiple (and large amounts) of contributors. A set of code style guidelines are enforced by this project, most of which are checked by the static analysis tool checkstyle. Read more in docs/STYLE.md.

License

Copyright 2018 Vandolf Estrellado

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].