{"id":13989523,"url":"https://github.com/tom91136/Akatsuki","last_synced_at":"2025-07-22T11:30:36.105Z","repository":{"id":35854435,"uuid":"40139047","full_name":"tom91136/Akatsuki","owner":"tom91136","description":"Android states and arguments made easy with annotations","archived":false,"fork":false,"pushed_at":"2016-03-06T01:47:08.000Z","size":1537,"stargazers_count":138,"open_issues_count":5,"forks_count":14,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-03T01:05:24.673Z","etag":null,"topics":["comsm"],"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/tom91136.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-03T17:40:58.000Z","updated_at":"2024-06-28T19:48:21.000Z","dependencies_parsed_at":"2022-07-25T19:33:27.293Z","dependency_job_id":null,"html_url":"https://github.com/tom91136/Akatsuki","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tom91136/Akatsuki","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom91136%2FAkatsuki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom91136%2FAkatsuki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom91136%2FAkatsuki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom91136%2FAkatsuki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tom91136","download_url":"https://codeload.github.com/tom91136/Akatsuki/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom91136%2FAkatsuki/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266483434,"owners_count":23936341,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["comsm"],"created_at":"2024-08-09T13:01:43.341Z","updated_at":"2025-07-22T11:30:35.746Z","avatar_url":"https://github.com/tom91136.png","language":"Java","funding_links":[],"categories":["Java","Parcelables","Annotation"],"sub_categories":[],"readme":"# Akatsuki\n[![Join the chat at https://gitter.im/tom91136/Akatsuki](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tom91136/Akatsuki?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Akatsuki-green.svg?style=flat)](https://android-arsenal.com/details/1/2230)\n[![Build Status](https://travis-ci.org/tom91136/Akatsuki.svg)](https://travis-ci.org/tom91136/Akatsuki)\n[![Download](https://api.bintray.com/packages/tom91136/maven/Akatsuki/images/download.svg)](https://bintray.com/tom91136/maven/Akatsuki/_latestVersion)\n\nAkatsuki is a light weight Android library that handles [state restoration](http://developer.android.com/training/basics/activity-lifecycle/recreating.html) and argument passing via annotations.\nThe library automatically generates source files through JSR269 to ensure almost\u003csup\u003e1\u003c/sup\u003e zero performance impact.\n\n###Key features:\n\nState restoration\n\n - Retain state with `@Retained`\n - Supports all types allowed in `Bundle` and a few more\n - Supports inheritance\n - Supports generic parameters\n - Custom type support with `TypeConverter` and `@TransformationTemplate`\n - Compatible with other parcel and binding libraries\n - Per class and global configuration via `@RetainConfig`\n \n \nArgument passing\n\n - Pass arguments with `@Arg`\n - Supports inheritance, builders will be generated for all subclasses\n - Supports `Activity`, `Fragment`, and `Service`\n - Custom builder support with `ArgConcludingBuilder`\n - Supports chained, checked, unchecked,  and type safe builders\n - Per class and global configuration via `@ArgConfig`\n \n \nGood to know\n\n - `@Retained` and `@Arg` can be used together\n - Annotation based configuration via `@AkatsukiConfig`\n\n\nIn short, this library handles most Android IPC boilerplate that would otherwise be tedious to write and maintain. \n\n \nExample usage:\n\n\n```java\npublic class MainActivity extends Activity {\n\n    @Retained String myString;\n    @Retained int myInt;\n    @Retained android.accounts.Account account; // implements Parcelable\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        Akatsuki.restore(this, savedInstanceState);\n        //everything restored!   \n        \n        // you want to start AnotherActivity and pass some stuff:\n        Builders.AnotherActivity().theAnswer(\"42\").startActivity(this);\n    }\n\n    @Override\n    protected void onSaveInstanceState(Bundle outState) {\n        super.onSaveInstanceState(outState);\n        Akatsuki.save(this, outState);\n    }\n}\n\n// in another activity class\npublic class AnotherActivity extends Activity {\n\n    // @Args and @Retained can be used together\n    @Arg @Retained String theAnswer; \n  \n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        Akatsuki.restore(this, savedInstanceState);\n        // theAnswer is retrieved from the intent and persisted in case of any change\n    }\n\n    @Override\n    protected void onSaveInstanceState(Bundle outState) {\n        super.onSaveInstanceState(outState);\n        Akatsuki.save(this, outState);\n    }\n}\n\n```\n\u003csup\u003e1\u003c/sup\u003eReflection is used only once to locate the generated classes.\n\nFor documentation and additional information see [the wiki](https://github.com/tom91136/Akatsuki/wiki)\n\n## Download\n**The compiler is written in Java 8 so make sure you have JDK8 or higher installed(use `java -version` to check)**\n\n\nGradle dependencies:\n```groovy\ndependencies {\n\tcompile 'com.sora.util.akatsuki:akatsuki-api:0.2.0'\n\tapt 'com.sora.util.akatsuki:akatsuki-compiler:0.2.0'\n}\n```\nOptional parceler support:\n```groovy\ncompile 'com.sora.util.akatsuki:akatsuki-parceler:0.2.0@aar'\n```\n\n\n\nPlease pay special attention to the build script:\n\n```groovy\n// your source/target compatibility remains 1_7, do NOT change it to 1_8\ncompileOptions {\n\tsourceCompatibility JavaVersion.VERSION_1_7\n\ttargetCompatibility JavaVersion.VERSION_1_7\n}\n// exception: do keep 1_8 if you happen to be using retrolambda\n```\n\n##### [Sample app(.apk)](http://jcenter.bintray.com/com/sora/util/akatsuki/sample/0.2.0/)\nShowcasing (`Fragment` + `NumberPicker`/`EditText`)\n\n\n**Snapshot builds** \n\nSnapshot builds are released on JitPack:\n\n    repositories {\n        //...\n        maven { url \"https://jitpack.io\" }\n    }\n    dependencies {\n        compile 'com.github.tom91136.akatsuki:akatsuki-api:\u003ccommit\u003e'\n        apt 'com.github.tom91136.akatsuki:akatsuki-compiler:\u003ccommit\u003e'\n    }\n    \n    \nSubstitute `\u003ccommit\u003e` with the latest commit hash, you can look them up in the commit history [here](https://jitpack.io/#tom91136/Akatsuki)\n\nThe first sync/build will take a **long** time, be patient.\n\n\n## Proguard\nPlease use the following rules if you have proguard enabled in your build script:\n\n```groovy\n-dontwarn com.sora.util.akatsuki.**\n-keep class com.sora.util.akatsuki.** { *; }\n-keep class **$$BundleRetainer { *; }\n-keepclasseswithmembernames class * {\n    @com.sora.util.akatsuki.* \u003cfields\u003e;\n}\n```\n\n## Special thanks\n\nSpecial thanks to [ersin-ertan](https://github.com/ersin-ertan) for testing the library and reporting bugs \n\n## License\n\n    Copyright 2015 WEI CHEN LIN\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom91136%2FAkatsuki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftom91136%2FAkatsuki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom91136%2FAkatsuki/lists"}