{"action":"created","comment":{"url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/comments/78984861","id":78984861,"diff_hunk":"@@ -0,0 +1,140 @@\n+package org.dhis2.mobile.processors;\n+\n+import android.content.Context;\n+import android.os.Handler;\n+import android.os.Looper;\n+import android.support.design.widget.Snackbar;\n+import android.telephony.SmsManager;\n+import android.util.Log;\n+import android.widget.Toast;\n+\n+import com.google.gson.Gson;\n+import com.google.gson.JsonArray;\n+import com.google.gson.JsonObject;\n+\n+import org.dhis2.mobile.io.Constants;\n+import org.dhis2.mobile.io.holders.DatasetInfoHolder;\n+import org.dhis2.mobile.io.models.CategoryOption;\n+import org.dhis2.mobile.io.models.Field;\n+import org.dhis2.mobile.io.models.Group;\n+import org.dhis2.mobile.network.NetworkUtils;\n+import org.dhis2.mobile.utils.KeyGenerator;\n+import org.dhis2.mobile.utils.PrefUtils;\n+import org.dhis2.mobile.utils.TextFileUtils;\n+import org.joda.time.LocalDate;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+/**\n+ * Created by george on 8/10/16.\n+ */\n+public class SendSmsProcessor {\n+    public static final String TAG = SendSmsProcessor.class.getSimpleName();\n+\n+    public static void send (Context context, DatasetInfoHolder info, ArrayList<Group> groups){\n+        String data = prepareContent(info, groups, context);\n+        //insert destination number\n+        sendSMS(context, \"<insert number here>\", data);\n+        if (!NetworkUtils.checkConnection(context)) {\n+            saveDataset(context, data, info);\n+            return;\n+        }\n+\n+\n+    }\n+    private static String prepareContent(DatasetInfoHolder info, ArrayList<Group> groups, Context context){\n+        JsonObject content = new JsonObject();\n+        KeyGenerator generator = new KeyGenerator();\n+        Log.d(\"Generator\", generator.parse(groups, \"command\"));","path":"dhis2-android-app/src/main/java/org/dhis2/mobile/processors/SendSmsProcessor.java","position":49,"original_position":49,"commit_id":"0d8276329110a3e00ec366586199ceea1a7e7d96","original_commit_id":"0d8276329110a3e00ec366586199ceea1a7e7d96","user":{"login":"JasperTimm","id":4495499,"avatar_url":"https://avatars.githubusercontent.com/u/4495499?v=3","gravatar_id":"","url":"https://api.github.com/users/JasperTimm","html_url":"https://github.com/JasperTimm","followers_url":"https://api.github.com/users/JasperTimm/followers","following_url":"https://api.github.com/users/JasperTimm/following{/other_user}","gists_url":"https://api.github.com/users/JasperTimm/gists{/gist_id}","starred_url":"https://api.github.com/users/JasperTimm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JasperTimm/subscriptions","organizations_url":"https://api.github.com/users/JasperTimm/orgs","repos_url":"https://api.github.com/users/JasperTimm/repos","events_url":"https://api.github.com/users/JasperTimm/events{/privacy}","received_events_url":"https://api.github.com/users/JasperTimm/received_events","type":"User","site_admin":false},"body":"Huh? Is the key generator being used here at all or are we simply logging it?","created_at":"2016-09-15T15:00:50Z","updated_at":"2016-09-15T15:14:02Z","html_url":"https://github.com/eHealthAfrica/dhis2-android-datacapture/pull/7#discussion_r78984861","pull_request_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/comments/78984861"},"html":{"href":"https://github.com/eHealthAfrica/dhis2-android-datacapture/pull/7#discussion_r78984861"},"pull_request":{"href":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/7","id":84280832,"html_url":"https://github.com/eHealthAfrica/dhis2-android-datacapture/pull/7","diff_url":"https://github.com/eHealthAfrica/dhis2-android-datacapture/pull/7.diff","patch_url":"https://github.com/eHealthAfrica/dhis2-android-datacapture/pull/7.patch","issue_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/issues/7","number":7,"state":"open","locked":false,"title":"Feature/george/key generator2","user":{"login":"zewolfe","id":16115642,"avatar_url":"https://avatars.githubusercontent.com/u/16115642?v=3","gravatar_id":"","url":"https://api.github.com/users/zewolfe","html_url":"https://github.com/zewolfe","followers_url":"https://api.github.com/users/zewolfe/followers","following_url":"https://api.github.com/users/zewolfe/following{/other_user}","gists_url":"https://api.github.com/users/zewolfe/gists{/gist_id}","starred_url":"https://api.github.com/users/zewolfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zewolfe/subscriptions","organizations_url":"https://api.github.com/users/zewolfe/orgs","repos_url":"https://api.github.com/users/zewolfe/repos","events_url":"https://api.github.com/users/zewolfe/events{/privacy}","received_events_url":"https://api.github.com/users/zewolfe/received_events","type":"User","site_admin":false},"body":"Key generator for DHIS 2 SMS command.","created_at":"2016-09-07T11:12:20Z","updated_at":"2016-09-15T15:14:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"acb5d60e5db877eaa76cb81365ae507fc6e2585c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/7/commits","review_comments_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/7/comments","review_comment_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/issues/7/comments","statuses_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/statuses/0d8276329110a3e00ec366586199ceea1a7e7d96","head":{"label":"eHealthAfrica:feature/george/keyGenerator2","ref":"feature/george/keyGenerator2","sha":"0d8276329110a3e00ec366586199ceea1a7e7d96","user":{"login":"eHealthAfrica","id":3214042,"avatar_url":"https://avatars.githubusercontent.com/u/3214042?v=3","gravatar_id":"","url":"https://api.github.com/users/eHealthAfrica","html_url":"https://github.com/eHealthAfrica","followers_url":"https://api.github.com/users/eHealthAfrica/followers","following_url":"https://api.github.com/users/eHealthAfrica/following{/other_user}","gists_url":"https://api.github.com/users/eHealthAfrica/gists{/gist_id}","starred_url":"https://api.github.com/users/eHealthAfrica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eHealthAfrica/subscriptions","organizations_url":"https://api.github.com/users/eHealthAfrica/orgs","repos_url":"https://api.github.com/users/eHealthAfrica/repos","events_url":"https://api.github.com/users/eHealthAfrica/events{/privacy}","received_events_url":"https://api.github.com/users/eHealthAfrica/received_events","type":"Organization","site_admin":false},"repo":{"id":65467004,"name":"dhis2-android-datacapture","full_name":"eHealthAfrica/dhis2-android-datacapture","owner":{"login":"eHealthAfrica","id":3214042,"avatar_url":"https://avatars.githubusercontent.com/u/3214042?v=3","gravatar_id":"","url":"https://api.github.com/users/eHealthAfrica","html_url":"https://github.com/eHealthAfrica","followers_url":"https://api.github.com/users/eHealthAfrica/followers","following_url":"https://api.github.com/users/eHealthAfrica/following{/other_user}","gists_url":"https://api.github.com/users/eHealthAfrica/gists{/gist_id}","starred_url":"https://api.github.com/users/eHealthAfrica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eHealthAfrica/subscriptions","organizations_url":"https://api.github.com/users/eHealthAfrica/orgs","repos_url":"https://api.github.com/users/eHealthAfrica/repos","events_url":"https://api.github.com/users/eHealthAfrica/events{/privacy}","received_events_url":"https://api.github.com/users/eHealthAfrica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eHealthAfrica/dhis2-android-datacapture","description":"Data capture for DHIS 2","fork":true,"url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture","forks_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/forks","keys_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/teams","hooks_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/hooks","issue_events_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/issues/events{/number}","events_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/events","assignees_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/assignees{/user}","branches_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/branches{/branch}","tags_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/tags","blobs_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/git/refs{/sha}","trees_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/statuses/{sha}","languages_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/languages","stargazers_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/stargazers","contributors_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/contributors","subscribers_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/subscribers","subscription_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/subscription","commits_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/commits{/sha}","git_commits_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/git/commits{/sha}","comments_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/comments{/number}","issue_comment_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/issues/comments{/number}","contents_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/contents/{+path}","compare_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/merges","archive_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/downloads","issues_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/issues{/number}","pulls_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls{/number}","milestones_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/milestones{/number}","notifications_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/labels{/name}","releases_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/releases{/id}","deployments_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/deployments","created_at":"2016-08-11T12:19:15Z","updated_at":"2016-08-11T12:19:17Z","pushed_at":"2016-09-09T09:44:56Z","git_url":"git://github.com/eHealthAfrica/dhis2-android-datacapture.git","ssh_url":"git@github.com:eHealthAfrica/dhis2-android-datacapture.git","clone_url":"https://github.com/eHealthAfrica/dhis2-android-datacapture.git","svn_url":"https://github.com/eHealthAfrica/dhis2-android-datacapture","homepage":"","size":2129,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"eHealthAfrica:develop","ref":"develop","sha":"362a40b2b91dc857d3444ba5ccdf5a810a97c098","user":{"login":"eHealthAfrica","id":3214042,"avatar_url":"https://avatars.githubusercontent.com/u/3214042?v=3","gravatar_id":"","url":"https://api.github.com/users/eHealthAfrica","html_url":"https://github.com/eHealthAfrica","followers_url":"https://api.github.com/users/eHealthAfrica/followers","following_url":"https://api.github.com/users/eHealthAfrica/following{/other_user}","gists_url":"https://api.github.com/users/eHealthAfrica/gists{/gist_id}","starred_url":"https://api.github.com/users/eHealthAfrica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eHealthAfrica/subscriptions","organizations_url":"https://api.github.com/users/eHealthAfrica/orgs","repos_url":"https://api.github.com/users/eHealthAfrica/repos","events_url":"https://api.github.com/users/eHealthAfrica/events{/privacy}","received_events_url":"https://api.github.com/users/eHealthAfrica/received_events","type":"Organization","site_admin":false},"repo":{"id":65467004,"name":"dhis2-android-datacapture","full_name":"eHealthAfrica/dhis2-android-datacapture","owner":{"login":"eHealthAfrica","id":3214042,"avatar_url":"https://avatars.githubusercontent.com/u/3214042?v=3","gravatar_id":"","url":"https://api.github.com/users/eHealthAfrica","html_url":"https://github.com/eHealthAfrica","followers_url":"https://api.github.com/users/eHealthAfrica/followers","following_url":"https://api.github.com/users/eHealthAfrica/following{/other_user}","gists_url":"https://api.github.com/users/eHealthAfrica/gists{/gist_id}","starred_url":"https://api.github.com/users/eHealthAfrica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eHealthAfrica/subscriptions","organizations_url":"https://api.github.com/users/eHealthAfrica/orgs","repos_url":"https://api.github.com/users/eHealthAfrica/repos","events_url":"https://api.github.com/users/eHealthAfrica/events{/privacy}","received_events_url":"https://api.github.com/users/eHealthAfrica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eHealthAfrica/dhis2-android-datacapture","description":"Data capture for DHIS 2","fork":true,"url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture","forks_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/forks","keys_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/teams","hooks_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/hooks","issue_events_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/issues/events{/number}","events_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/events","assignees_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/assignees{/user}","branches_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/branches{/branch}","tags_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/tags","blobs_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/git/refs{/sha}","trees_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/statuses/{sha}","languages_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/languages","stargazers_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/stargazers","contributors_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/contributors","subscribers_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/subscribers","subscription_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/subscription","commits_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/commits{/sha}","git_commits_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/git/commits{/sha}","comments_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/comments{/number}","issue_comment_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/issues/comments{/number}","contents_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/contents/{+path}","compare_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/merges","archive_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/downloads","issues_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/issues{/number}","pulls_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls{/number}","milestones_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/milestones{/number}","notifications_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/labels{/name}","releases_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/releases{/id}","deployments_url":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/deployments","created_at":"2016-08-11T12:19:15Z","updated_at":"2016-08-11T12:19:17Z","pushed_at":"2016-09-09T09:44:56Z","git_url":"git://github.com/eHealthAfrica/dhis2-android-datacapture.git","ssh_url":"git@github.com:eHealthAfrica/dhis2-android-datacapture.git","clone_url":"https://github.com/eHealthAfrica/dhis2-android-datacapture.git","svn_url":"https://github.com/eHealthAfrica/dhis2-android-datacapture","homepage":"","size":2129,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/7"},"html":{"href":"https://github.com/eHealthAfrica/dhis2-android-datacapture/pull/7"},"issue":{"href":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/issues/7"},"comments":{"href":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/eHealthAfrica/dhis2-android-datacapture/statuses/0d8276329110a3e00ec366586199ceea1a7e7d96"}}}}
{"actor":{"display_login":"JasperTimm"}}