{"id":15578710,"url":"https://github.com/iamwing/uc-client-android","last_synced_at":"2025-03-29T07:43:13.204Z","repository":{"id":80963597,"uuid":"116806929","full_name":"iamWing/uc-client-android","owner":"iamWing","description":"Android client library of Universal Controller","archived":false,"fork":false,"pushed_at":"2018-01-15T00:27:11.000Z","size":240,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-03T21:36:49.877Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamWing.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}},"created_at":"2018-01-09T11:22:59.000Z","updated_at":"2018-01-09T11:31:44.000Z","dependencies_parsed_at":"2023-03-06T18:30:40.485Z","dependency_job_id":null,"html_url":"https://github.com/iamWing/uc-client-android","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"9a74591d48ba204a132e2dc3b09a984523925bbd"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamWing%2Fuc-client-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamWing%2Fuc-client-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamWing%2Fuc-client-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamWing%2Fuc-client-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamWing","download_url":"https://codeload.github.com/iamWing/uc-client-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246156029,"owners_count":20732359,"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":[],"created_at":"2024-10-02T19:12:29.656Z","updated_at":"2025-03-29T07:43:13.186Z","avatar_url":"https://github.com/iamWing.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Universal Controller Client for Android\n\nUniversal Controller is a SDK that allows developers to use their customised \ncontroller on mobile devices or a tailor made hardware controller with unity. \nThis client side library is built for Android by using a background service to \nkeep the connection between the server and client alive. If you are just \nlooking for a Java based library, you can have a look a the \n[Universal Controller Client for Java](https://github.com/iamWing/uc-client-java).\n\nFor the server side SDK, it can be found \n[here](https://github.com/iamWing/UniversalController_Server).\n\n---\n\n## Getting start\n\nTo get the connection made between the Android client and the server, and keep \nit alive through out different activities, you must retrieve the service in all \nthe activities that invoke with the connection.\n\n```java\nprivate String ip = \"\";\n    private int port = 28910;\n\n    private UCClientService mService;\n    private boolean mBound = false;\n\n    private ServiceConnection conn = new ServiceConnection() {\n        @Override\n        public void onServiceConnected(ComponentName name, IBinder service) {\n            UCClientService.UCClientServiceBinder binder =\n                    (UCClientService.UCClientServiceBinder) service;\n\n            mService = binder.getService();\n            mService.setServiceListener(MainActivity.this);\n            mBound = true;\n        }\n\n        @Override\n        public void onServiceDisconnected(ComponentName name) {\n            mBound = false;\n        }\n    };\n\n...\n\n@Override\n    protected void onDestroy() {\n        super.onDestroy();\n\n        if (mBound)\n            unbindService(conn);\n    }\n```\n\nAlso, as in most case the active activity will not be the same throughout your \napplication, you will need to update the listener after intent to another \nactivity by using `mService.setServiceListener(IUCServiceListener)`.\n\nAnd depends on the performance of your server, you should set a time interval \nbetween each send action of the commands to server. As tested, 50ms should be \nshortest value that a normal PC can handles and not returning errors due to \nmultiple commands received in an extremely short period of time too often.\n\nFor the commands that will be sent to the server, please refer to the \ndocument of the server side SDK.\n\n---\n\n## Version history\n\n__v1.0.0__\n\n- Implemented custom background service for socket connection.\n- Implemented commands needed to communicate with Universal Controller Server.\n- Included a sample application module.\n\n---\n\n## License \u0026 copyright\n\nCopyright (c) 2018 Wing Chau \u0026 AlphaOwl.co.uk\n\u003cbr /\u003e\nAll rights reserved.\n\nThis software may be modified and distributed under the terms\nof the MIT license. See the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamwing%2Fuc-client-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamwing%2Fuc-client-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamwing%2Fuc-client-android/lists"}