{"id":29829872,"url":"https://github.com/chrynan/serialization-parcelable","last_synced_at":"2025-07-29T09:41:38.468Z","repository":{"id":59861214,"uuid":"325433437","full_name":"chRyNaN/serialization-parcelable","owner":"chRyNaN","description":"Android Parcelable support for the Kotlinx Serialization library.","archived":false,"fork":false,"pushed_at":"2025-07-07T07:28:20.000Z","size":853,"stargazers_count":78,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-07-07T08:38:21.707Z","etag":null,"topics":["android","android-library","android-parcelable","kotlin","kotlin-android","kotlin-library","kotlin-multiplatform","kotlin-multiplatform-library","kotlin-multiplatform-mobile","kotlin-serialization","kotlinx-serialisation","kotlinx-serialization","kotlinx-serialization-library","parcel","parcelable","parcelize","serialization"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/chRyNaN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://www.buymeacoffee.com/chrynan","https://chrynan.codes"]}},"created_at":"2020-12-30T02:20:42.000Z","updated_at":"2025-04-14T14:13:29.000Z","dependencies_parsed_at":"2023-10-02T08:37:43.871Z","dependency_job_id":"22da21d3-eb92-4f34-8c96-27a0fd1323b0","html_url":"https://github.com/chRyNaN/serialization-parcelable","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/chRyNaN/serialization-parcelable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fserialization-parcelable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fserialization-parcelable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fserialization-parcelable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fserialization-parcelable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chRyNaN","download_url":"https://codeload.github.com/chRyNaN/serialization-parcelable/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fserialization-parcelable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267665373,"owners_count":24124522,"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-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["android","android-library","android-parcelable","kotlin","kotlin-android","kotlin-library","kotlin-multiplatform","kotlin-multiplatform-library","kotlin-multiplatform-mobile","kotlin-serialization","kotlinx-serialisation","kotlinx-serialization","kotlinx-serialization-library","parcel","parcelable","parcelize","serialization"],"created_at":"2025-07-29T09:41:26.826Z","updated_at":"2025-07-29T09:41:38.462Z","avatar_url":"https://github.com/chRyNaN.png","language":"Kotlin","readme":"![serialization-parcelable](assets/serialization-parcelable-logo.png)\n\n# parcelable\n\nAndroid Parceling support for\nthe [Kotlinx Serialization library](https://github.com/Kotlin/kotlinx.serialization).\n\u003cbr/\u003e\u003cimg alt=\"GitHub tag (latest by date)\" src=\"https://img.shields.io/github/v/tag/chRyNaN/serialization-parcelable\"\u003e\n\u003ca href=\"https://androidweekly.net/issues/issue-450\"\u003e\u003cimg alt=\"Badge\" src=\"https://androidweekly.net/issues/issue-450/badge\" height=\"20px\"\u003e\u003c/img\u003e\u003c/a\u003e\n\n```kotlin\n// Add to Android Intent\nintent.putExtra(name = \"com.example.MyModel\", value = myModel, serializer = MyModel.serializer())\n\n// Retrieve from Android Intent\nval result =\n    intent.getParcelableExtra(name = \"com.example.MyModel\", deserializer = MyModel.serializer())\n\ncheck(result == myModel) // True\n\n// Compose\nval result = rememberSavable(serializer = MyModel.serializer()) { MyModel(...) }\n```\n\nAll serialization for an Android or Multi-platform project can be handled from a single library, no\nneed to create both\ncustom Android Parcelers and Serializers. Use\nthe [Kotlinx Serialization library](https://github.com/Kotlin/kotlinx.serialization), and it will\nautomatically work\nwith Android's `Parcel`, `Bundle`, and `Intent`.\n\n## Project Status\n\nThis is an **active** project, however, updates may be slow and responses delayed. The core\nfunctionality of the project is already implemented, but I do not have the time or resources to\nconstantly devote to the project. So, I will update and respond when I have time.\n\n\u003e [!Note]\n\u003e Please consider making a [contribution](https://www.buymeacoffee.com/chrynan) to support the\n\u003e development of this and my other open source projects. Thank you!\n\n### Background\n\nI originally created this project when I was stuck in a Covid-19 quarantine lockdown during my trip\nto Thailand. I wanted a way to leverage kotlinx.serialization to handle the parcelable data for\nAndroid so that I didn't have to create verbose duplicate serialization logic, or leverage another\nAndroid specific library which complicated a multiplatform codebase. So I hacked up this project and\nit worked! Since then, I have made the project multiplatform and added additional functionality,\nincluding adding support for Compose Multiplatform.\n\nThe convenience of having to write serialization logic for models once, and then it just working\nregardless of the format is huge! With this library, you no longer have to write Android-specific\nparcelables, duplicate models, or rely on another annotation processor or compiler plugin. Simply\nuse your existing serializable models, and use the `Parcelable` format whenever working with Android\ncomponents (Intents, Bundles, Parcels, etc.).\n\nMany organizations and individuals have utilized this project resulting in a peak of thousands of\ndownloads per month. Unfortunately, fewer have made contributions. While this project is open source\nand free to use in accordance with its [license](LICENSE), it takes time and resources to devote to\na project like this: from ideation, creation, implementation, maintenance, bug fixing,\ncommunication, and hosting. Unfortunately, the amount of time and resources I have to maintaining\nthis project continues to decline. I, like most people, have bills to pay and a life to live, so my\ntime spent on this project will continue to decline unless there is incentive to keep it going. If\nyou find this project useful and would like to keep it alive, please consider making\na [contribution](https://www.buymeacoffee.com/chrynan), thank you!\n\n## Getting Started 🏁\n\nThe library is provided through [Repsy.io](https://repsy.io). Checkout\nthe [releases page](https://github.com/chRyNaN/parcelable/releases) to get the latest version. \u003cbr/\u003e\n\u003cimg alt=\"GitHub tag (latest by date)\" src=\"https://img.shields.io/github/v/tag/chRyNaN/serialization-parcelable\"\u003e\n\n### Repository\n\n```kotlin\nrepositories {\n    maven { url = uri(\"https://repo.repsy.io/mvn/chrynan/public\") }\n}\n```\n\n### Dependency\n\n#### Core\n\n```kotlin\nimplementation(\"com.chrynan.parcelable:parcelable-core:$VERSION\")\n```\n\n#### Compose\n\n```kotlin\nimplementation(\"com.chrynan.parcelable:parcelable-compose:$VERSION\")\n```\n\n## Usage 👨‍💻\n\n### Set up the `Parcelable` object\n\nSimilar to the `Json` object introduced by\nthe [Kotlinx Serialization library](https://github.com/Kotlin/kotlinx.serialization), this library\nintroduces a\n`Parcelable` object. The extension functions default to using the `Parcelable.Default` value if\na `Parcelable` instance\nis not provided, but if customization is required, an instance can be created as follows:\n\n```kotlin\nval parcelable = Parcelable {\n    serializersModule = mySerializersModule\n}\n```\n\n### Use [Kotlinx Serialization](https://github.com/Kotlin/kotlinx.serialization)\n\nUtilize the [Kotlinx Serialization](https://github.com/Kotlin/kotlinx.serialization) to serialize\nyour model classes.\nThese classes can then be used with Android's `Bundle`, `Intent`, and `Parcel` objects.\n\n```kotlin\n@Serializable\ndata class MyModel(\n    val intField: Int,\n    val stringField: String,\n    val nullableStringField: String? = null\n)\n```\n\n### Encode and decode models\n\n#### `Intents` and `Bundles`\n\n```kotlin\n// Put\nintent.putExtra(key, myModel, parcelable)\nbundle.putParcelable(key, myModel, parcelable)\n\n// Get\nval myModel = intent.getParcelableExtra(key, parcelable)\nval myModel = bundle.getParcelable(key, parcelable)\n```\n\n#### `Parcels` and `Bundles`\n\n```kotlin\n// To\nparcelable.encodeToParcel(parcel, myModel)\nval bundle = parcelable.encodeToBundle(myModel)\n\n// From\nval myModel = parcelable.decodeFromParcel(parcel)\nval myModel = parcelable.decodeFromBundle(bundle)\n```\n\n#### `Saver` with Jetpack Compose\n\n```kotlin\nval model = rememberSavable(parcelable = parcelable, serializer = MyModel.serializer) { myModel }\n```\n\n### Multiplatform\n\nThis library is a Kotlin Multi-platform library and supports Android, iOS, JVM, and JS Kotlin\ntargets. The `Parcelable`\nand `Parcel` objects are available in the common source set and can be used to encode and decode\nmodels. Then, in\nplatform specific code, the `Parcels` can be stored and retrieved between different components (ex:\nAndroid Intents).\n\n```kotlin\n// Common Code\nval parcel = parcelable.encodeToParcel(serializer = MyModel.serializer(), value = myModel)\n\n// Android Code\nBundle().readFromParcel(parcel)\n```\n\n## Documentation 📃\n\nMore detailed documentation is available in the [docs](docs) folder. The entry point to the\ndocumentation can be\nfound [here](docs/index.md).\n\n## Sample\n\nThe `sample-android` module contains an Android App showcasing the use of this library and providing\na means to test\nparceling different models.\n\nSimply update the `ExpectedModel.model` value to be any Serializable class and run the application\nto test if the\nparceling worked.\n\n### Sample Screenshots\n\n![Main Screen](assets/sample_main_screenshot.png)\n![Results Screen](assets/sample_result_screenshot.png)\n\n## Security 🛡️\n\nFor security vulnerabilities, concerns, or issues, please responsibly disclose the information\neither by opening a\npublic GitHub Issue or reaching out to the project owner.\n\n## Contributing ✍️\n\nOutside contributions are welcome for this project. Please follow\nthe [code of conduct](CODE_OF_CONDUCT.md)\nand [coding conventions](CODING_CONVENTIONS.md) when contributing. If contributing code, please add\nthorough documents.\nand tests. Thank you!\n\n## Sponsorship ❤️\n\nSupport this project by [becoming a sponsor](https://www.buymeacoffee.com/chrynan) of my work! And\nmake sure to give the\nrepository a ⭐\n\n## License ⚖️\n\n```\nCopyright 2021 chRyNaN\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","funding_links":["https://www.buymeacoffee.com/chrynan","https://chrynan.codes"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrynan%2Fserialization-parcelable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrynan%2Fserialization-parcelable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrynan%2Fserialization-parcelable/lists"}