Template-Android
When starting a new Android project, it is boring to write some codes such as permission verification, network interface creation, which are necessary for almost all projects.
This template quickly solves such boring parts and allows you to devote time to tasks that are more important and need to be paid attention to.
Korean description(한국어 설명) : https://win-record.tistory.com/7
Initial Setting
- min sdk version : 28
- target sdk version : 30
- using view binding
Directory
Name | Description |
---|---|
base | base classes such as base activity, fragment, dialog, etc |
ㄴBaseActivity | activity that all activities will inheritshowToast() showDialog() showProgressDialog() hideProgressDialog() transActivity() setToolbar() hideToolbar() getEditorActionListener() |
network | about network task |
ㄴApiInterface | retrofit api interface(samples included) |
ㄴXAccessTokenInterceptor | interceptor that put jwt into OkHttpClient from shared preferences |
receiver | broadcast receivers |
ㄴDownloadReceiver | receive when download complete such as file, image, video, etc |
ㄴRebootReceiver | receive when device reboots |
util | useful utils |
ㄴEnums | enum classes |
ㄴImageTask | tasks about imagecreateImageFile() getFullPathFromUri() downloadImage() |
ㄴNotificationTask | task about notificationshowNotification() |
ㄴPermission | tasks about permissionscheckCameraPermission() checkReadPermission() checkWritePermission() checkCamaraAndReadPermission() checkReadAndWritePermission() requestCameraPermission() requestReadPermission() requestCameraAndReadPermission() requestReadAndWritePermission() |
ㄴProgressDialog | loading dialog |
ㄴValueCheck | check values with regex patternsisEmail() getUrl() |
ㄴValueConvert | convert value to anotherdpToPx() pxToDp() |
App | application class |
MainActivity | main activity using view binding |
packages(folders) that would be good to add
- adapter : adapter classes such as recyclerview adapter, fragment adapter, etc
- data : data classes such as XXXresponse, XXXbody, user, etc
- service : service classes
- view : view classes such as activity, fragment, etc (+ you can add each activity, fragment package into)
Theme
Name | Description |
---|---|
Theme.AndroidTemplate.NoActionBar | no app bar theme |
Theme.AndroidTemplate.FullScreen | no app bar, no status bar theme |
Dependencies
License
MIT License
Copyright (c) 2021 loggingWin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.