{"id":20287012,"url":"https://github.com/alexvasilkov/deprecated-event-bus","last_synced_at":"2025-12-18T02:57:05.534Z","repository":{"id":8803397,"uuid":"10498332","full_name":"alexvasilkov/deprecated-event-bus","owner":"alexvasilkov","description":"Android EventsBus implementation based on regular BroadcastReceivers","archived":false,"fork":false,"pushed_at":"2016-05-15T04:17:15.000Z","size":15,"stargazers_count":45,"open_issues_count":0,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-07T17:47:53.878Z","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/alexvasilkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-05T08:35:54.000Z","updated_at":"2018-10-27T02:33:01.000Z","dependencies_parsed_at":"2022-09-02T10:52:32.378Z","dependency_job_id":null,"html_url":"https://github.com/alexvasilkov/deprecated-event-bus","commit_stats":null,"previous_names":["alexvasilkov/fluffy-events"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alexvasilkov/deprecated-event-bus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexvasilkov%2Fdeprecated-event-bus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexvasilkov%2Fdeprecated-event-bus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexvasilkov%2Fdeprecated-event-bus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexvasilkov%2Fdeprecated-event-bus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexvasilkov","download_url":"https://codeload.github.com/alexvasilkov/deprecated-event-bus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexvasilkov%2Fdeprecated-event-bus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27790036,"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","status":"online","status_checked_at":"2025-12-18T02:00:09.725Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-14T14:37:51.274Z","updated_at":"2025-12-18T02:57:05.515Z","avatar_url":"https://github.com/alexvasilkov.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Deprecated ###\n\nThis library is not supported, consider using Handler-based [Events](https://github.com/alexvasilkov/Events).\n\n### Fluffy Events ###\n\nSimple events bus ([publish–subscribe](http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern)) implementation based on regular Android BroadcastReceivers mechanism.\n\n#### Usage ####\n\nFirst of all you should initialize EventsBus inside your Application class:\n\n    public final class MyApplication extends Application {\n        @Override\n        public void onCreate() {\n            super.onCreate();\n            EventsBus.init(this);\n        }\n    }\n\nTo receive events you'll need to register a listener:\n\n    int regId = EventsBus.register(listener);\n\nWhen you're done listen to the events you need to unregister from events bus using `regId` value received from `register()` method:\n\n    EventsBus.unregister(regId);\n\nFor activities it is recommended to register in the `onCreate()` (or in `onPostCreate()`) method and unregister in `onDestroy()` method.  \nFor fragments it is `onCreateView()` (`onViewCreated()`) and `onDestroyView()` methods respectively.  \n\nFluffy Events uses integer identifiers for events and Bundle as parameters holder.  \nSo it is recommended to declare you events ids and events parameters keys in `res/events.xml`:\n\n    \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n    \u003cresources\u003e\n\n        \u003c!-- Events ids --\u003e\n        \u003citem type=\"id\" name=\"my_event1\"/\u003e\n        \u003citem type=\"id\" name=\"my_event2\"/\u003e\n\n        \u003c!-- Params keys --\u003e\n        \u003cstring name=\"param_message\"\u003emessage\u003c/string\u003e\n\n    \u003c/resources\u003e\n\nor to create separate java class with constants:\n\n    public final class Events {\n\n        public static final int MY_EVENT1 = 1;\n        public static final int MY_EVENT2 = 2;\n\n        public static final String PARAM_MESSAGE = \"message\";\n\n    }\n\nNow you can start using bus to send events:\n\n    Bundle params = new Bundle();\n    params.putString(Events.PARAM_MESSAGE, \"Hello\");\n    EventsBus.send(Events.MY_EVENT1, params);\n\nand to receive them in your registered listener:\n\n    @Override\n    public void onEvent(int eventId, Bundle params, boolean isBroadcasted) {\n        switch (eventId) {\n            case Events.MY_EVENT1:\n                String msg = params.getString(Events.PARAM_MESSAGE);\n                Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();\n                break;\n        }\n    }\n\nAvailable methods:\n\n    send(int eventId);\n\n    send(int eventId, Bundle params);\n\n    send(int eventId, String receiverId);\n\n    send(int eventId, String receiverId, Bundle params);\n\n    sendSticky(int eventId);\n\n    sendSticky(int eventId, Bundle params);\n\n    sendSticky(int eventId, String receiverId);\n\n    sendSticky(int eventId, String receiverId, Bundle params);\n\n#### How to build ####\n\nYou need [Maven](http://maven.apache.org/) to build the project. Just run `mvn clean install` from project's root, jar file will be generated into `target` folder.\n\n#### License ####\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexvasilkov%2Fdeprecated-event-bus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexvasilkov%2Fdeprecated-event-bus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexvasilkov%2Fdeprecated-event-bus/lists"}