theapache64 / cyclone

Write JVM apps Android way

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cyclone

buildStatus latestVersion Twitter: theapache64

Write JVM apps Android way

πŸ›  Installation

implementation 'com.theapache64:cyclone:1.0.0-beta01'

Story 🌲

I was just wondering would it be possible to write CLI apps like we write Android apps. By using the same structure, tools, and the APIs.

I started the project by cloning LiveData API structure. I made sure that it works as expected. After that I cloned API structures of ViewModel, Activity, Application, Context and Intent. (I didn't fully clone the component, but the minimum version to write a simple CLI app)

(By this time, you might have got why I named the project cyclone πŸ˜‹)

Example πŸ”¬

How to run the example ?

  • Run the main method
  • Give any username and password (length should be > 0)

Structure πŸ“‚

The example project contains 2 modules, Core and Example. Core module contains the cloned classes (library), and the Example module contains an example using the cloned classes.

The Example is a TODO app. It has below given features.

  • Log In
  • Todo Listing

Built With πŸ› οΈ

  • Coroutines πŸ”ƒ
  • Dagger2 πŸ—‘οΈ
  • Moshi πŸ”³
  • Retrofit 🌐

Directory Structure πŸ“

Library

.
└── core
    β”œβ”€β”€ Activity.kt
    β”œβ”€β”€ Application.kt
    β”œβ”€β”€ Context.kt
    β”œβ”€β”€ extensions
    β”‚   └── FlowExtensions.kt
    β”œβ”€β”€ InputUtils.kt
    β”œβ”€β”€ Intent.kt
    β”œβ”€β”€ livedata
    β”‚   β”œβ”€β”€ LiveData.kt
    β”‚   └── MutableLiveData.kt
    └── network
        β”œβ”€β”€ BaseApiResponse.kt
        β”œβ”€β”€ flow
        β”‚   β”œβ”€β”€ FlowResourceCallAdapterFactory.kt
        β”‚   └── FlowResourceCallAdapter.kt
        └── Resource.kt

5 directories, 12 files

Example

.
└── example
    β”œβ”€β”€ App.kt
    β”œβ”€β”€ data
    β”‚   β”œβ”€β”€ local
    β”‚   β”œβ”€β”€ remote
    β”‚   β”‚   β”œβ”€β”€ ApiInterface.kt
    β”‚   β”‚   β”œβ”€β”€ login
    β”‚   β”‚   β”‚   β”œβ”€β”€ LogInRequest.kt
    β”‚   β”‚   β”‚   └── LogInResponse.kt
    β”‚   β”‚   └── todolist
    β”‚   β”‚       β”œβ”€β”€ TodoListRequest.kt
    β”‚   β”‚       └── TodoListResponse.kt
    β”‚   └── repositories
    β”‚       β”œβ”€β”€ TodoRepo.kt
    β”‚       └── UserRepo.kt
    β”œβ”€β”€ di
    β”‚   β”œβ”€β”€ components
    β”‚   β”‚   β”œβ”€β”€ LogInComponent.kt
    β”‚   β”‚   └── TodoListComponent.kt
    β”‚   └── modules
    β”‚       └── NetworkModule.kt
    β”œβ”€β”€ models
    β”œβ”€β”€ ui
    β”‚   β”œβ”€β”€ login
    β”‚   β”‚   β”œβ”€β”€ LogInActivity.kt
    β”‚   β”‚   └── LogInViewModel.kt
    β”‚   └── todolist
    β”‚       β”œβ”€β”€ TodoListActivity.kt
    β”‚       └── TodoListViewModel.kt
    └── utils

15 directories, 15 files

β˜‘οΈ TODO

  • Add tests
  • Add more features to example TODO app
  • Add comments to source code
  • Clone more components
  • Publish core via maven

πŸ₯Ό Run tests

./gradlew test

✍️ Author

πŸ‘€ theapache64

Feel free to ping me πŸ˜‰

🀝 Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Open an issue first to discuss what you would like to change.
  2. Fork the Project
  3. Create your feature branch (git checkout -b feature/amazing-feature)
  4. Commit your changes (git commit -m 'Add some amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a pull request

Please make sure to update tests as appropriate.

❀ Show your support

Give a ⭐️ if this project helped you!

Patron Link Buy Me A Coffee Donation

πŸ“ License

Copyright Β© 2021 - theapache64

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.

This README was generated by readgen ❀

About

Write JVM apps Android way


Languages

Language:Kotlin 100.0%