Giter VIP home page Giter VIP logo

notesclientapp's Introduction

Build Status

The project

Client-side

app-mvp is a client-side JVM MVP application skeleton for simple notes keeping in Kotlin.

app-infra-rest-retrofit is an infra layer - client REST controllers that are used by client apps.

Mobile - Android

app-android is an Android app.

Mobile - iOS

To create podspec files run in root project directory:

./gradlew podspec

app-ios is an iOS app.

Mobile - Flutter (Android/iOS)

app-flutter is an Android/iOS Flutter app.

Desktop - JavaFX

app-javafx is a desktop JavaFX app.

Server-side

Client-side application requires server-side JVM application to be running. Applications interact over HTTP REST. Make sure you run it before running Android application.

MVP

All the apps (except Flutter) use MVP design pattern (see app-mvp module):

MVP

Android and JavaFX apps just provide concrete View implementations and reuse Model and Presenter from app-mvp. In order to interact with server-side app Model has a reference to UseCase implementation (from server-side app-api). In order to pass boundary we use according Controller that implement UseCase and abstracts transport/protocol. So both apps use app-infra-rest-retrofit module with Controllers which can be easily replaced with another one.

MVP

Building

Applications use app-api module from server-side application repository.

First, make sure:

  • NotesServerApp artifacts are available on local Maven repository: clone NotesServerApp repository to any directory, build and publish it to local Maven repository or
  • use Gradle composite-build: clone NotesServerApp repository to ../NotesServerApp directory (no separate building/publication is required).

Android app

In this repository root directory:

./gradlew app-android:assemble

Find compiled .apks in ./app-android/build/outputs/apk/ directories.

JavaFX app

In this repository root directory:

./gradlew app-javafx:shadowJar

Find compiled app-javafx-all.jar "shadow" jar (includes all dependencies) in ./app-javafx/build/libs/ directory.

iOS app

Compile and install podspec files for server-side and client apps in root directories:

./gradlew podspec

Install app-mvp pod in app-ios directory:

pod install

Flutter app

Android app

In app-flutter directory:

flutter pub get
flutter packages pub run build_runner build
flutter build apk --target-platform android-arm

Testing

Unit testing

JavaFX/Android app

One can find few unit tests that demonstrate some benefits of clean architecture for testing:

./gradlew test

iOS app

One can find few unit tests in app-ios/app-iosTests. Run them in XCode.

Automated UI Testing

Android app

First, create and run AVD. In this repository root directory:

./gradlew app-android:connectedAndroidTest

Make sure all the tests passed:

...
12:12:53 V/InstrumentationResultParser: Time: 15.482
12:12:53 V/InstrumentationResultParser: 
12:12:53 V/InstrumentationResultParser: OK (4 tests)
12:12:53 V/InstrumentationResultParser: 
12:12:53 V/InstrumentationResultParser: 
12:12:53 V/InstrumentationResultParser: INSTRUMENTATION_CODE: -1
12:12:53 V/InstrumentationResultParser: 
12:12:53 I/XmlResultReporter: XML test result file generated at /Users/asmirnov/Documents/dev/src/Notes/NotesClientApp/app-android/build/outputs/androidTest-results/connected/TEST-Nexus_5X_API_25_-_dev(AVD) - 7.1.1-app-android-.xml. Total tests 4, passed 4, 

Flutter app

In app-flutter directory:

flutter test

Manual testing

Android app

Stop server-side app (just to test errors handling). Install Android app to your device/emulator:

adb install ./app-android/build/outputs/apk/debug/app-android-debug.apk

and run the app.

Type server-side app host and port:

Server host and port

Make sure you can see connection error:

Connection error

Run server-side app and click "Reload" button to reload the notes list in Android app:

List notes loading progress Empty notes list

Click "Add" button and type note title and body:

Add note Add note progress

Make sure you can see added note:

Notes list

JavaFX app

Stop server-side app (just to test errors handling). Run JavaFX app:

java -jar app-javafx/build/libs/app-javafx-all.jar  

Type server-side app host and port:

Server host and port

Make sure you can see connection error:

Connection error

Run server-side app and click "Reload" button to reload the notes list in javafx app:

List notes loading progress Empty notes list

Click "Add" button and type note title and body:

Add note Add note progress

Make sure you can see added note:

Notes list

iOS app

Stop server-side app (just to test errors handling). Run the app in iOS device simulator.

Type server-side app host and port:

Server host and port

Make sure you can see connection error:

Connection error

Run server-side app and click "Reload" button to reload the notes list in iOS app:

Empty notes list

Click "Add" button and type note title and body:

Add note

Make sure you can see added note:

Notes list

Flutter app

Android

Server host and port Add note Notes list

iOS

Server host and port Add note Notes list

Frameworks and tools

Feedback

Please find TODOs in source code as topics for improvements if desired.

Any feedback and discussion is appreciated. Contact me on e-mail for this or fork the repository and pull a request.

Author

Anton Smirnov

dev [at] antonsmirnov [dot] name

2019

notesclientapp's People

Contributors

4ntoine avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

notesclientapp's Issues

Create JavaFx app

In order to demonstrate how MVP can be used for any application we could create JavaFx app.

Add Espresso tests for Android app

We have MVP covered more or less with unit testing.
We could also have Espresso UI testing (though Uncle Bob does not think it worth it).

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.