{"id":23080677,"url":"https://github.com/chen0040/spring-websocket-android-client-demo","last_synced_at":"2025-07-16T19:36:54.362Z","repository":{"id":85884805,"uuid":"113602698","full_name":"chen0040/spring-websocket-android-client-demo","owner":"chen0040","description":"Demo on how to integrate spring websocket on the server with android client","archived":false,"fork":false,"pushed_at":"2017-12-10T05:57:09.000Z","size":959,"stargazers_count":23,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-12T07:09:41.096Z","etag":null,"topics":["android","spring-boot","websocket"],"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/chen0040.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":"2017-12-08T17:59:15.000Z","updated_at":"2022-06-19T02:47:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"3dc60d74-7dd4-4a6a-8362-dc04140ae843","html_url":"https://github.com/chen0040/spring-websocket-android-client-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chen0040/spring-websocket-android-client-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fspring-websocket-android-client-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fspring-websocket-android-client-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fspring-websocket-android-client-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fspring-websocket-android-client-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chen0040","download_url":"https://codeload.github.com/chen0040/spring-websocket-android-client-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fspring-websocket-android-client-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265534924,"owners_count":23783918,"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","spring-boot","websocket"],"created_at":"2024-12-16T13:16:01.098Z","updated_at":"2025-07-16T19:36:54.357Z","avatar_url":"https://github.com/chen0040.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spring-websocket-android-client-demo\n\nDemo of connecting android client to spring web application via websocket\n\n# Usage\n\n### WebSocket Spring Boot Server\n\ngit clone this project, run the \"./make.ps1\" powershell script in the project root directory to build spring-boot-application.jar\ninto the \"bin\" folder.\n\nRun the following command to start the spring-boot-application at http://localhost:8080\n\n```bash\njava -jar bin/spring-boot-application.jar\n```\n\nThe spring-boot-application defines an end point at http://localhost:8080/my-ws and sends a ping message to any connected client that subscribe to its topic \"/topics/event\" every 10 seconds. the angularjs demo can be viewed by navigating to http://localhost:8080 on your web browser.\n\n### Android WebSocket Client\n\nThe spring-boot-android-client project contains the implementation of the android websocket client. To subscribe to the \"/topics/event\" at http://localhost:8080/my-ws, run the following android codes:\n\n```java\n\nSpringBootWebSocketClient client = new SpringBootWebSocketClient();\nclient.setId(\"sub-001\");\nTopicHandler handler = client.subscribe(\"/topics/event\");\nhandler.addListener(new StompMessageListener() {\n @Override\n public void onMessage(StompMessage message) {\n    System.out.println(message.getHeader(\"destination\") + \": \" + message.getContent());\n }\n});\nclient.connect(\"ws://localhost:8080/my-ws/websocket\");\nThread.sleep(60000L);\nclient.disconnect();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchen0040%2Fspring-websocket-android-client-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchen0040%2Fspring-websocket-android-client-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchen0040%2Fspring-websocket-android-client-demo/lists"}