{"id":19442601,"url":"https://github.com/ackeecz/android-user-agent","last_synced_at":"2026-01-11T16:56:02.220Z","repository":{"id":46176409,"uuid":"130667317","full_name":"AckeeCZ/android-user-agent","owner":"AckeeCZ","description":"Library that generates User-Agent string for http requests","archived":false,"fork":false,"pushed_at":"2023-05-02T10:34:17.000Z","size":133,"stargazers_count":17,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T13:15:32.721Z","etag":null,"topics":["android","http","user-agent"],"latest_commit_sha":null,"homepage":null,"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/AckeeCZ.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":"2018-04-23T08:46:34.000Z","updated_at":"2025-02-21T15:50:20.000Z","dependencies_parsed_at":"2024-11-10T15:43:07.893Z","dependency_job_id":"c2c448c3-fca2-4eab-86a1-87c0cc01987b","html_url":"https://github.com/AckeeCZ/android-user-agent","commit_stats":null,"previous_names":["ackeecz/user-agent"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fandroid-user-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fandroid-user-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fandroid-user-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fandroid-user-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AckeeCZ","download_url":"https://codeload.github.com/AckeeCZ/android-user-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250733192,"owners_count":21478307,"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","http","user-agent"],"created_at":"2024-11-10T15:40:04.977Z","updated_at":"2026-01-11T16:56:02.213Z","avatar_url":"https://github.com/AckeeCZ.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[ ![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.ackeecz/user-agent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.ackeecz/user-agent)\n\n# Android User Agent Library\nLibrary that generates User-Agent string for HTTP requests. \n\n## Purpose of this library\nIn Ackee, we need more info in User-Agent header than standard `System.getProperty(\"http.agent\")` provides and purpose of this library is to provide better one. \nThe default format of our User-Agent is:\n```\napplication_name/application_version (package_name; build:version_code; Android android_version; Model:device_model) network_client_user_agent\n```\nso example of one of our application\n```\nTapito/2.5.8 (com.tapmedia.tapito.debug; build:1520; Android 7.0; Model:Nexus 5X) okhttp/3.2.0\n```\n\n## Dependencies\n```groovy\nimplementation \"io.github.ackeecz:user-agent:x.x.x\"\n```\n\n### Usage\nUsage is very simple, just create an instance of `UserAgent` class with an optional `Normalizer` \ninstance for a custom normalization. Library already provides a few `Normalizer` implementations\nfor a quick setup. \n\nBecause of an abstraction from the HTTP library you use, there is a need for passing the user agent \nstring of this library. We use practically everywhere OkHttp but who knows. \n\nExample in OkHttp interceptor:\n\n```kotlin\n// Create the instance somewhere. Probably outside of the interceptor proceed call.\nval userAgent = UserAgent(context)\n\nval request = chain.request()\n                  .newBuilder()\n                  .header(\"User-Agent\", userAgent.getUserAgentString(Version.userAgent()))\n                  .build()\n```\n\n`Version.userAgent()` is getter for OkHttp string like `okhttp/3.2.0`\n\n## License\nCopyright 2023 Ackee, s.r.o.\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\nhttp://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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fackeecz%2Fandroid-user-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fackeecz%2Fandroid-user-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fackeecz%2Fandroid-user-agent/lists"}