|
1 | 1 | # Farmz |
2 | 2 | A simple android application to fetch, update farmers and register their farms |
| 3 | +Fully compatible with [Android 11][android-q], supporting light and [dark theme][dark-theme] (see screenshots) |
| 4 | + |
| 5 | +## API Key |
| 6 | +The app uses google maps to display location of farms. Get an api key [here](https://developers.google.com/maps/documentation/android-sdk/get-api-key) <br/> |
| 7 | + |
| 8 | +* Create the file `secure.properties` in your project level directory, and then add the following code to the file. Replace `YOUR_API_KEY` with your API key. |
| 9 | +``` |
| 10 | + MAPS_API_KEY=YOUR_API_KEY |
| 11 | +
|
| 12 | +``` |
| 13 | + |
| 14 | +* Place it in `app/build.gradle` |
| 15 | +``` |
| 16 | +android { |
| 17 | + defaultConfig { |
| 18 | + ... |
| 19 | + def secureProps = new Properties() |
| 20 | + if (file("../secure.properties").exists()) { |
| 21 | + file("../secure.properties")?.withInputStream { secureProps.load(it) } |
| 22 | + } |
| 23 | + resValue "string", "maps_api_key", (secureProps.getProperty("MAPS_API_KEY") ?: "") |
| 24 | + ... |
| 25 | + } |
| 26 | + ... |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | +## Download APK |
| 31 | +You can download the APK from [releases](https://play.google.com/store/apps/details?id=com.momentolabs.app.security.applocker&hl=en) <br/> |
| 32 | +Use email `a@b.c` and password `123456` to log in |
| 33 | + |
| 34 | + |
| 35 | +## What you can learn |
| 36 | +* [Material Components][material] |
| 37 | +* [Constraint Layout][constraint-layout] |
| 38 | +* [Retrofit][retrofit] for REST api communication |
| 39 | +* [Glide][glide] for image loading |
| 40 | +* [Mockk][mockk] for mocking in tests |
| 41 | +* [Dagger2][dagger2] for dependency injection |
| 42 | +* [Room][room] for database |
| 43 | +* [Kotlin Flow][flow] for concurrency |
| 44 | +* [ViewModel][viewmodel] & [LiveData][livedata] |
| 45 | +* [Navigation Architecture Component][nav] |
| 46 | +* [Clean Architecture][clean-arch] |
| 47 | +* [ViewBinding][viewbinding] |
| 48 | +* [Kotlin Delegates][delegates] |
| 49 | +* [DataStore][datastore] |
| 50 | +* [Paging 3.0][paging-3] |
| 51 | +* [Google Maps][maps] |
| 52 | +* [Activity Results API][results] |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +[mockwebserver]: https://github.com/square/okhttp/tree/master/mockwebserver |
| 58 | +[androidx]: https://developer.android.com/jetpack/androidx |
| 59 | +[arch]: https://developer.android.com/arch |
| 60 | +[espresso]: https://google.github.io/android-testing-support-library/docs/espresso/ |
| 61 | +[retrofit]: http://square.github.io/retrofit |
| 62 | +[glide]: https://github.com/bumptech/glide |
| 63 | +[mockk]: https://github.com/mockk/mockk |
| 64 | +[dagger2]: https://github.com/google/dagger |
| 65 | +[kotlin]: https://developer.android.com/kotlin |
| 66 | +[material]: https://github.com/material-components/material-components-android/ |
| 67 | +[android-q]: https://developer.android.com/preview |
| 68 | +[dark-theme]: https://developer.android.com/preview/features/darktheme |
| 69 | +[constraint-layout]: https://developer.android.com/reference/android/support/constraint/ConstraintLayout |
| 70 | +[rxjava2]: https://github.com/ReactiveX/RxJava |
| 71 | +[room]: https://developer.android.com/topic/libraries/architecture/room |
| 72 | +[paging-3]:https://developer.android.com/topic/libraries/architecture/paging/v3-overview |
| 73 | +[maps]:https://developers.google.com/maps/documentation/android-sdk/overview |
| 74 | +[livedata]:https://developer.android.com/topic/libraries/architecture/livedata |
| 75 | +[viewmodel]:https://developer.android.com/topic/libraries/architecture/viewmodel |
| 76 | +[datastore]:https://developer.android.com/topic/libraries/architecture/datastore |
| 77 | +[flow]:https://kotlinlang.org/docs/reference/coroutines/flow.html |
| 78 | +[clean-arch]:https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html |
| 79 | +[nav]:https://developer.android.com/guide/navigation/navigation-getting-started |
| 80 | +[viewbinding]:https://developer.android.com/topic/libraries/view-binding |
| 81 | +[delegates]:https://kotlinlang.org/docs/reference/delegated-properties.html |
| 82 | +[results]:https://developer.android.com/training/basics/intents/result |
| 83 | + |
| 84 | + |
| 85 | +## Possible Improvements |
| 86 | +- Add logout funtionality |
| 87 | +- Change theme |
| 88 | +- Improve pagination |
| 89 | +- Use multiple back stacks on bottom navigation |
| 90 | +- Improve UI/UX |
| 91 | + |
| 92 | + |
| 93 | +## Screenshots |
| 94 | +### Dark |
| 95 | +<img src="https://user-images.githubusercontent.com/25648077/96524630-b4917200-1270-11eb-8d97-68abf65d5619.gif" width="302" alt="Screenshot"> |
| 96 | + |
| 97 | +### Light |
| 98 | +<img src="https://user-images.githubusercontent.com/25648077/96524147-5fa12c00-126f-11eb-9cc0-803126c99647.gif" width="302" alt="Screenshot"> |
| 99 | + |
| 100 | + |
| 101 | +### Lines of code |
| 102 | +<img src="https://user-images.githubusercontent.com/25648077/96524965-911af700-1271-11eb-8bbf-ea788f53f1ba.png" alt="Lines of code"> |
0 commit comments