{"id":19541380,"url":"https://github.com/wingify/android-meg-demo-appllication","last_synced_at":"2026-06-11T18:31:27.194Z","repository":{"id":69982240,"uuid":"523663708","full_name":"wingify/android-meg-demo-appllication","owner":"wingify","description":"Demo Application to showcase Mutually Exclusive Workaround","archived":false,"fork":false,"pushed_at":"2022-08-11T13:05:32.000Z","size":113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-26T05:18:35.508Z","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/wingify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-08-11T09:34:59.000Z","updated_at":"2022-08-11T13:05:36.000Z","dependencies_parsed_at":"2023-02-23T11:00:49.416Z","dependency_job_id":null,"html_url":"https://github.com/wingify/android-meg-demo-appllication","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wingify/android-meg-demo-appllication","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fandroid-meg-demo-appllication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fandroid-meg-demo-appllication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fandroid-meg-demo-appllication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fandroid-meg-demo-appllication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wingify","download_url":"https://codeload.github.com/wingify/android-meg-demo-appllication/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fandroid-meg-demo-appllication/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34213180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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-11T03:10:13.305Z","updated_at":"2026-06-11T18:31:27.171Z","avatar_url":"https://github.com/wingify.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android MEG Demo Application\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n\n## Official SDK Documentation\n\nRefer [Official VWO Documentation](https://developers.vwo.com/reference/android-introduction)\n\n## Assumptions\n\n* This is a code-only workaround i.e. not controlled via VWO Application\n* A campaign can be a part of only one group\n* A group must have at least 2 campaigns\n\n## Usage\n\n**Group Schema**\n\n```json\n{ \"id\": 11, \"name\": \"Optional name\", \"campaignList\": [\u003clist-of-campaign-keys\u003e] }\n```\n\n**Creating Groups**\n\n```java\nHashMap\u003cString, Group\u003e groups = new HashMap\u003c\u003e();\n\nGroup group1 = new Group();\ngroup1.setId(1);\ngroup1.setName(\"Group 1\");\ngroup1.addCampaign(\"22\");\ngroup1.addCampaign(\"23\");\ngroup1.addCampaign(\"24\");\n\nGroup group2 = new Group();\ngroup2.setId(2);\ngroup2.setName(\"Group 2\");\ngroup2.addCampaign(\"23\"); // will not be added to group 2 because it already belongs to group 1\ngroup2.addCampaign(\"25\");\ngroup2.addCampaign(\"26\");\n\ngroups.put(group1.getName(), group1);\ngroups.put(group2.getName(), group2);\n\n```\n\n**There are 2 ways of getting the campaign**\n\n1. Passing campaign-key\n\n    ```java\n    HashMap\u003cString, String\u003e args = new HashMap\u003c\u003e();\n    args.put(MutuallyExclusiveGroups.ID_CAMPAIGN, \"24\");\n\n    String campaign = getCampaign(USER_ID, args);\n    ```\n\n    `campaign` will be `null`, if `campaignKey` passed is not the same as the winning campaign. Otherwise, the same `campaignkey` will be returned.\n\n\n2. Passingg group-id\n\n    ```java\n    HashMap\u003cString, String\u003e args = new HashMap\u003c\u003e();\n    args.put(MutuallyExclusiveGroups.ID_GROUP, \"2\");\n\n    String campaign = getCampaign(USER_ID, args);\n    ```\n\n    Campaign will be one of the campaigns from the group i.e. the winning campaign.\n\n\n\u003e **Note**: When both campaign-key and group-id are passed, evaluation will be based on groupId only\n\u003e\n\u003e ```java\n\u003eHashMap\u003cString, String\u003e args = new HashMap\u003c\u003e();\n\u003eargs.put(MutuallyExclusiveGroups.ID_CAMPAIGN, \"24\");\n\u003eargs.put(MutuallyExclusiveGroups.ID_GROUP, \"2\");\n\u003e\n\u003eString campaign = getCampaign(USER_ID, args);\n\u003e```\n\n## API Flow\n\n**getCampaign API Flow when campaign-key is passed**\n\n* Checks if a campaign is a part of any group\n* If not\n  * returns that campaign\n* If yes:\n  * Generates a random number/murmurhash corresponding to the User ID\n  * Normalises the UUID to be within 1-100\n  * Assigns equal weights to campaigns in a group\n  * Checks where the normalied value lies within a normally weighted group and picks that campaign(winning campaign)\n  * If the winning campaign matches with the passed campaign, return that campaign, otherwise null\n\n**getCampaign API Flow when group-id is passed**\n\n* Checks if the group exists\n* If no:\n  * return null\n* If yes:\n  * Generates a random number/murmurhash corresponding to the User ID\n  * Normalises the UUID to be within 1-100\n  * Assigns equal weights to campaigns in a group\n  * Checks where the normalied value lies within a normally weighted group and picks that campaign(winning campaign)\n  * Returns the winning campaign\n\n## Example Usage\n\n```java\nVWOConfig config = new VWOConfig.Builder()\n        .userID(USER_ID)\n        .build();\n\nVWO.with(this, key)\n        .config(config)\n        .launch(new VWOStatusListener() {\n            @Override\n            public void onVWOLoaded() {\n                log(\"VWO initialization success -\u003e afterInitSuccess()\");\n\n                HashMap\u003cString, String\u003e args = new HashMap\u003c\u003e();\n\n                // args.put(MutuallyExclusiveGroups.ID_CAMPAIGN, \"24\");\n                args.put(MutuallyExclusiveGroups.ID_GROUP, \"2\");\n\n                String mutuallyExclusiveCampaign = getCampaign(USER_ID, args);\n            }\n\n            @Override\n            public void onVWOLoadFailure(String reason) {\n                showToast(\"VWO init failed.\");\n            }\n        });\n```\n\n## Authors\n\n* Nabin Niroula - [xyznaveen](https://github.com/xyznaveen)\n\n## Contributing\n\nPlease go through our [contributing guidelines](https://github.com/wingify/android-meg-demo-application/blob/master/CONTRIBUTING.md)\n\n## Code of Conduct\n\n[Code of Conduct](https://github.com/wingify/android-meg-demo-application/blob/master/CODE_OF_CONDUCT.md)\n\n## License\n\n[Apache License, Version 2.0](https://github.com/wingify/android-meg-demo-application/blob/master/LICENSE)\n\nCopyright 2022 Wingify Software Pvt. Ltd.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fandroid-meg-demo-appllication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwingify%2Fandroid-meg-demo-appllication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fandroid-meg-demo-appllication/lists"}