{"action":"created","comment":{"url":"https://api.github.com/repos/opendatakit/collect/pulls/comments/200246980","pull_request_review_id":134523456,"id":200246980,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDI0Njk4MA==","diff_hunk":"@@ -0,0 +1,66 @@\n+/*\n+Copyright 2018 Ephraim Kigamba\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+*/\n+\n+package org.odk.collect.android.utilities;\n+\n+import android.content.Context;\n+import android.content.Intent;\n+import android.support.annotation.NonNull;\n+import android.support.annotation.Nullable;\n+\n+/**\n+ * This helper broadcasts the result of the form download initiated in {@link org.odk.collect.android.services.FormDownloadService}\n+ *\n+ * @author Ephraim Kigamba (nek.eam@gmail.com)\n+ */\n+\n+public final class FormDownloadBroadcastHelper {","path":"collect_app/src/main/java/org/odk/collect/android/utilities/FormDownloadBroadcastHelper.java","position":30,"original_position":30,"commit_id":"068a263c912a2003409c99e0f2f511d579eeab83","original_commit_id":"068a263c912a2003409c99e0f2f511d579eeab83","user":{"login":"ekigamba","id":31766075,"node_id":"MDQ6VXNlcjMxNzY2MDc1","avatar_url":"https://avatars0.githubusercontent.com/u/31766075?v=4","gravatar_id":"","url":"https://api.github.com/users/ekigamba","html_url":"https://github.com/ekigamba","followers_url":"https://api.github.com/users/ekigamba/followers","following_url":"https://api.github.com/users/ekigamba/following{/other_user}","gists_url":"https://api.github.com/users/ekigamba/gists{/gist_id}","starred_url":"https://api.github.com/users/ekigamba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekigamba/subscriptions","organizations_url":"https://api.github.com/users/ekigamba/orgs","repos_url":"https://api.github.com/users/ekigamba/repos","events_url":"https://api.github.com/users/ekigamba/events{/privacy}","received_events_url":"https://api.github.com/users/ekigamba/received_events","type":"User","site_admin":false},"body":"@lognaturel that's an idea","created_at":"2018-07-05T06:46:56Z","updated_at":"2018-07-05T06:46:56Z","html_url":"https://github.com/opendatakit/collect/pull/2348#discussion_r200246980","pull_request_url":"https://api.github.com/repos/opendatakit/collect/pulls/2348","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/opendatakit/collect/pulls/comments/200246980"},"html":{"href":"https://github.com/opendatakit/collect/pull/2348#discussion_r200246980"},"pull_request":{"href":"https://api.github.com/repos/opendatakit/collect/pulls/2348"}},"in_reply_to_id":199924599},"pull_request":{"url":"https://api.github.com/repos/opendatakit/collect/pulls/2348","id":198912969,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4OTEyOTY5","html_url":"https://github.com/opendatakit/collect/pull/2348","diff_url":"https://github.com/opendatakit/collect/pull/2348.diff","patch_url":"https://github.com/opendatakit/collect/pull/2348.patch","issue_url":"https://api.github.com/repos/opendatakit/collect/issues/2348","number":2348,"state":"open","locked":false,"title":"Add intent to enable form download from an external app","user":{"login":"ekigamba","id":31766075,"node_id":"MDQ6VXNlcjMxNzY2MDc1","avatar_url":"https://avatars0.githubusercontent.com/u/31766075?v=4","gravatar_id":"","url":"https://api.github.com/users/ekigamba","html_url":"https://github.com/ekigamba","followers_url":"https://api.github.com/users/ekigamba/followers","following_url":"https://api.github.com/users/ekigamba/following{/other_user}","gists_url":"https://api.github.com/users/ekigamba/gists{/gist_id}","starred_url":"https://api.github.com/users/ekigamba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekigamba/subscriptions","organizations_url":"https://api.github.com/users/ekigamba/orgs","repos_url":"https://api.github.com/users/ekigamba/repos","events_url":"https://api.github.com/users/ekigamba/events{/privacy}","received_events_url":"https://api.github.com/users/ekigamba/received_events","type":"User","site_admin":false},"body":"Closes #2339 \r\n\r\n<!-- \r\nThank you for contributing to ODK Collect!\r\n\r\nBefore sending this PR, please read\r\nhttps://github.com/opendatakit/collect/blob/master/CONTRIBUTING.md\r\n-->\r\n\r\n#### What has been done to verify that this works as intended?\r\n\r\nIt has been tested with an external app on different devices.\r\n\r\n#### Why is this the best possible solution? Were any other approaches considered?\r\n\r\nThis is the best solution since it provides the most fluid experience to the user when using an external app. It is less intrusive.\r\n\r\n#### Are there any risks to merging this code? If so, what are they?\r\n\r\nNope, any & all features added do not interfere with current functionality or code.\r\n\r\n#### Do we need any specific form for testing your changes? If so, please attach one.\r\n\r\nNo\r\n\r\n#### Does this change require updates to documentation? If so, please file an issue [here]( https://github.com/opendatakit/docs/issues/new) and include the link below.\r\n\r\nhttps://github.com/opendatakit/docs/issues/757\r\n\r\n#### Before submitting this PR, please make sure you have:\r\n- [x] run `./gradlew pmd checkstyle lint findbugs` and confirmed all checks still pass.\r\n- [x] verified that any new UI elements use theme colors. [UI Components Style guidelines](https://github.com/opendatakit/collect/blob/master/CONTRIBUTING.md#ui-components-style-guidelines)\r\n\r\n\r\n## Implementation:\r\n\r\nAn external app has to call the service `org.odk.collect.android.services.FormDownloadService` of the package `org.odk.collect.android` and pass a string extra of the `formId` with the key **FORM_ID**. The service is started and immediately starts an evernote android job.\r\n\r\nThe job queries the server for a list of forms and if the form exists, it is downloaded. In case of a **SUCCESS** or **FAILURE**, a broadcast of `ACTION` **org.odk.collect.FORM_DOWNLOAD.COMPLETE** is sent out.\r\n\r\nThis broadcast has the following extras:\r\n\r\nKey | Optional | Data type | Meaning | Possible Values\r\n--- | --- | --- | --- | ---\r\n`SUCCESSFUL` |  No | boolean | Was the download successful | `true` or `false`\r\n`ERROR_MSG` | Yes | String | The reason for the error in case `SUCCESSFUL == false` | \r\n`FORM_ID` | Yes | String | The form id for which the download was a success or failure | `null` OR Any string value\r\n\r\nThe service can handle simultaneous download calls & failures independently.\r\n\r\nThe following the the possible errors:\r\n\r\nError Message | Meaning\r\n--- | ---\r\nRequested form could not be found | The form id is probably wrong, ODK Collect has the wrong settings or poor/no network connection\r\nBundle does not contain the FORM_ID\r\nNull FORM_ID\r\n","created_at":"2018-07-03T10:07:27Z","updated_at":"2018-07-05T06:46:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2483270da08ef498d9a0bb4c3692c4175857e849","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/opendatakit/collect/pulls/2348/commits","review_comments_url":"https://api.github.com/repos/opendatakit/collect/pulls/2348/comments","review_comment_url":"https://api.github.com/repos/opendatakit/collect/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opendatakit/collect/issues/2348/comments","statuses_url":"https://api.github.com/repos/opendatakit/collect/statuses/068a263c912a2003409c99e0f2f511d579eeab83","head":{"label":"onaio:2339-intent-download-form","ref":"2339-intent-download-form","sha":"068a263c912a2003409c99e0f2f511d579eeab83","user":{"login":"onaio","id":5450613,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NTA2MTM=","avatar_url":"https://avatars3.githubusercontent.com/u/5450613?v=4","gravatar_id":"","url":"https://api.github.com/users/onaio","html_url":"https://github.com/onaio","followers_url":"https://api.github.com/users/onaio/followers","following_url":"https://api.github.com/users/onaio/following{/other_user}","gists_url":"https://api.github.com/users/onaio/gists{/gist_id}","starred_url":"https://api.github.com/users/onaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onaio/subscriptions","organizations_url":"https://api.github.com/users/onaio/orgs","repos_url":"https://api.github.com/users/onaio/repos","events_url":"https://api.github.com/users/onaio/events{/privacy}","received_events_url":"https://api.github.com/users/onaio/received_events","type":"Organization","site_admin":false},"repo":{"id":42706494,"node_id":"MDEwOlJlcG9zaXRvcnk0MjcwNjQ5NA==","name":"collect","full_name":"onaio/collect","owner":{"login":"onaio","id":5450613,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NTA2MTM=","avatar_url":"https://avatars3.githubusercontent.com/u/5450613?v=4","gravatar_id":"","url":"https://api.github.com/users/onaio","html_url":"https://github.com/onaio","followers_url":"https://api.github.com/users/onaio/followers","following_url":"https://api.github.com/users/onaio/following{/other_user}","gists_url":"https://api.github.com/users/onaio/gists{/gist_id}","starred_url":"https://api.github.com/users/onaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onaio/subscriptions","organizations_url":"https://api.github.com/users/onaio/orgs","repos_url":"https://api.github.com/users/onaio/repos","events_url":"https://api.github.com/users/onaio/events{/privacy}","received_events_url":"https://api.github.com/users/onaio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onaio/collect","description":"Copy of collect with checkin history fixed","fork":true,"url":"https://api.github.com/repos/onaio/collect","forks_url":"https://api.github.com/repos/onaio/collect/forks","keys_url":"https://api.github.com/repos/onaio/collect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onaio/collect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onaio/collect/teams","hooks_url":"https://api.github.com/repos/onaio/collect/hooks","issue_events_url":"https://api.github.com/repos/onaio/collect/issues/events{/number}","events_url":"https://api.github.com/repos/onaio/collect/events","assignees_url":"https://api.github.com/repos/onaio/collect/assignees{/user}","branches_url":"https://api.github.com/repos/onaio/collect/branches{/branch}","tags_url":"https://api.github.com/repos/onaio/collect/tags","blobs_url":"https://api.github.com/repos/onaio/collect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onaio/collect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onaio/collect/git/refs{/sha}","trees_url":"https://api.github.com/repos/onaio/collect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onaio/collect/statuses/{sha}","languages_url":"https://api.github.com/repos/onaio/collect/languages","stargazers_url":"https://api.github.com/repos/onaio/collect/stargazers","contributors_url":"https://api.github.com/repos/onaio/collect/contributors","subscribers_url":"https://api.github.com/repos/onaio/collect/subscribers","subscription_url":"https://api.github.com/repos/onaio/collect/subscription","commits_url":"https://api.github.com/repos/onaio/collect/commits{/sha}","git_commits_url":"https://api.github.com/repos/onaio/collect/git/commits{/sha}","comments_url":"https://api.github.com/repos/onaio/collect/comments{/number}","issue_comment_url":"https://api.github.com/repos/onaio/collect/issues/comments{/number}","contents_url":"https://api.github.com/repos/onaio/collect/contents/{+path}","compare_url":"https://api.github.com/repos/onaio/collect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onaio/collect/merges","archive_url":"https://api.github.com/repos/onaio/collect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onaio/collect/downloads","issues_url":"https://api.github.com/repos/onaio/collect/issues{/number}","pulls_url":"https://api.github.com/repos/onaio/collect/pulls{/number}","milestones_url":"https://api.github.com/repos/onaio/collect/milestones{/number}","notifications_url":"https://api.github.com/repos/onaio/collect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onaio/collect/labels{/name}","releases_url":"https://api.github.com/repos/onaio/collect/releases{/id}","deployments_url":"https://api.github.com/repos/onaio/collect/deployments","created_at":"2015-09-18T07:30:42Z","updated_at":"2018-07-03T15:45:01Z","pushed_at":"2018-07-03T13:15:20Z","git_url":"git://github.com/onaio/collect.git","ssh_url":"git@github.com:onaio/collect.git","clone_url":"https://github.com/onaio/collect.git","svn_url":"https://github.com/onaio/collect","homepage":"https://github.com/opendatakit/opendatakit","size":44091,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":2,"open_issues":15,"watchers":1,"default_branch":"ona_collect"}},"base":{"label":"opendatakit:master","ref":"master","sha":"77891f4a4c8d291826ee47f269eae44c3ea5fae3","user":{"login":"opendatakit","id":6222985,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMjI5ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/6222985?v=4","gravatar_id":"","url":"https://api.github.com/users/opendatakit","html_url":"https://github.com/opendatakit","followers_url":"https://api.github.com/users/opendatakit/followers","following_url":"https://api.github.com/users/opendatakit/following{/other_user}","gists_url":"https://api.github.com/users/opendatakit/gists{/gist_id}","starred_url":"https://api.github.com/users/opendatakit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opendatakit/subscriptions","organizations_url":"https://api.github.com/users/opendatakit/orgs","repos_url":"https://api.github.com/users/opendatakit/repos","events_url":"https://api.github.com/users/opendatakit/events{/privacy}","received_events_url":"https://api.github.com/users/opendatakit/received_events","type":"Organization","site_admin":false},"repo":{"id":40213809,"node_id":"MDEwOlJlcG9zaXRvcnk0MDIxMzgwOQ==","name":"collect","full_name":"opendatakit/collect","owner":{"login":"opendatakit","id":6222985,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMjI5ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/6222985?v=4","gravatar_id":"","url":"https://api.github.com/users/opendatakit","html_url":"https://github.com/opendatakit","followers_url":"https://api.github.com/users/opendatakit/followers","following_url":"https://api.github.com/users/opendatakit/following{/other_user}","gists_url":"https://api.github.com/users/opendatakit/gists{/gist_id}","starred_url":"https://api.github.com/users/opendatakit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opendatakit/subscriptions","organizations_url":"https://api.github.com/users/opendatakit/orgs","repos_url":"https://api.github.com/users/opendatakit/repos","events_url":"https://api.github.com/users/opendatakit/events{/privacy}","received_events_url":"https://api.github.com/users/opendatakit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opendatakit/collect","description":"ODK Collect is an Android app for filling out forms. It's been used to collect billions of data points in challenging environments around the world. Contribute and make the world a better place! ✨📋✨","fork":false,"url":"https://api.github.com/repos/opendatakit/collect","forks_url":"https://api.github.com/repos/opendatakit/collect/forks","keys_url":"https://api.github.com/repos/opendatakit/collect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opendatakit/collect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opendatakit/collect/teams","hooks_url":"https://api.github.com/repos/opendatakit/collect/hooks","issue_events_url":"https://api.github.com/repos/opendatakit/collect/issues/events{/number}","events_url":"https://api.github.com/repos/opendatakit/collect/events","assignees_url":"https://api.github.com/repos/opendatakit/collect/assignees{/user}","branches_url":"https://api.github.com/repos/opendatakit/collect/branches{/branch}","tags_url":"https://api.github.com/repos/opendatakit/collect/tags","blobs_url":"https://api.github.com/repos/opendatakit/collect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opendatakit/collect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opendatakit/collect/git/refs{/sha}","trees_url":"https://api.github.com/repos/opendatakit/collect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opendatakit/collect/statuses/{sha}","languages_url":"https://api.github.com/repos/opendatakit/collect/languages","stargazers_url":"https://api.github.com/repos/opendatakit/collect/stargazers","contributors_url":"https://api.github.com/repos/opendatakit/collect/contributors","subscribers_url":"https://api.github.com/repos/opendatakit/collect/subscribers","subscription_url":"https://api.github.com/repos/opendatakit/collect/subscription","commits_url":"https://api.github.com/repos/opendatakit/collect/commits{/sha}","git_commits_url":"https://api.github.com/repos/opendatakit/collect/git/commits{/sha}","comments_url":"https://api.github.com/repos/opendatakit/collect/comments{/number}","issue_comment_url":"https://api.github.com/repos/opendatakit/collect/issues/comments{/number}","contents_url":"https://api.github.com/repos/opendatakit/collect/contents/{+path}","compare_url":"https://api.github.com/repos/opendatakit/collect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opendatakit/collect/merges","archive_url":"https://api.github.com/repos/opendatakit/collect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opendatakit/collect/downloads","issues_url":"https://api.github.com/repos/opendatakit/collect/issues{/number}","pulls_url":"https://api.github.com/repos/opendatakit/collect/pulls{/number}","milestones_url":"https://api.github.com/repos/opendatakit/collect/milestones{/number}","notifications_url":"https://api.github.com/repos/opendatakit/collect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opendatakit/collect/labels{/name}","releases_url":"https://api.github.com/repos/opendatakit/collect/releases{/id}","deployments_url":"https://api.github.com/repos/opendatakit/collect/deployments","created_at":"2015-08-04T23:21:33Z","updated_at":"2018-07-03T16:59:59Z","pushed_at":"2018-07-05T06:05:59Z","git_url":"git://github.com/opendatakit/collect.git","ssh_url":"git@github.com:opendatakit/collect.git","clone_url":"https://github.com/opendatakit/collect.git","svn_url":"https://github.com/opendatakit/collect","homepage":"https://docs.opendatakit.org/collect-intro","size":40876,"stargazers_count":306,"watchers_count":306,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":652,"mirror_url":null,"archived":false,"open_issues_count":210,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":652,"open_issues":210,"watchers":306,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opendatakit/collect/pulls/2348"},"html":{"href":"https://github.com/opendatakit/collect/pull/2348"},"issue":{"href":"https://api.github.com/repos/opendatakit/collect/issues/2348"},"comments":{"href":"https://api.github.com/repos/opendatakit/collect/issues/2348/comments"},"review_comments":{"href":"https://api.github.com/repos/opendatakit/collect/pulls/2348/comments"},"review_comment":{"href":"https://api.github.com/repos/opendatakit/collect/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opendatakit/collect/pulls/2348/commits"},"statuses":{"href":"https://api.github.com/repos/opendatakit/collect/statuses/068a263c912a2003409c99e0f2f511d579eeab83"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ekigamba"}}