{"id":18014439,"url":"https://github.com/shouheng88/utils-android","last_synced_at":"2025-03-26T18:30:36.892Z","repository":{"id":45188815,"uuid":"214335640","full_name":"Shouheng88/utils-android","owner":"Shouheng88","description":"Convenient android utils and Kotlin DSL styled extensions.","archived":false,"fork":false,"pushed_at":"2024-01-16T08:06:05.000Z","size":836,"stargazers_count":120,"open_issues_count":1,"forks_count":31,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-22T05:51:08.599Z","etag":null,"topics":["android","android-library","java","kotlin","library","permission-android","utils-library"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shouheng88.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-11T03:29:29.000Z","updated_at":"2024-09-18T09:26:57.000Z","dependencies_parsed_at":"2024-01-07T07:27:57.513Z","dependency_job_id":"a6717e99-0e11-440e-9c0a-419863211dbd","html_url":"https://github.com/Shouheng88/utils-android","commit_stats":null,"previous_names":["shouheng88/android-utils"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shouheng88%2Futils-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shouheng88%2Futils-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shouheng88%2Futils-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shouheng88%2Futils-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shouheng88","download_url":"https://codeload.github.com/Shouheng88/utils-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245712455,"owners_count":20660244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","java","kotlin","library","permission-android","utils-library"],"created_at":"2024-10-30T04:09:31.792Z","updated_at":"2025-03-26T18:30:36.513Z","avatar_url":"https://github.com/Shouheng88.png","language":"Java","readme":"\u003ch1 align=\"center\"\u003eAndroid-Utils: A Collection of Android Utils\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://www.apache.org/licenses/LICENSE-2.0\"\u003e\n    \u003cimg src=\"https://img.shields.io/hexpm/l/plug.svg\" alt=\"License\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://bintray.com/beta/#/easymark/Android/utils-core?tab=overview\"\u003e\n    \u003cimg src=\"https://img.shields.io/maven-metadata/v/https/s01.oss.sonatype.org/service/local/repo_groups/public/content/com/github/Shouheng88/utils-core/maven-metadata.xml.svg\" alt=\"Version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.codacy.com/manual/Shouheng88/Android-utils?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Shouheng88/Android-utils\u0026amp;utm_campaign=Badge_Grade\"\u003e\n    \u003cimg src=\"https://api.codacy.com/project/badge/Grade/58b18f9bf47543cbbaf4ca67bcadfc7b\" alt=\"Code Grade\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/Shouheng88/Android-utils\"\u003e\n    \u003cimg src=\"https://travis-ci.org/Shouheng88/Android-utils.svg?branch=master\" alt=\"Build\"/\u003e\n  \u003c/a\u003e\n    \u003ca href=\"https://developer.android.com/about/versions/android-4.0.html\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/API-14%2B-blue.svg?style=flat-square\" alt=\"Min Sdk Version\" /\u003e\n  \u003c/a\u003e\n\u003c/P\u003e\n\n## 1. Introcution\n\nThis project is mainly used to collect utils classes useful in Android development, for example, log, crash collection, resources, attr, runtime permission, toast etc so that to accelerate your Android evelopment.\n\n## 2. Use in your project\n\n### 2.1 Add dependency\n\nThis project is published to jCenter, so you can easily use it in your project.\n\nFirst, you need to add jcenter in your project:\n\n```gradle\nrepositories { mavenCentral() }\n```\n\nthen, add dependencies in your project:\n\n```gradle\nimplementation \"com.github.Shouheng88:utils-core:$latest-version\"\n```\n\nIf you want to use the kotlin extension based on utils classes, use the dependency below:\n\n```gradle\nimplementation \"com.github.Shouheng88:utils-ktx:$latest-version\"\n```\n\n### 2.2 Initialize\n\nYou need initialize utils in your application. This is mainly used to get a global context to make utils methods more convenient, and it will cost too much time of launching your App.\n\n```java\npublic class SampleApp extends Application {\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        // initialize your library\n        UtilsApp.init(this);\n    }\n}\n```\n### 2.2 Fetures and functions\n\nThe utils classes was divided into multiple groups:\n\n|No|Class|Group|Desc|\n|:---:|:---:|:---:|:---:|\n|1|[ActivityUtils](./utils/src/main/java/me/shouheng/utils/app/ActivityUtils.java)|App|Activity start, close, aniation, builder|\n|2|[AppUtils](./utils/src/main/java/me/shouheng/utils/app/AppUtils.java)|App|App install, uninstall, get information\n|3|[IntentUtils](./utils/src/main/java/me/shouheng/utils/app/IntentUtils.java)|App|Intent to launch App, market etc\n|4|[ResUtils](./utils/src/main/java/me/shouheng/utils/app/ResUtils.java)|Resources|Image, Text, and other resources\n|5|[EncodeUtils](./utils/src/main/java/me/shouheng/utils/data/EncodeUtils.java)|Encode|base64 and url encode\n|6|[EncryptUtils](./utils/src/main/java/me/shouheng/utils/data/EncryptUtils.java)|Encrypt|md5 sha256 encrypt\n|7|[RegexUtils](./utils/src/main/java/me/shouheng/utils/data/RegexUtils.java)|Data|Regex\n|8|[StringUtils](./utils/src/main/java/me/shouheng/utils/data/StringUtils.java)|Data|String process\n|9|[TimeUtils](./utils/src/main/java/me/shouheng/utils/data/TimeUtils.java)|Data|Date and time process\n|10|[DeviceUtils](./utils/src/main/java/me/shouheng/utils/device/DeviceUtils.java)|Device|Device info, imei, model etc\n|11|[NetworkUtils](./utils/src/main/java/me/shouheng/utils/device/NetworkUtils.java)|Device|Network info, type etc\n|12|[ShellUtils](./utils/src/main/java/me/shouheng/utils/device/ShellUtils.java)|Device|Shell\n|13|[PermissionUtils](./utils/src/main/java/me/shouheng/utils/permission/PermissionUtils.java)|Permission|Android runtime permission\n|14|[CrashHelper](./utils/src/main/java/me/shouheng/utils/stability/CrashHelper.java)|Stability|crash\n|15|[L](./utils/src/main/java/me/shouheng/utils/stability/L.java)|Stability|log output, format etc\n|16|[FileUtils](./utils/src/main/java/me/shouheng/utils/store/FileUtils.java)|Storage|File, visit, move, delete etc\n|17|[PathUtils](./utils/src/main/java/me/shouheng/utils/store/PathUtils.java)|Storage|Get directory paths\n|18|[IOUtils](./utils/src/main/java/me/shouheng/utils/store/IOUtils.java)|Storage|IO|\n|19|[KV](./utils/src/main/java/me/shouheng/utils/store/KV.java)|Storage|Sharedpreference|\n|20|[ImageUtils](./utils/src/main/java/me/shouheng/utils/ui/ImageUtils.java)|ui|Image process, scale, roate etc|\n|21|[ToastUtils](./utils/src/main/java/me/shouheng/utils/ui/ToastUtils.java)|ui|Toast|\n|22|[ViewUtils](./utils/src/main/java/me/shouheng/utils/ui/ViewUtils.java)|ui|View info etc|\n### 2.3 Use Utils-ktx\n\n`utils-ktx` is a kotlin extension based on Android-Utils, which is used to simplify usages of utils classes. For example, if you want to get a drawable, tint it and then display it in ImageView. One line is enough:\n\n```kotlin\niv.icon = drawableOf(R.drawable.ic_add_circle).tint(Color.WHITE)\n```\n\nIf you want to request runtime permission in Activity, what you need to do is only writing one line below,\n\n```kotlin\ncheckStoragePermission {  /* got permission */ }\n```\n\nAs for avoding continous click, you only need one line, \n\n```kotlin\nbtnRateIntro.onDebouncedClick { /* do something */ }\n```\n\nAll in all, by utils-ktx you can significantly lower the difficulty of development.\n\n### 2.3 Proguard rules\n\n```\n# Add MMKV classname\n-keepnames class com.tencent.mmkv.MMKV\n```\n\n## 3、About\n### 3.1 Change log\n\n[Log](CHANGELOG.md)\n\n## License\n\n```\nCopyright (c) 2019-2021 wsh.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshouheng88%2Futils-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshouheng88%2Futils-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshouheng88%2Futils-android/lists"}