Write JVM apps Android way
implementation 'com.theapache64:cyclone:1.0.0-beta01'
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 π)
- Run the main method
- Give any username and password (length should be > 0)
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
- Coroutines π
- Dagger2 π‘οΈ
- Moshi π³
- Retrofit π
.
βββ 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
βββ 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
- Add tests
- Add more features to example TODO app
- Add comments to source code
- Clone more components
- Publish
core
viamaven
./gradlew test
π€ theapache64
- Twitter: @theapache64
- Email: theapache64@gmail.com
Feel free to ping me π
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.
- Open an issue first to discuss what you would like to change.
- Fork the Project
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a pull request
Please make sure to update tests as appropriate.
Give a βοΈ if this project helped you!
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 β€