{"id":21899056,"url":"https://github.com/johnsonlee/sandbox","last_synced_at":"2026-02-08T19:01:22.573Z","repository":{"id":215807946,"uuid":"713391014","full_name":"johnsonlee/sandbox","owner":"johnsonlee","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-04T07:50:13.000Z","size":171,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-14T09:44:54.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/johnsonlee.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2023-11-02T12:31:56.000Z","updated_at":"2025-01-24T13:05:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"fffe87f8-a1e4-4892-b956-6221492fe9d3","html_url":"https://github.com/johnsonlee/sandbox","commit_stats":null,"previous_names":["johnsonlee/sandbox"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/johnsonlee/sandbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Fsandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Fsandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Fsandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Fsandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnsonlee","download_url":"https://codeload.github.com/johnsonlee/sandbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsonlee%2Fsandbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29240118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T18:06:38.086Z","status":"ssl_error","status_checked_at":"2026-02-08T18:06:09.124Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-28T14:37:16.228Z","updated_at":"2026-02-08T19:01:22.557Z","avatar_url":"https://github.com/johnsonlee.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Sandbox\n\nSandbox is a library that allows rendering Android UI directly on the JVM, without the need for an emulator or an Android device. This innovative tool provides a streamlined and efficient development experience for Android applications, enabling developers to render and test UI elements quickly and easily on their development machines. By eliminating the dependence on emulators or physical devices, Sandbox significantly speeds up the development and testing process, making it a valuable asset for Android developers looking to optimize their workflow..\n\n## Getting Started\n\n### Configure `build.gradle`\n\n```kotlin\ndependency {\n  implementation(\"io.johnsonlee.playground:sandbox:1.2.0\")\n}\n```\n\n### Extract Dependent AARs\n\nThis process can be automated via [Gradle TransformAction](https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.transform.TransformAction.html)\n\n*NOTE: please ignore this step if your project doesn't depends on any AAR library*\n\n### Setup Sandbox Environment\n\n```kotlin\nfun setup(extractedAarDir: File): Environment {\n    val libraries = extractedAarDir.listFiles { aar -\u003e\n        aar.resolve(SdkConstants.FN_ANDROID_MANIFEST_XML).exists()\n    }?.toList() ?: emptyList()\n\n    return Environment(\n        resourcePackageNames = libraries.map { aar -\u003e\n            AndroidManifestParser.parse(aar.resolve(SdkConstants.FN_ANDROID_MANIFEST_XML).toPath()).`package`\n        },\n        libraryResourceDirs = libraries.map { aar -\u003e\n            aar.resolve(SdkConstants.FD_RES)\n        }.filter(File::exists).map(File::getPath),\n        libraryAssetDirs = libraries.map { aar -\u003e\n            aar.resolve(SdkConstants.FD_ASSETS)\n        }.filter(File::exists).map(File::getPath)\n    )\n)\n```\n\n### Render your UI\n\n```kotlin\nval environment = setup(extractedAarDir)\nval sandbox = Sandbox(environment)\n\n// ...\n\nval result = sandbox.run(\n    showLayoutBounds = false\n) { context, parent -\u003e\n   // TODO: inflate the layout\n}.getOrThrow()\n\n// TODO: handle the rendering result\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnsonlee%2Fsandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnsonlee%2Fsandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnsonlee%2Fsandbox/lists"}