{"action":"created","comment":{"url":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/comments/157402469","pull_request_review_id":84036860,"id":157402469,"diff_hunk":"@@ -0,0 +1,297 @@\n+package com.fstyle.androidtrainning.data.local.storage;\n+\n+import android.content.ContentResolver;\n+import android.content.Context;\n+import android.database.Cursor;\n+import android.graphics.Bitmap;\n+import android.graphics.BitmapFactory;\n+import android.net.Uri;\n+import android.provider.MediaStore;\n+import android.widget.Toast;\n+\n+import com.fstyle.androidtrainning.R;\n+import com.fstyle.androidtrainning.model.Album;\n+import com.fstyle.androidtrainning.model.Artist;\n+import com.fstyle.androidtrainning.model.Track;\n+\n+import java.util.ArrayList;\n+\n+\n+/**\n+ * Created by Administrator on 12/16/17.\n+ */\n+\n+public class External {\n+\n+    private static final String TAG = \"External\";\n+    private ArrayList<Track> arrayListTrack = new ArrayList<>();\n+    private ArrayList<Album> arrayListAlbum = new ArrayList<>();\n+    private ArrayList<Artist> arrayListArtist = new ArrayList<>();\n+    private ArrayList<String> audioFilePathList = new ArrayList<>();\n+    private Uri[] uri;\n+    private int countTrack;\n+    private int countAlbum;\n+    private int countArtist;\n+    private static final String NO_TRACK = \"No Track To Add\";\n+    private static final String SORT_ASC = \" ASC\";\n+    private static final String LIKE = \" LIKE ?\";\n+\n+    public static String getTAG() {\n+        return TAG;\n+    }\n+\n+    public ArrayList<Track> getArrayListTrack() {\n+        return arrayListTrack;\n+    }\n+\n+    public void setArrayListTrack(ArrayList<Track> arrayListTrack) {\n+        this.arrayListTrack = arrayListTrack;\n+    }\n+\n+    public ArrayList<Album> getArrayListAlbum() {\n+        return arrayListAlbum;\n+    }\n+\n+    public void setArrayListAlbum(ArrayList<Album> arrayListAlbum) {\n+        this.arrayListAlbum = arrayListAlbum;\n+    }\n+\n+    public ArrayList<Artist> getArrayListArtist() {\n+        return arrayListArtist;\n+    }\n+\n+    public void setArrayListArtist(ArrayList<Artist> arrayListArtist) {\n+        this.arrayListArtist = arrayListArtist;\n+    }\n+\n+    public ArrayList<String> getAudioFilePathList() {\n+        return audioFilePathList;\n+    }\n+\n+    public void setAudioFilePathList(ArrayList<String> audioFilePathList) {\n+        this.audioFilePathList = audioFilePathList;\n+    }\n+\n+    public Uri[] getUri() {\n+        return uri;\n+    }\n+\n+    public void setUri(Uri[] uri) {\n+        this.uri = uri;\n+    }\n+\n+    public int getCountTrack() {\n+        return countTrack;\n+    }\n+\n+    public void setCountTrack(int countTrack) {\n+        this.countTrack = countTrack;\n+    }\n+\n+    public int getCountAlbum() {\n+        return countAlbum;\n+    }\n+\n+    public void setCountAlbum(int countAlbum) {\n+        this.countAlbum = countAlbum;\n+    }\n+\n+    public int getCountArtist() {\n+        return countArtist;\n+    }\n+\n+    public void setCountArtist(int countArtist) {\n+        this.countArtist = countArtist;\n+    }\n+\n+    public void scanAllMusic(Context context) {\n+        ContentResolver contentResolver = context.getContentResolver();\n+        String[] projection = {\n+                MediaStore.Audio.Media.TITLE,\n+                MediaStore.Audio.Media.ALBUM,\n+                MediaStore.Audio.Media.ALBUM_ID,\n+                MediaStore.Audio.Media.ARTIST,\n+                MediaStore.Audio.Media.DURATION,\n+                MediaStore.Audio.Media.DATA};\n+        String sortOrder = MediaStore.Audio.Media.TITLE + SORT_ASC;\n+        Cursor cursor = contentResolver.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,\n+                projection, MediaStore.Audio.Media.IS_MUSIC + \"=1\",\n+                null, sortOrder);\n+        if (cursor == null) {\n+            return;\n+        }\n+        if (cursor.moveToFirst()) {\n+            int title = cursor.getColumnIndex(MediaStore.Audio.Media.TITLE);\n+            int artist = cursor.getColumnIndex(MediaStore.Audio.Media.ARTIST);\n+            int position = 0;\n+            countTrack = cursor.getCount();\n+            do {\n+                Track track = new Track();\n+                String path = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.DATA));\n+                String subArtist = cursor.getString(artist);\n+                String trackData = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.DATA));","path":"app/src/main/java/com/fstyle/androidtrainning/data/local/storage/External.java","position":132,"original_position":132,"commit_id":"83b74a04a5d51ef49901deb441f9356f995c6b32","original_commit_id":"83b74a04a5d51ef49901deb441f9356f995c6b32","user":{"login":"daolq3012","id":20784172,"avatar_url":"https://avatars0.githubusercontent.com/u/20784172?v=4","gravatar_id":"","url":"https://api.github.com/users/daolq3012","html_url":"https://github.com/daolq3012","followers_url":"https://api.github.com/users/daolq3012/followers","following_url":"https://api.github.com/users/daolq3012/following{/other_user}","gists_url":"https://api.github.com/users/daolq3012/gists{/gist_id}","starred_url":"https://api.github.com/users/daolq3012/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daolq3012/subscriptions","organizations_url":"https://api.github.com/users/daolq3012/orgs","repos_url":"https://api.github.com/users/daolq3012/repos","events_url":"https://api.github.com/users/daolq3012/events{/privacy}","received_events_url":"https://api.github.com/users/daolq3012/received_events","type":"User","site_admin":false},"body":"ERROR: Line is longer than 100 characters (found 104).","created_at":"2017-12-18T05:15:28Z","updated_at":"2017-12-18T05:15:28Z","html_url":"https://github.com/daolq3012/AndroidTrainning/pull/46#discussion_r157402469","pull_request_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/46","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/comments/157402469"},"html":{"href":"https://github.com/daolq3012/AndroidTrainning/pull/46#discussion_r157402469"},"pull_request":{"href":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/46","id":158776454,"html_url":"https://github.com/daolq3012/AndroidTrainning/pull/46","diff_url":"https://github.com/daolq3012/AndroidTrainning/pull/46.diff","patch_url":"https://github.com/daolq3012/AndroidTrainning/pull/46.patch","issue_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/issues/46","number":46,"state":"open","locked":false,"title":"get data offline","user":{"login":"NguyenNam34","id":32839215,"avatar_url":"https://avatars3.githubusercontent.com/u/32839215?v=4","gravatar_id":"","url":"https://api.github.com/users/NguyenNam34","html_url":"https://github.com/NguyenNam34","followers_url":"https://api.github.com/users/NguyenNam34/followers","following_url":"https://api.github.com/users/NguyenNam34/following{/other_user}","gists_url":"https://api.github.com/users/NguyenNam34/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenNam34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenNam34/subscriptions","organizations_url":"https://api.github.com/users/NguyenNam34/orgs","repos_url":"https://api.github.com/users/NguyenNam34/repos","events_url":"https://api.github.com/users/NguyenNam34/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenNam34/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-12-17T08:33:16Z","updated_at":"2017-12-18T05:15:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4995793729e0d32a0e67f3e38acdc901558f965","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/46/commits","review_comments_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/46/comments","review_comment_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/comments{/number}","comments_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/issues/46/comments","statuses_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/statuses/83b74a04a5d51ef49901deb441f9356f995c6b32","head":{"label":"NguyenNam34:nam_getdata_offline","ref":"nam_getdata_offline","sha":"83b74a04a5d51ef49901deb441f9356f995c6b32","user":{"login":"NguyenNam34","id":32839215,"avatar_url":"https://avatars3.githubusercontent.com/u/32839215?v=4","gravatar_id":"","url":"https://api.github.com/users/NguyenNam34","html_url":"https://github.com/NguyenNam34","followers_url":"https://api.github.com/users/NguyenNam34/followers","following_url":"https://api.github.com/users/NguyenNam34/following{/other_user}","gists_url":"https://api.github.com/users/NguyenNam34/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenNam34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenNam34/subscriptions","organizations_url":"https://api.github.com/users/NguyenNam34/orgs","repos_url":"https://api.github.com/users/NguyenNam34/repos","events_url":"https://api.github.com/users/NguyenNam34/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenNam34/received_events","type":"User","site_admin":false},"repo":{"id":112200456,"name":"AndroidTrainning","full_name":"NguyenNam34/AndroidTrainning","owner":{"login":"NguyenNam34","id":32839215,"avatar_url":"https://avatars3.githubusercontent.com/u/32839215?v=4","gravatar_id":"","url":"https://api.github.com/users/NguyenNam34","html_url":"https://github.com/NguyenNam34","followers_url":"https://api.github.com/users/NguyenNam34/followers","following_url":"https://api.github.com/users/NguyenNam34/following{/other_user}","gists_url":"https://api.github.com/users/NguyenNam34/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenNam34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenNam34/subscriptions","organizations_url":"https://api.github.com/users/NguyenNam34/orgs","repos_url":"https://api.github.com/users/NguyenNam34/repos","events_url":"https://api.github.com/users/NguyenNam34/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenNam34/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NguyenNam34/AndroidTrainning","description":null,"fork":true,"url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning","forks_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/forks","keys_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/teams","hooks_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/hooks","issue_events_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/issues/events{/number}","events_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/events","assignees_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/assignees{/user}","branches_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/branches{/branch}","tags_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/tags","blobs_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/git/refs{/sha}","trees_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/statuses/{sha}","languages_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/languages","stargazers_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/stargazers","contributors_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/contributors","subscribers_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/subscribers","subscription_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/subscription","commits_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/commits{/sha}","git_commits_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/git/commits{/sha}","comments_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/comments{/number}","issue_comment_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/issues/comments{/number}","contents_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/contents/{+path}","compare_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/merges","archive_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/downloads","issues_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/issues{/number}","pulls_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/pulls{/number}","milestones_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/milestones{/number}","notifications_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/labels{/name}","releases_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/releases{/id}","deployments_url":"https://api.github.com/repos/NguyenNam34/AndroidTrainning/deployments","created_at":"2017-11-27T13:36:00Z","updated_at":"2017-11-27T13:36:02Z","pushed_at":"2017-12-18T05:03:59Z","git_url":"git://github.com/NguyenNam34/AndroidTrainning.git","ssh_url":"git@github.com:NguyenNam34/AndroidTrainning.git","clone_url":"https://github.com/NguyenNam34/AndroidTrainning.git","svn_url":"https://github.com/NguyenNam34/AndroidTrainning","homepage":null,"size":488,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"daolq3012:team_pcm_phongchuongnam","ref":"team_pcm_phongchuongnam","sha":"2372956b6f95b6abb937de94b397bd6654ea3539","user":{"login":"daolq3012","id":20784172,"avatar_url":"https://avatars0.githubusercontent.com/u/20784172?v=4","gravatar_id":"","url":"https://api.github.com/users/daolq3012","html_url":"https://github.com/daolq3012","followers_url":"https://api.github.com/users/daolq3012/followers","following_url":"https://api.github.com/users/daolq3012/following{/other_user}","gists_url":"https://api.github.com/users/daolq3012/gists{/gist_id}","starred_url":"https://api.github.com/users/daolq3012/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daolq3012/subscriptions","organizations_url":"https://api.github.com/users/daolq3012/orgs","repos_url":"https://api.github.com/users/daolq3012/repos","events_url":"https://api.github.com/users/daolq3012/events{/privacy}","received_events_url":"https://api.github.com/users/daolq3012/received_events","type":"User","site_admin":false},"repo":{"id":88811750,"name":"AndroidTrainning","full_name":"daolq3012/AndroidTrainning","owner":{"login":"daolq3012","id":20784172,"avatar_url":"https://avatars0.githubusercontent.com/u/20784172?v=4","gravatar_id":"","url":"https://api.github.com/users/daolq3012","html_url":"https://github.com/daolq3012","followers_url":"https://api.github.com/users/daolq3012/followers","following_url":"https://api.github.com/users/daolq3012/following{/other_user}","gists_url":"https://api.github.com/users/daolq3012/gists{/gist_id}","starred_url":"https://api.github.com/users/daolq3012/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daolq3012/subscriptions","organizations_url":"https://api.github.com/users/daolq3012/orgs","repos_url":"https://api.github.com/users/daolq3012/repos","events_url":"https://api.github.com/users/daolq3012/events{/privacy}","received_events_url":"https://api.github.com/users/daolq3012/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daolq3012/AndroidTrainning","description":null,"fork":false,"url":"https://api.github.com/repos/daolq3012/AndroidTrainning","forks_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/forks","keys_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/teams","hooks_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/hooks","issue_events_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/issues/events{/number}","events_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/events","assignees_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/assignees{/user}","branches_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/branches{/branch}","tags_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/tags","blobs_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/git/refs{/sha}","trees_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/statuses/{sha}","languages_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/languages","stargazers_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/stargazers","contributors_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/contributors","subscribers_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/subscribers","subscription_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/subscription","commits_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/commits{/sha}","git_commits_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/git/commits{/sha}","comments_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/comments{/number}","issue_comment_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/issues/comments{/number}","contents_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/contents/{+path}","compare_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/merges","archive_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/downloads","issues_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/issues{/number}","pulls_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls{/number}","milestones_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/milestones{/number}","notifications_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/labels{/name}","releases_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/releases{/id}","deployments_url":"https://api.github.com/repos/daolq3012/AndroidTrainning/deployments","created_at":"2017-04-20T02:27:19Z","updated_at":"2017-11-21T03:47:34Z","pushed_at":"2017-12-18T05:04:01Z","git_url":"git://github.com/daolq3012/AndroidTrainning.git","ssh_url":"git@github.com:daolq3012/AndroidTrainning.git","clone_url":"https://github.com/daolq3012/AndroidTrainning.git","svn_url":"https://github.com/daolq3012/AndroidTrainning","homepage":null,"size":676,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":7,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/46"},"html":{"href":"https://github.com/daolq3012/AndroidTrainning/pull/46"},"issue":{"href":"https://api.github.com/repos/daolq3012/AndroidTrainning/issues/46"},"comments":{"href":"https://api.github.com/repos/daolq3012/AndroidTrainning/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/daolq3012/AndroidTrainning/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/daolq3012/AndroidTrainning/statuses/83b74a04a5d51ef49901deb441f9356f995c6b32"}},"author_association":"NONE"}}
{"actor":{"display_login":"daolq3012"}}