Skip to content

wintinue/template-android

Repository files navigation

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

Template Directory

Name Description
base base classes such as base activity, fragment, dialog, etc
BaseActivity activity that all activities will inherit
showToast() 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 image
createImageFile() getFullPathFromUri() downloadImage()
NotificationTask task about notification
showNotification()
Permission tasks about permissions
checkCameraPermission() checkReadPermission()
checkWritePermission() checkCamaraAndReadPermission()
checkReadAndWritePermission() requestCameraPermission()
requestReadPermission() requestCameraAndReadPermission()
requestReadAndWritePermission()
ProgressDialog loading dialog
ValueCheck check values with regex patterns
isEmail() getUrl()
ValueConvert convert value to another
dpToPx() pxToDp()
App application class
getRetrofit() finishActivities()
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.

About

android project themplate including network(retrofit), utils(image, permission, etc), etc

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages