{"id":18111524,"url":"https://github.com/gotev/swapi-android","last_synced_at":"2026-03-06T21:31:17.349Z","repository":{"id":37984016,"uuid":"251121058","full_name":"gotev/swapi-android","owner":"gotev","description":"Star Wars API, Android Client SDK \u0026 Demo App written with declarative \u0026 dynamic approach in mind","archived":false,"fork":false,"pushed_at":"2022-12-07T04:03:19.000Z","size":6518,"stargazers_count":7,"open_issues_count":8,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T03:41:30.827Z","etag":null,"topics":["android","client","kotlin","sdk","star","swapi","wars"],"latest_commit_sha":null,"homepage":"https://gotev.github.io/swapi-android","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/gotev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://paypal.me/alexgt"]}},"created_at":"2020-03-29T19:54:50.000Z","updated_at":"2024-07-09T18:11:17.000Z","dependencies_parsed_at":"2023-01-24T13:30:24.801Z","dependency_job_id":null,"html_url":"https://github.com/gotev/swapi-android","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/gotev/swapi-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotev%2Fswapi-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotev%2Fswapi-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotev%2Fswapi-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotev%2Fswapi-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gotev","download_url":"https://codeload.github.com/gotev/swapi-android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotev%2Fswapi-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30198661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["android","client","kotlin","sdk","star","swapi","wars"],"created_at":"2024-11-01T01:06:08.362Z","updated_at":"2026-03-06T21:31:17.329Z","avatar_url":"https://github.com/gotev.png","language":"Kotlin","readme":"# SWAPI SDK\n[SWAPI.co](https://swapi.co/):\n- Kotlin Client for Android using Coroutines\n- Demo App using the SDK with declarative/functional UI approach\n- API Mirror: https://gotev.github.io/swapi-android, to reduce loads on https://swapi.co/api/ origin server\n\n[Download Demo App](https://github.com/gotev/swapi-android/releases/download/1.1.0/app-debug.apk)\n\nThis project is the main subject of the talk `Declarative Dynamic UI`, hosted by [Android Developers Italia](https://androiddevs.it).\n\n[YouTube Video (italian)](https://www.youtube.com/watch?v=fivfxxW82gk) | [Slides](https://github.com/gotev/swapi-android/blob/master/assets/Declarative%20Dynamic%20UI.pdf)\n\n## Why?\nThis SDK and Demo App are made to have a common ground to promote discussions about:\n- Architecture\n- Technologies\n- Modeling\n- UI/UX\n- Approaches\n- ...whatever else comes to mind\n\nToo often, we as developers are tied to the specific business domain on which we are working on and when the time comes to exchange ideas with other developers, some effort has to be made to de-contextualize what we are doing in our day-to-day job to present it to others.\n\nThis is a complete app which has various challenges to solve. **It's not perfect** and probably never will be, so feel free to open discussions about every aspect and tell your ideas. Also, **this is only one in a million ways** to achieve the same result.\n\nYou have many ways to use this repository:\n- Use the SDK as a Gradle dependency\n- Fork the project and modify the demo app, the SDK or both\n- Study it\n- Use it like a template for other projects\n- Contribute to this project with your own additions. Motivate them in Pull Requests.\n\n## Technology Stack\n- Kotlin + Coroutines\n- OkHttp 4\n- Moshi\n- Retrofit\n- ThreeTenABP\n\n## Using the library\n```groovy\nimplementation 'net.gotev:swapi-sdk:x.y.z'\n```\nReplace `x.y.z` with [ ![Download](https://api.bintray.com/packages/gotev/maven/swapi-sdk/images/download.svg) ](https://bintray.com/gotev/maven/swapi-sdk/_latestVersion)\n\nInitialize it in your `Application`\n\n```kotlin\nclass App : Application() {\n    override fun onCreate() {\n        super.onCreate()\n\n        initializeSwapiClient(this)\n    }\n}\n```\n\nAnd then you can make requests from Coroutine Scopes to get data for each resource.\n\nYou can also pass in your own `OkHttpClient` instance if you have a global one in your app and decide if you want to use mirror or origin API server.\n\n\u003e By default, to reduce loads on SWAPI.co, the client will point to the SWAPI mirror hosted on this project's GitHub Pages: https://gotev.github.io/swapi-android\n\nAll the domain models are also `Parcelable` so you can safely pass them as arguments.\n\n```kotlin\nswapiClient.species()\nswapiClient.characters()\nswapiClient.films()\nswapiClient.species()\nswapiClient.vehicles()\nswapiClient.starships()\n```\n\nYou will get a `PagedResponse\u003cT\u003e` from those API calls. From each one you can request `previousPage()` and `nextPage()`.\n\nTo request a specific page of data for `species`, `characters`, `films`, `species`, `vehicles` and `starships`, you can pass a page value:\n\n```kotlin\nswapiClient.species(page = 2)\n```\n\nIt's also possible to fetch a single resource from its URL. Each domain model has a unique URL. For example, to fetch `https://swapi.co/api/people/1/`\n\n```kotlin\nval lukeSkywalker = swapiClient.character(\"https://swapi.co/api/people/1/\")\n```\n\n## Mirror\nThis project has the ability to make a complete API mirror from `SWAPI.co`. Go into `mirror` directory and launch:\n\n```\n./fetch\n```\n\nThis will update:\n- The JSONs used in SWAPI SDK unit tests, saved in `fetched` sub directory\n- The SWAPI.co API mirror in the `docs` directory, which is the GitHub Pages source\n\n## Dependency Updates\nKeeping dependencies always up to date can be annoying. To ease things, a gradle plugin has been added which automatically checks for new versions. Just run:\n\n```\n./gradlew dependencyUpdates\n```\n\nAnd you will see a complete report of actual and new dependencies versions.\n\n## Release\nLibrary can be released:\n- **locally**: `./release local`. This is going to create a `releases` directory which can be used as a Maven Repository.\n","funding_links":["https://paypal.me/alexgt"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgotev%2Fswapi-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgotev%2Fswapi-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgotev%2Fswapi-android/lists"}