<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anggrayudi Hardiannicko on Medium]]></title>
        <description><![CDATA[Stories by Anggrayudi Hardiannicko on Medium]]></description>
        <link>https://medium.com/@hardiannicko?source=rss-d4a98ff30fe7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*91rQWBGNcFVz-NfAx1ClHw.jpeg</url>
            <title>Stories by Anggrayudi Hardiannicko on Medium</title>
            <link>https://medium.com/@hardiannicko?source=rss-d4a98ff30fe7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:40:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hardiannicko/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Easy Storage Access Framework in Android with SimpleStorage]]></title>
            <link>https://hardiannicko.medium.com/easy-storage-access-framework-in-android-with-simplestorage-ec0a566f472c?source=rss-d4a98ff30fe7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec0a566f472c</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[storage-access-framework]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Anggrayudi Hardiannicko]]></dc:creator>
            <pubDate>Wed, 30 Sep 2020 08:20:47 GMT</pubDate>
            <atom:updated>2021-02-18T14:25:20.674Z</atom:updated>
            <content:encoded><![CDATA[<h4>SimpleStorage simplifies Android Storage Access Framework (SAF) for file management across API levels.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oezMfLAnCeBXKY--Dfiyfw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@redaquamedia">Denny Müller</a> via <a href="https://unsplash.com/photos/1qL31aacAPA">Unsplash</a></figcaption></figure><p><a href="https://developer.android.com/training/data-storage/shared/documents-files">Storage Access Framework</a> (SAF) is an Android framework to secure user’s files and help developers in managing files. However, different API levels require different approaches to manage and access files. Higher API level means more restrictions given to developers. It will end up in headache because as a developer, you want to make your apps available across API levels.</p><h3>Background</h3><p>Managing files while maintaining compatibility is difficult. Let’s take API 21 as an example. You will need SAF to write files on SD card. Even though the user has granted READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE in runtime, your app still unable to do it. It is because you have no URI permissions for read and write access to the storage.</p><p>Each API level has different ways to grant these read/write URI permissions. To grant them for SD card in API 21, you need to open SAF and let the user selects any folder from SD card and then persist these permissions with ContentResolver.takePersistableUriPermission().</p><p>Unfortunately, on Nougat devices, you have to force the user to select the root path of the SD card. If not, when trying to access files from SD card you will receive SecurityException, which will lead to app crash.</p><p>After the user granted read and write URI permissions, you have to use DocumentFile to access files from SD card. DocumentFile is a Google’s library to help you accessing files managed by SAF. You can <a href="https://mvnrepository.com/artifact/androidx.documentfile/documentfile">download it here</a>.</p><p>Suppose that I have a SD card on my device with an identifier 14EC-BF55. Reading a file located in 14EC-BF55:Movies/Horror/The_Conjuring.mp4 with this code is impossible:</p><pre>DocumentFile.fromTreeUri(Uri.parse(&quot;content://com.android.externalstorage.documents/tree/14EC-BF55%3AMovies%2FHorror%2FThe_Conjuring.mp4&quot;));</pre><p>What you can do is reading it like this:</p><pre>DocumentFile rootFolder = DocumentFile.fromTreeUri(Uri.parse(&quot;content://com.android.externalstorage.documents/tree/14EC-BF55%3A&quot;));</pre><pre>DocumentFile file = rootFolder.findFile(&quot;Movies&quot;).findFile(&quot;Horror&quot;).findFile(&quot;The_Conjuring.mp4&quot;);</pre><p>Yup, you have to read the root path first, then call findFile() as many as file trees you have. But in API 30, this logic would work without requiring root URI:</p><pre>DocumentFile file = DocumentFile.fromTreeUri(Uri.parse(&quot;content://com.android.externalstorage.documents/tree/14EC-BF55%3AMovies%2FHorror/document/14EC-BF55%3AMovies%2FHorror%2FThe_Conjuring.mp4&quot;));</pre><h4>The Death of External Storage</h4><p>As explained by CommonsWare <a href="https://commonsware.com/blog/2019/06/07/death-external-storage-end-saga.html">here</a>, java.io.File is no longer useful to access files in external storage, thus Environment.getExternalStorageDirectory() is deprecated now. You are no longer able to read or write files in API 29 via java.io.File, except for path getExternalFilesDir().</p><p>In API 30, you can use java.io.File again, but with MANAGE_EXTERNAL_STORAGE permission. This permission is similar to Full Disk Access permission on Mac.</p><p>There are many restrictions created by SAF that I have not covered in this article yet. But relax, because you don’t have to learn all of that restrictions since <a href="https://github.com/anggrayudi/SimpleStorage">SimpleStorage</a> will come to help you.</p><h3>SimpleStorage</h3><p>Just like its name, this library simplifies Android Storage Access Framework for file management across API levels. I can access The_Conjuring.mp4 like this now:</p><pre>DocumentFile file = DocumentFileCompat.fromSimplePath(context, &quot;14EC-BF55&quot;, &quot;Movies/Horror/The_Conjuring.mp4&quot;);</pre><p>Notice that 14EC-BF55 is an identifier of the SD card like I have explained previously. For external storage, you can use primary. Simple, isn’t it?</p><p>Requesting read and write URI permissions is pretty easy as well:</p><pre>SimpleStorage storage = new SimpleStorage(this);<br>storage.setStorageAccessCallback(...);<br>storage.requestStorageAccess(REQUEST_CODE_STORAGE_ACCESS);</pre><p>You can pick folder and files as well by calling storage.openFolderPicker() and storage.openFilePicker().</p><p><a href="https://github.com/anggrayudi/SimpleStorage">SimpleStorage</a> also contains Kotlin extension functions to help you to rename, copy, move, mkdirs and search files.</p><p>To manage media files stored in MediaStore database, you can use MediaStoreCompat and it will return MediaFile object. In SimpleStorage, DocumentFile is used to access files when your app has been granted to read and write URI permissions. Whereas MediaFile is used to access media files from MediaStore without any URI permissions to the storage.</p><p>MediaFile has similar capability to DocumentFile, such as:</p><ul><li>MediaFile.realPath</li><li>MediaFile.isPending</li><li>MediaFile.delete()</li><li>MediaFile.renameTo()</li><li>MediaFile.copyTo()</li><li>MediaFile.moveTo()</li><li>MediaFile.openInputStream()</li><li>MediaFile.openOutputStream(), etc.</li></ul><p>SimpleStorage also provides you some utility classes, i.e.DocumentFileCompat and MediaStoreCompat.</p><h4>DocumentFileCompat</h4><p>This utility class helps you to access DocumentFile and java.io.File:</p><ul><li>DocumentFileCompat.fromSimplePath()</li><li>DocumentFileCompat.fromFullPath()</li><li>DocumentFileCompat.fromFile()</li><li>DocumentFileCompat.fromPublicFolder()</li></ul><h4>MediaStoreCompat</h4><p>Whereas this class helps you to access MediaFile:</p><ul><li>MediaStoreCompat.fromMediaId()</li><li>MediaStoreCompat.fromFileName()</li><li>MediaStoreCompat.fromRelativePath()</li><li>MediaStoreCompat.fromFileNameContains()</li><li>MediaStoreCompat.fromMimeType()</li><li>MediaStoreCompat.fromMediaType()</li></ul><h3>Final Words</h3><p>Although Storage Access Framework (SAF) is expected to protect user’s files, but this framework is not consistent because each API level has its own restrictions in accessing files. As a developer, this is really painful because you have to maintain compatibility on all OS versions. But now, accessing and managing files are much easier with <a href="https://github.com/anggrayudi/SimpleStorage">SimpleStorage</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec0a566f472c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rewriting History with Git Rebase Interactive]]></title>
            <link>https://medium.com/dana-engineering/rewriting-history-with-git-rebase-interactive-adf0341afa93?source=rss-d4a98ff30fe7------2</link>
            <guid isPermaLink="false">https://medium.com/p/adf0341afa93</guid>
            <category><![CDATA[git-rebase]]></category>
            <category><![CDATA[version-control-system]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[dana]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Anggrayudi Hardiannicko]]></dc:creator>
            <pubDate>Mon, 01 Jun 2020 02:52:24 GMT</pubDate>
            <atom:updated>2020-06-01T11:18:58.405Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1AHxmgC_iWEgsdcTJ6Ux8g.jpeg" /></figure><p><a href="https://git-scm.com/">Git</a> is a powerful tool when you work with lots of people contributed in a project. However, Git has “hidden” features that you might not know for undoing changes. You may have seen some of these comments on your Pull Requests (PRs):</p><blockquote><strong><em>Issue #1</em></strong><em>: “Please rename this commit message.”</em></blockquote><blockquote><strong><em>Issue #2</em></strong><em>: “Please join these commits to be more relevant.”</em></blockquote><blockquote><strong><em>Issue #3</em></strong><em>: “Why does this PR contain someone else’s commits?”</em></blockquote><blockquote><strong><em>Issue #4</em></strong><em>: “Please remove this secret information. Keystore file should be ignored in Git.”</em></blockquote><blockquote><strong><em>Issue #5</em></strong><em>: “Please separate this into some meaningful commits.”</em></blockquote><p>The question is, how do you solve those problems? Are you often creating a backup branch and fix the issues with git cherry-pick and end in a hassle?</p><p>Here it comes, <strong>Git Rebase Interactive</strong>!</p><h3>Introduction</h3><p>There are 6 basic commands in Git Rebase Interactive:</p><ul><li>pick (p for short) → pick the commit. Basically, it does nothing to the commit.</li><li>reword (r for short) → edit the commit message.</li><li>squash (s for short) → join some commits into one previous commit.</li><li>fixup (f for short) → like squash, but discard this commit&#39;s log message.</li><li>drop (d for short) → delete commit.</li><li>edit (e for short) → make file changes to the commit.</li></ul><p>To start Git Rebase Interactive, run this command:</p><pre>git rebase -i HEAD~n</pre><p>Where:</p><ul><li>-i (stands for —-interactive) → begins interactive rebasing.</li><li>HEAD~n → select n commits behind HEAD (your current active-pointer in Git).</li></ul><p>We will cover these commands on next section so you could understand the usage.</p><p>Or if you use VCS in IntelliJ IDEA, it gets easier. Just right-click from the commit you want to start interactive rebase and select <strong>Interactively Rebase from Here…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cEtCbm50uCHQ4X56w4VueA.png" /></figure><p><strong>⚠️Warning: </strong>Git Rebase Interactive will rewrite the commit history. So please be careful.</p><p>However, you can run git rebase --help or visit the <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History">official documentation</a> when you get stuck.</p><h3>#1 Change commit message</h3><p><strong>Common use case: </strong><em>“Please rename this commit message.”</em></p><p>When you want to change the commit message, you could use <a href="https://stackoverflow.com/a/179147/3922207">git commit --amend</a>. But this command is only limited to the most recent commit in the branch. This is where reword helps us.</p><p>Suppose that you have 10 commits in your branch. git commit --ammend only allows you to rename the tenth commit message. Whereas reword allows you to rename first, third, sixth commit, even the whole commit messages. In other words, you can use reword to change multiple commit messages.</p><p>Let’s say I have 4 commits in branch feature/wallet. I use git log --oneline to get this pretty Git history.</p><pre>d8d99fe (HEAD -&gt; feature/wallet) Fix Hilmi&#39;s PR<br>3d31aa7 Fix worng URL target API<br>3591180 Add online wallet security action<br>38bb42e Add wallet feature</pre><p>d8d99fe is the latest commit here. I want to fix typo at commit 3d31aa7, changing &quot;worng&quot; to &quot;wrong&quot;. You can do it in terminal or GUI way. In this example, I will use IntelliJ IDEA VCS as the GUI way.</p><h4>The terminal way</h4><p>Run command git rebase -i 3591180. You can achieve the same thing with git rebase -i HEAD~2. Git will show the following text editor on my terminal:</p><pre>pick 3d31aa7 Fix worng URL target API<br>pick d8d99fe Fix Hilmi&#39;s PR comment</pre><pre># Rebase 3591180..d8d99fe onto 3591180 (2 commands)</pre><p>To start editing, press <strong>C</strong> on your keyboard. Edit the first line, change pick to reword (or r for short):</p><pre>reword 3d31aa7 Fix worng URL target API<br>pick d8d99fe Fix Hilmi&#39;s PR comment</pre><pre># Rebase 3591180..d8d99fe onto 3591180 (2 commands)</pre><p>Press <strong>Esc</strong> on your keyboard to <a href="https://stackoverflow.com/a/13239389/3922207">close the editor</a>, write :wq and finally press enter. Git will open the editor again, letting you to edit the commit message.</p><pre>Fix wrong URL target API<br>  <br># Please enter the commit message for your changes. Lines starting<br># with &#39;#&#39; will be ignored, and an empty message aborts the commit.<br>#<br># Date:      Fri May 1 16:39:53 2020 +0700<br>#<br># interactive rebase in progress; onto 3591180<br># Last command done (1 command done):<br>#    reword 3d31aa7 Fix worng URL target API<br># Next command to do (1 remaining command):<br>#    pick d8d99fe Fix Hilmi&#39;s PR comment<br># You are currently editing a commit while rebasing branch &#39;feature/wallet&#39; on &#39;3591180&#39;.</pre><p>Close the editor and save the changes with :wq again. Anyway, :wq stands for write and quit. Here&#39;s the result when the rebase has been successfully executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*mq_7RxR28Q0c55bUC54xHw.png" /></figure><p>Run command git push --force or git push -f to overwrite commits in remote branch.</p><p><strong>⚠️Warning: </strong>Please be careful when using --force. You may need <a href="https://stackoverflow.com/a/53042745/3922207">--force-with-lease</a> instead.</p><h4>The IntelliJ IDEA way</h4><p>VCS plugin in IntelliJ IDEA ease the steps very much. Just right-click on the commit you want to edit and select <strong>Interactively Rebase from Here…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WBM3tfdzk3cNPKzS" /></figure><p>Select reword on the commit and click <strong>Start Rebasing</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*nVkjUm_z8vz7v0z1L2pJ1w.png" /></figure><p>Edit the commit message and click <strong>Resume Rebasing</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*rDftyY0P7ayaSD8v85D17w.png" /></figure><p>You might noticed that the VCS shows duplicate commit like this. Don’t get panic. It is just because you have not push the changes to remote branch yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*T_UIGUU9456ZmtCGIzi0Gg.png" /></figure><h3>#2 Join some commits into one commit</h3><p><strong>Common use case: </strong><em>“Please join these commits to be more relevant.”</em></p><p>Let’s say you have 10 commits and you want to join them into one commit. There are some reasons why you might need to do it, for example badd5de, 912c839, d8d99fe and 3d31aa7 contain similar commit message, thus they can be joined into a commit message Fix PR comments.</p><pre>badd5de (HEAD -&gt; feature/wallet) Fix app crash<br>912c839 Fix PR comment<br>d8d99fe Fix Hilmi&#39;s PR comment<br>3d31aa7 Fix wrong URL target API<br>3591180 Add online wallet security action<br>38bb42e Add wallet feature</pre><p>The expected result will look like this:</p><pre>xxxxxxx Fix PR comments<br>3591180 Add online wallet security action<br>38bb42e Add wallet feature</pre><p>You can achieve this with squash or fixup. squash gives you an option to combine the messages of the original and the squashed commits, whereas the fixup operation will keep the original message and discard the message from the fixed-up commits.</p><h3>squash</h3><h4>The terminal way</h4><p>Run git rebase -i HEAD~4 and set b56416a, 4ff0cb3 and e692c19 to squash (s for short).</p><pre>pick 787c4e9 Fix wrong URL target API<br>s b56416a Fix Hilmi&#39;s PR comment<br>s 4ff0cb3 Fix PR comment<br>s e692c19 Fix app crash</pre><pre># Rebase 3591180..e692c19 onto 3591180 (4 commands)</pre><p>The text editor will prompt, so you can edit the commit message.</p><pre># This is a combination of 4 commits.<br># This is the 1st commit message:</pre><pre>Fix wrong URL target API</pre><pre># This is the commit message #2:</pre><pre>Fix Hilmi&#39;s PR comment</pre><pre># This is the commit message #3:</pre><pre>Fix PR comment</pre><pre># This is the commit message #4:</pre><pre>Fix app crash</pre><pre># Please enter the commit message for your changes. Lines starting<br># with &#39;#&#39; will be ignored, and an empty message aborts the commit.<br>#<br># Date:      Fri May 1 16:39:53 2020 +0700<br>#<br># interactive rebase in progress; onto 3591180<br># Last commands done (4 commands done):<br>#    squash 4ff0cb3 Fix PR comment<br>#    squash e692c19 Fix app crash<br># No commands remaining.<br># You are currently rebasing branch &#39;feature/wallet&#39; on &#39;3591180&#39;.</pre><p>In this case, I want to change the commit message to Fix PR comments:</p><pre>Fix PR comments</pre><pre># Please enter the commit message for your changes. Lines starting<br># with &#39;#&#39; will be ignored, and an empty message aborts the commit.<br>#<br># Date:      Fri May 1 16:39:53 2020 +0700<br>#<br># interactive rebase in progress; onto 3591180<br># Last commands done (4 commands done):<br>#    squash 4ff0cb3 Fix PR comment<br>#    squash e692c19 Fix app crash<br># No commands remaining.<br># You are currently rebasing branch &#39;feature/wallet&#39; on &#39;3591180&#39;.</pre><p>Close the editor. And we have successfully joined them into one commit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*9rBDzfR2RNa2GeTUteYkRg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*_ju-x_M0D1UAXO1yUZHAjw.png" /></figure><p><strong>⚠️Warning: </strong>Whenever you have rebased the branch, make sure to force push it to origin. Otherwise, the remote branch will reject your changes.</p><h4>The IntelliJ IDEA way</h4><p>Since we want to squash from commit message Fix wrong URL target API, just right-click on this commit message and click <strong>Interactively Rebase from Here…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7rByQHb-vLYX5JYvMYLntg.png" /></figure><p>Set action squash to all commits, but let commitFix wrong URL target API to set action pick. This indicates that the commits marked with squash action will be joined into previous commit, i.e. Fix wrong URL target API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*ukLgPmoxzHh1rdOhkDDLGg.png" /></figure><p>Click <strong>Start Rebasing</strong>. A dialog will be prompted where you can edit the squashed commit message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*XwhcF7flbbDkfy0teCrgNw.png" /></figure><p>I want to rename the message with Fix PR comments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*TCnrovePgD7y_4F9bqkHqA.png" /></figure><p>Click <strong>Resume Rebasing</strong>. Our new commits would look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*B6cpWbSthsTLqYUp8Xii8w.png" /></figure><h3>fixup</h3><p>fixup works like squash, but it does not give you an option to edit the commit message in the end.</p><p>Let’s join 224146f, e00912d and 91ce944 into cad29de.</p><pre>224146f (HEAD -&gt; test-fixup) Fix app crash<br>e00912d Fix PR comment<br>91ce944 Fix Hilmi&#39;s PR comment<br>cad29de Fix wrong URL target API<br>2b1838c Add online wallet security action<br>b1189ae Add wallet feature</pre><h4>The terminal way</h4><p>Run git rebase -i HEAD~4. Set 91ce944, e00912d and 224146f to f.</p><pre>pick cad29de Fix wrong URL target API<br>f 91ce944 Fix Hilmi&#39;s PR comment<br>f e00912d Fix PR comment<br>f 224146f Fix app crash</pre><pre># Rebase 2b1838c..224146f onto 2b1838c (4 commands)</pre><p>Close the editor. Our new commits will look like this:</p><pre>3204faa Fix wrong URL target API<br>2b1838c Add online wallet security action<br>b1189ae Add wallet feature</pre><h4>The IntelliJ IDEA way</h4><p>To start fixup, right-click on commit message and select <strong>Interactively Rebase from Here…</strong> like we did above, on squash section.</p><p>When this dialog appears, set action fixup to all commits, but let commitFix wrong URL target API to set action pick. This indicates that the commits marked with fixup action will be joined into previous commit, i.e. Fix wrong URL target API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*M-riQI_liq-FwSE4XfaMVQ.png" /></figure><p>No dialog will be prompted to allow you to change the fixed-up commit message like we did previously in squash, because this operation is fixup, instead of squash.</p><p>Our final commits would look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*6ZgFxJdOwPlIWfcxntSbTg.png" /></figure><h3>#3 Delete commits</h3><p><strong>Common use case: </strong><em>“Why does this PR contain someone else’s commits?”</em></p><p>Suppose that you accidentally pushed a secret file named keystore.jks to the remote branch. This file should be ignored in Git. You cannot use git revert because the file will remain in Git history. Someone can checkout at the commit history where you added keystore.jks and then download it. git revert is not useful as well, because it will overwrite and remove the latest commits. This is where drop became our hero.</p><p>I have 3 commits. I accidentally added file keystore.jks to Git with commit ID 52136d8. I want to remove this commit.</p><pre>3a541c7 (HEAD -&gt; test-delete) Updated README.md<br>52136d8 Add keystore.jks<br>0c38e87 Fix PR comments</pre><h4>The terminal way</h4><p>Run git rebase -i HEAD~2. Set 52136d8 to drop (d for short).</p><pre>d 52136d8 Add keystore.jks<br>pick 3a541c7 Updated README.md</pre><pre># Rebase 0c38e87..3a541c7 onto 0c38e87 (2 commands)</pre><p>Close the editor. Our new commits will look like this:</p><pre>d714abc Updated README.md<br>0c38e87 Fix PR comments</pre><p>Notice that Updated README.md has different commit ID after the rebase is completed. It is because Git Rebase Interactive rewrites the commit history.</p><p><strong>💡Tips:</strong> When you changed the target branch on a PR, e.g. from develop to release/1.15.0, you may noticed that your PR contains someone else&#39;s commits. You need to remove them because these commits belong to branch develop. Use drop to solve this problem.</p><h4>The IntelliJ IDEA way</h4><p>Right-click on commit message Add keystore.jks and start interactive rebase. Here, the VCS mentions drop as skip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*sdMGPdrpAI_fY_yx4Ae11Q.png" /></figure><p>Click <strong>Start Rebasing</strong> and it’s done. Very short, right?</p><h3>#4 Edit commits</h3><p><strong>Common use case: </strong><em>“Please remove this secret information. Keystore file should be ignored in Git.”</em></p><p>What if you accidentally pushed a commit where you put your social media password? Don’t be panic. You can edit that commit. All you need to do is find the commit where the mistake happened.</p><p>I have a file named README.md. Suppose that it contains my social media password. I added the password in commit 910ce55.</p><pre>2d45acc (HEAD -&gt; feature/accident-password) Code cleanup<br>910ce55 Fix app crash<br>4299f42 Add one line of code</pre><p>What I want to do is editing commit 910ce55.</p><h4>The terminal way</h4><p>Run git rebase -i HEAD~2. Set 910ce55 to edit (e for short):</p><pre>e 910ce55 Fix app crash<br>pick 2d45acc Code cleanup</pre><pre># Rebase 4299f42..2d45acc onto 4299f42 (2 commands)</pre><p>Close the editor. Now I have returned to the past where I made that mistake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*-2UA0_pPSFzKPDTwM2iuIA.png" /></figure><p>Run git add . to mark the changes you have made as completed, then run git rebase --continue. The text editor will prompt me an option to change the commit message:</p><pre>Fix app crash<br>  <br># Please enter the commit message for your changes. Lines starting<br># with &#39;#&#39; will be ignored, and an empty message aborts the commit.<br>#<br># Date:      Fri May 1 23:30:36 2020 +0700<br>#<br># interactive rebase in progress; onto 4299f42<br># Last command done (1 command done):<br>#    edit 910ce55 Fix app crash<br># Next command to do (1 remaining command):<br>#    pick 2d45acc Code cleanup<br># You are currently splitting a commit while rebasing branch &#39;feature/accident-password&#39; on &#39;4299f42&#39;.</pre><p>For now I don’t want to change it. So just close the editor.</p><p>You might encounter file conflicts after continued the rebase. Fix the conflict, run git add ., then run git rebase --continue again. Repeat these steps until no conflict found. Here&#39;s the result when we have successfully edited the commit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OZqUkcu1dtimXPT9" /></figure><h4>The IntelliJ IDEA way</h4><p>Right-click on commit message Fix app crash and start interactive rebase. Set the commit you want to edit as edit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*3QyCuNprvE40OaZ-iCgt3w.png" /></figure><p>Click <strong>Start Rebasing</strong>. Whenever you found a conflict, fix it, run git add ., then run git rebase --continue again. Repeat these steps until no conflict found.</p><p>Resolving conflict in IntelliJ IDEA is much easier. You will be prompted a three-pane dialog. This dialog helps you to select which changes you want to accept.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ardu7HkwN1x8oiZ8" /></figure><h3>#5 Split commit</h3><p>Although splitting commits is a rare case, but sometimes, it’s important to split big changes into some commits, so whenever you found a bug on your code, you can checkout at specific commit to compare and test the code. It helps you to find the bug faster.</p><p>Git Rebase Interactive allows you to split commits. As stated in the <a href="https://git-scm.com/docs/git-rebase#_splitting_commits">docs</a>:</p><blockquote>In interactive mode, you can mark commits with the action edit. However, this does not necessarily mean that <strong>git rebase</strong> expects the result of this edit to be exactly one commit. Indeed, you can undo the commit, or you can add other commits.</blockquote><p>Suppose that in a commit I have this changes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*DY82r5xKOyEVz1PUyt28aw.png" /></figure><ul><li>In .gitignore, I added a rule to ignore some files in Git.</li><li>In build.gradle, I updated dependencies version.</li></ul><p>I want to split this commit into two commit messages:</p><ul><li>Ignore Keystore files</li><li>Update Kotlin version</li></ul><p>I will practice it in two ways, via terminal and GUI with IntelliJ IDEA VCS plugin.</p><h4>The terminal way</h4><p>Let’s say that the commit we want to edit is the latest commit in the branch. So we need to run git rebase -i HEAD~.</p><pre>edit 032368f Update dependencies<br> <br># Rebase 62210a2..032368f onto 62210a2 (1 command)</pre><p>Mark commit 032368f as edit, save and close the text editor. Then run git reset HEAD^. On Windows you may need to run git reset HEAD~. It will leave the changes of this commit in the working area:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*QeO1vQ__fI-md4pcsMl74g.png" /></figure><p>Now move the changes in .gitignore into staging area via git add. Then run git commit to create a new commit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*Pt28bwKk9S7-M5Qt9hFE9A.png" /></figure><p>Move build.gradle into staging area as well via git add and create a new commit with message Update Kotlin version. Finally, run git rebase --continue to complete the rebase.</p><p>Our final commits would look like:</p><pre>7f4b520 (HEAD -&gt; test/split) Update Kotlin files<br>471df3e Ignore Keystore files</pre><h4>The IntelliJ IDEA way</h4><p>Right-click on commit we want to split, i.e. Update dependencies, and start interactive rebase. Mark the commit we want to split as edit, then click <strong>Start Rebasing</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*ZL0tT0RT-zUHpWW0qci8nA.png" /></figure><p>Run git reset HEAD^ like the steps we did in <strong>the terminal way</strong> above. On Windows you may need to run git reset HEAD~. It will leave the changes of this commit in the working area:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*2PL7KdXF7nE_cEIXgDuwTA.png" /></figure><p>Type Ctrl + K on Windows or ⌘ + K on Mac to commit the changes via GUI. Check .gitignore and uncheck build.gradle. Type commit message Ignore Keystore files and click <strong>Commit </strong>button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_6EPYSkYF4r8aogptLpFeA.png" /></figure><p>Do the same thing to build.gradle, but keep in mind that our commit message is now Update Kotlin files. Finally, run git rebase --continue to finish the rebase.</p><h3>Final Words</h3><p>Rewriting history is one of the most powerful feature exists in Git. It is what makes Git different compared to other VCS, e.g. <a href="https://www.mercurial-scm.org/">Mercurial</a>. Git allows you to edit previous changes you have committed, while Mercurial makes everything in past become read-only, thus you can’t edit them.</p><p>Git Rebase Interactive works like time machine, allowing you back to the past to fix all your mistakes. It is a useful feature you should try.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adf0341afa93" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dana-engineering/rewriting-history-with-git-rebase-interactive-adf0341afa93">Rewriting History with Git Rebase Interactive</a> was originally published in <a href="https://medium.com/dana-engineering">DANA Product &amp; Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Your Own Android Hidden APIs]]></title>
            <link>https://hardiannicko.medium.com/create-your-own-android-hidden-apis-fa3cca02d345?source=rss-d4a98ff30fe7------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa3cca02d345</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android-framework]]></category>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Anggrayudi Hardiannicko]]></dc:creator>
            <pubDate>Fri, 29 May 2020 11:17:37 GMT</pubDate>
            <atom:updated>2020-05-29T11:54:08.015Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unlocking Android Hidden APIs</h3><h4>Beak limit on your Android apps development with custom android.jar</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2HAqiDUtM87BTdsjDbuTSg.png" /><figcaption>Source: <a href="https://www.freepik.com/free-vector/break-gender-norms-concept_8135288.htm">Freepik.com</a></figcaption></figure><p>Some people asked me, how to access hidden APIs without reflection? What is the easiest way to access those hidden/internal classes, methods and resources? Let’s dig it up!</p><p>The internal APIs are located in package com.android.internal and available in the framework.jar, while the hidden APIs are located in the android.jar file with <em>@hide</em> javadoc attribute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/0*_LZM9H-BOom5JfP1.jpg" /></figure><p>Although the classes &amp; methods are public, but you cannot access them directly. There are pretty methods and resources you can use from this package. I will assume both as one API and I will refer to it as hidden API.</p><p>The advantage is you don’t need to create new classes, constants, methods or resources whenever you want to use the similar function in your project. You can access hidden features from Android SDK as well.</p><p>I already have an open source project that can help you to access the hidden APIs. You can download it here: <a href="https://github.com/anggrayudi/android-hidden-api">Android Hidden APIs on GitHub</a>. This repo provides custom android.jar. You can use it on your app development.</p><p>Sometimes, I am very busy so I don’t have time to handle this repo alone, hence I am open to all people who want to contribute on this project.</p><p>Of course, you can use <a href="https://stackoverflow.com/questions/37628/what-is-reflection-and-why-is-it-useful">Java reflection</a> to access all of those hidden APIs. But this is a painful way. In this article, I will cover how to create your own custom android.jar and use it to access the hidden APIs. So it is no longer a blocker for your project to just wait the latest version of custom android.jar is released on the repo.</p><h3>Preparation</h3><p>You need to prepare these two files: framework.jar and android.jar.</p><h4>android.jar</h4><p>Go to &lt;SDK-dir&gt;/platforms/android-X, where X is the API version. If you want to create custom android.jar for API 29, then go to &lt;SDK-dir&gt;/platforms/android-29. Copy android.jar from this folder into a temporary folder where we will create our custom android.jar.</p><p>Don’t forget to keep the original android.jar because when we accidentally put something wrong, we can go back to the original version. Anyway, you can download the original one from:</p><pre><a href="https://dl.google.com/android/repository/platform-X_rY.zip">https://dl.google.com/android/repository/platform-<strong>X</strong>_r<strong>Y</strong>.zip</a></pre><p>Where <strong>X </strong>is the API level and <strong>Y </strong>is the revision number. For example: <a href="https://dl.google.com/android/repository/platform-29_r04.zip">https://dl.google.com/android/repository/platform-29_r04.zip</a></p><p>Extract the ZIP and you will find the original android.jar.</p><h4>framework.jar</h4><p>framework.jar is located in /system/framework. If you want to create custom android.jar for API 29, then you need to find a physical device or an emulator running Android API 29. Some devices may contain more than one framework.jar.</p><p>Let’s take a look into my device:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*Jc1Z3N5ort_yHcTKP4izZw.png" /></figure><p>Now connect your Android device to your computer. We need to download framework.jar via ADB command:</p><pre>adb pull /system/framework/framework.jar</pre><p>If framework2.jar exists, download it as well.</p><p>If the file size of downloaded framework.jar is only few KBs, then there might be something wrong. You need to find another devices or emulators. BTW, <a href="https://developer.android.com/studio/run/managing-avds">Android Virtual Device</a> is enough. Normally, the file size of a framework.jar should be more than 5MB.</p><h3>Create Custom android.jar</h3><p>Now we have collected all required JARs. Next step is combining framework.jar with original android.jar. Let’s try to create custom android.jar for API 29. Follow the following steps.</p><p>Rename framework.jar to framework.zip and unzip this archive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*6s2DAr1m9D5hUHXfEo7XVw.png" /><figcaption>framework.jar after extracted</figcaption></figure><p>We need to extract *.class files from these DEX files with <a href="https://github.com/DexPatcher/dex2jar/releases/download/v2.1-20171001-lanchon/dex-tools-2.1-20171001-lanchon.zip">Dex Tools</a>. If Dex Tools does not work, you can try <a href="https://github.com/pxb1988/dex2jar">Dex2Jar</a>.</p><p>With Dex Tools, run this command on your terminal:</p><pre>./d2j-dex2jar.sh &lt;enter dex file location here&gt;</pre><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jH5TLAzfVzr5rpEYya2p7A.png" /></figure><p>Open directory dex-tools-2.1-20171001-lanchon and you’ll see a new file named classes-dex2jar.jar. Rename its extension to zip so we can extract it. Once you extracted it, rename directory android to classes so we can distinguish them later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DX6fCIC3ofwRh1-EWj0FMg.png" /><figcaption>Extracted classes-dex2jar.zip</figcaption></figure><p>Repeat the same steps to classes2.dex and classes3.dex.</p><p>Now we have extracted those DEX files:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*E7GvD5nke0_MS0YcNMjeSA.png" /></figure><p>We need to merge these extracted DEX files into android.jar located in &lt;SDK-dir&gt;/platforms/android-29. Copy, rename this file to android.zip and extract it. Let the folder named android.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*f8NIErZh2flWTGU6xWfDUQ.png" /></figure><p>Create a folder named custom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*T5u3jsSzpOXOT_Xzs_4-UQ.png" /></figure><p>Move all files from inside folder android into folder custom. Then open folder classes and move everything inside it into folder custom as well. Repeat the steps for the rest classes folders. Whenever you are asked to replace or merge, please select <strong>merge</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*Mwmzl1aLBWt_i9o9gHPOHA.png" /></figure><p>On Windows you may select <strong>Copy and replace</strong>.</p><p>Open your terminal and <a href="https://www.lifewire.com/uses-of-command-cd-2201063">set the directory</a> to folder custom. We will do the final step, <a href="https://docs.oracle.com/javase/tutorial/deployment/jar/build.html">creating the JAR</a>.</p><p>Run the following command:</p><pre>jar cvf android.jar *</pre><p>Now we have our own custom android.jar:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zv7fIqD5_h8msH854D5XNw.png" /></figure><p>Copy this android.jar into &lt;SDK-dir&gt;/platforms/android-29.</p><p>Finally, we can use it in our project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PPF-Sb0GyyGSb3mOeFNKpg.png" /></figure><p>Wohooo… We did it! 👏</p><h3>Resources Helper</h3><p>If you need a helper to access the hidden resources, e.g. String, Drawable and color, then add this dependency:</p><pre>implementation &#39;com.anggrayudi:android-hidden-api:xx&#39;</pre><p>Check the latest version and its usage <a href="https://github.com/anggrayudi/android-hidden-api#resources-helper--">here</a>.</p><h3>Final Words</h3><p>I don’t know how long this project would survive, because latest version of Android Studio prevents custom android.jar from working. Google also restrict the hidden APIs usage as posted on this page:</p><p><a href="https://developer.android.com/distribute/best-practices/develop/restrictions-non-sdk-interfaces">Restrictions on non-SDK interfaces | Google Play | Android Developers</a></p><p>But I am not thinking to give up now. Let’s find another workaround to make it work! Do not hesitate to <a href="https://github.com/anggrayudi/android-hidden-api/pulls">create pull requests</a> if you intended to contribute on this project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa3cca02d345" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Memanfaatkan Hosting Gratis dari Firebase dengan Domain Niagahoster]]></title>
            <link>https://hardiannicko.medium.com/memanfaatkan-hosting-gratis-dari-firebase-dengan-domain-niagahoster-d33bceac0498?source=rss-d4a98ff30fe7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d33bceac0498</guid>
            <category><![CDATA[domain-name-system]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[web-hosting]]></category>
            <dc:creator><![CDATA[Anggrayudi Hardiannicko]]></dc:creator>
            <pubDate>Fri, 31 Jan 2020 17:09:42 GMT</pubDate>
            <atom:updated>2021-08-11T13:48:30.882Z</atom:updated>
            <content:encoded><![CDATA[<h4>Sekarang kamu bisa menghubungkan custom domain dari Niagahoster ke hosting gratis dari Firebase.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMeNbOn0h1IaoyG5IKO-wQ.jpeg" /></figure><p><a href="https://firebase.google.com/"><strong>Firebase</strong></a><strong> </strong>merupakan layanan <em>cloud </em>yang disediakan oleh Google. Ada banyak layanan Firebase yang sangat menguntungkan dengan harga murah meriah. Salah satunya adalah Firebase Hosting, di mana kita bisa menyimpan file-file situs web kita seperti Javascript, CSS dan HTML.</p><p><a href="https://panel.niagahoster.co.id/ref/48176"><strong>Niagahoster</strong></a> merupakan penyedia domain dan hosting dari Indonesia. Harga yang ditawarkan di sini cukup murah. Pelayanan yang diberikan oleh mereka juga bagus. Bahkan saya pernah dilayani chat saat jam 4 pagi.</p><p>Ada beberapa alasan mengapa kita mesti menggabungkan dua layanan ini:</p><ol><li>Harga domain yang ditawarkan oleh Niagahoster lebih murah dibandingkan domain yang dijual oleh Google.</li><li>Firebase Hosting memberikan kuota hosting gratis sebanyak 1GB dan <em>bandwidth </em>10GB/bulan. Ini adalah kuota berlimpah bagi kamu yang cuma ingin membuat website portfolio, CV, <em>profile page</em>, atau <em>landing page</em> sebuah produk maupun <em>software</em>.</li></ol><p>Pada intinya, memanfaatkan hosting gratis dari Firebase adalah pilihan yang bijak jika situs yang akan dibuat tidak memerlukan beban berat. Saya sangat tidak menyarankan kamu untuk menggunakan hostingan gratis Firebase pada situs jual beli karena situs komersial biasanya membutuhkan daya dan dana yang lebih besar. Sebaiknya ambil saja hostingan berbayar dari Firebase atau Niagahoster.</p><p>Sekarang mari kita lihat perbandingan harga hostingan antara <a href="https://panel.niagahoster.co.id/ref/48176">Niagahoster</a> dengan <a href="https://domains.google.com/">Google Domains</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q4uNy1pp5hyidT5pNmdQ_g.png" /><figcaption>Kiri: Niagahoster, Kanan: Google Domains</figcaption></figure><p>Kemudian kita lihat paket hosting termurah dari Niagahoster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*DodSaPrMT42YsVUpEpGCUQ.png" /></figure><p>Itu artinya kita harus membayar Rp 120.000/bulan untuk 500MB penyimpanan. Bandingkan dengan Firebase yang menawarkan gratis penyimpanan 1GB dan <em>bandwidth</em> 10GB/bulan! Lihat: <a href="https://firebase.google.com/pricing/">Firebase pricing</a></p><p>Kalau yang gratis sudah lebih dari cukup, mengapa harus ambil yang berbayar? Ya, kan?</p><p>Sekarang kita bahas tentang cara menghubungkan domain Niagahoster dengan Firebase Hosting.</p><p>Pastikan kamu punya akun <a href="https://firebase.google.com/">Firebase</a> dan akun <a href="https://panel.niagahoster.co.id/ref/48176">Niagahoster</a>. Jangan lupa, beli dulu domain di <a href="https://panel.niagahoster.co.id/ref/48176">Niagahoster</a> sebelum kita lanjut ke tahap berikutnya. Kalau belum punya akun Niagahoster, silakan buat <a href="https://panel.niagahoster.co.id/ref/48176">di sini</a>. Gunakan kupon ANGGRAYUDI untuk mendapatkan diskon 5% sewaktu pembelian domain.</p><p>Persiapkan hostingan Firebase kamu dengan mengikuti petunjuknya <a href="https://firebase.google.com/docs/hosting/">di sini</a>. Setelah hostingan kamu siap, nanti kamu akan diberi domain gratis oleh Firebase dengan format berikut: <strong>&lt;project-id&gt;.firebaseapp.com</strong>. Nah, domain gratis dari Firebase ini akan kita ganti dengan domain Niagahoster kamu, misalnya <strong>anggrayudi.com</strong>.</p><p>Pertama-tama, masuk ke halaman <a href="https://panel.niagahoster.co.id/service">panel Niagahoster</a> → pilih tab domain → klik tombol kelola → pilih tab Name Server. Masukkan name server berikut pada semua bidang tersebut:</p><ul><li>logi639105.mars.orderbox-dns.com</li><li>logi639105.earth.orderbox-dns.com</li><li>logi639105.venus.orderbox-dns.com</li><li>logi639105.mercury.orderbox-dns.com</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*nboSY7vF03lbH2FR2_Rs4A.png" /></figure><p>Selanjutnya pergi ke halaman Firebase hosting dan klik tombol biru <strong>Tambahkan domain kustom</strong>. Nanti akan muncul dialog seperti ini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*7ZTziMuJ-avSJbR7Y68JyA.png" /><figcaption>Isikan dengan domain Niagahoster punya kamu.</figcaption></figure><p>Tekan tombol <strong>Lanjutkan</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*dqgOXW7HU5pexhXVIfYDYQ.png" /><figcaption>Abaikan saja erornya. Ini merupakan hal yang wajar.</figcaption></figure><p>Salin <strong>Nilai</strong> di atas. Kemudian buka tab DNS Management di panel Niagahoster kamu. Klik tombol <strong>Add new record</strong>. Pilih <strong>Record type</strong> sebagai <strong>TXT Record</strong> dan tempelkan teks yang barusan kamu <em>copy</em> dari Firebase pada bidang <strong>Text data</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*jnn2SF0u4N2GkSq5yHYs1g.png" /></figure><p>Nanti Niagahoster akan melakukan sinkronisasi. Tunggu paling lama 24 jam agar hosting Firebase bisa terhubung dengan domain Niagahoster. Biasanya lebih cepat dan memakan waktu 6 jam.</p><p>Jika sudah berhasil, selanjutnya kita menyelesaikan <em>challenge</em> yang diberikan oleh Firebase. Kita diminta untuk memasukkan IP address yang diberikan Firebase ke dalam <strong>A Record</strong> domain kita. Masukkan IP address ini ke bagian <strong>DNS Management</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5BBdnC7rsXr_Et-l2Smj2Q.png" /></figure><p>Saat proses verifikasi berlangsung, Firebase akan menampilkan status domain kamu sebagai <strong>Ditangguhkan</strong>. Jadi jangan panik ya. 😉 Proses ini cukup lama dan bisa memakan waktu 24 jam.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*bXs6o7HR-6Fo_udoeFBnuA.png" /></figure><p>Oh ya, kamu juga bisa membuat subdomain dengan Firebase hosting, misalnya <strong>apps.</strong>anggrayudi.com.</p><p>Dan akhirnya… Jebret…!!! Firebase Hosting kita sekarang sudah menggunakan domain dari Niagahoster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*LG4foPBXwH03J5ig4AtBfA.jpeg" /></figure><p>Selamat berkarya…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d33bceac0498" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Perbandingan Firebase vs Amazon Web Services (AWS)]]></title>
            <link>https://hardiannicko.medium.com/perbandingan-firebase-vs-amazon-web-services-aws-f866fc8c6722?source=rss-d4a98ff30fe7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f866fc8c6722</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Anggrayudi Hardiannicko]]></dc:creator>
            <pubDate>Thu, 07 Feb 2019 04:38:58 GMT</pubDate>
            <atom:updated>2019-02-07T04:38:58.417Z</atom:updated>
            <content:encoded><![CDATA[<h4>Yuk cari tahu cloud services mana yang cocok dengan proyek kamu.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2VS5asPpUZfy7IvoRnQPcg.jpeg" /></figure><p>Pertempuran bisnis layanan <em>cloud</em> saat ini sedang sengit. Microsoft punya Azure, Amazon punya AWS, dan Google punya GCP &amp; Firebase. Memilih layanan <em>cloud </em>yang tepat tentu memerlukan penelitian untuk mengetahui mana yang cocok bagi proyek yang kamu buat. Maunya bikin startup dan aplikasi, tapi malah bingung memilih AWS atau Firebase? Yuk simak!</p><p>Saya sudah mencoba keduanya, AWS dan Firebase. Membandingkan mereka bukanlah hal mudah. Perlu waktu berbulan-bulan bagi saya untuk meneliti dan membandingkan keduanya untuk menentukan <em>cloud services</em> mana yang cocok bagi aplikasi Android yang saya buat. Berikut kesimpulan yang saya dapat setelah melalui analisa yang panjang.</p><h3>Firebase</h3><h4>Kelebihan</h4><ol><li>Dokumentasi yang rapi dan mudah dipahami.</li><li>Memiliki banyak tutorial dan proyek sampel yang bisa dipelajari.</li><li>Firebase mudah digunakan dan tidak memiliki kurva belajar yang tinggi. Misalnya saja untuk menambahkan fitur autentikasi atau login hanya membutuhkan waktu beberapa jam. Kemudahan ini dapat mencegah kode spageti yang banyak dibenci programmer. Kode spageti adalah istilah untuk kode yang algoritmanya berbelit-belit untuk mewujudkan sebuah fitur yang sangat sederhana.</li><li>Konfigurasi keamanan yang mudah. Jika kamu pernah menggunakan Firestore sebagai database, tentu sudah tahu bahwa aturan yang ingin dibuat hanya butuh waktu kurang dari beberapa jam.</li><li>Firebase cocok untuk pembuatan aplikasi mobile dan proyek-proyek sederhana, termasuk game offline.</li><li>Tersedia kuota gratis berlimpah. Ketika upgrade ke paket Blaze hanya dikenai biaya sesuai pemakaian.</li><li>Peduli dan selalu mendengarkan keluhan penggunanya. Saya ingat dulu pernah protes ke Firebase karena kuota gratis hilang setelah upgrade ke Blaze. Saya kirimi mereka email. Hanya sekitar 4 bulan setelahnya kuota gratis akhirnya tetap tersedia bahkan setelah upgrade paket. Ada banyak sebenarnya saya mengirimkan email ke Firebase untuk memberikan saran dan masukan. Mereka responsif. Hampir semua saran yang saya berikan selalu berhasil mereka wujudkan.</li><li>Dapat diintegrasikan dengan Google Cloud Platform.</li></ol><h4>Kekurangan</h4><ol><li>Firebase tidak cocok untuk aplikasi yang berbasis teks seperti aplikasi artikel dan berita. Anggap saja satu artikel terdiri dari 5KB data. Kemudian kalikan dengan ratusan ribu artikel yang dipublikasikan. Ditambah dengan biaya query dan pengiriman data. Ini akan membuat ukuran database membesar seiring waktu dan biayanya juga semakin tinggi.</li><li>Tidak dapat digunakan untuk membuat proyek <em>big data</em> yang membutuhkan jutaan transaksi database setiap detiknya. Contoh <em>big data </em>adalah data kependudukan, ujian nasional online, media sosial dan situs <em>e-commerce</em> seperti Tokopedia. Ini akan membuat biaya Firebase melambung tinggi.</li><li>Query NoSQL yang terbatas. Ketika melakukan query dengan database SQL tentu kamu tahu bahwa hampir semua jenis query dapat dilakukan. Mulai dari sort, agregasi dan pencarian <em>record</em> yang berisi teks tertentu. Query kompleks seperti ini tidak terdapat dalam database NoSQL Firebase, yaitu Realtime Database dan Firestore.</li><li>Tidak cocok untuk membuat proyek startup. Mayoritas startup ditujukan untuk membantu masyarakat dalam menyelesaikan masalah mereka. Hanya saja masyarakat itu jumlahnya banyak sekali. Ada jutaan. Firebase tidak dirancang untuk <em>big data</em>.</li><li>Tidak cocok untuk proyek berbasis keuangan seperti perbankan dan <em>fintech</em> karena Firebase tidak memiliki database SQL. Memang NoSQL unggul dalam kecepatan dan kemudahan, namun ia tidak cocok untuk penggunaan yang berbau keuangan. PostgreSQL adalah database terbaik yang saya tahu untuk melakukan hal itu.</li></ol><h3>AWS</h3><h4>Kelebihan</h4><ol><li>Harga murah dan dibayar sesuai pemakaian.</li><li>Memiliki fitur dan layanan yang banyak daripada Firebase. Suatu layanan AWS dapat dikaitkan dengan layanan lainnya. Misalnya menggabungkan layanan Elasticsearch dengan DynamoDB.</li><li>Cocok untuk pembuatan proyek startup, game online, media sosial, <em>fintech</em>, <em>e-commerce</em> dan <em>big data</em>. Instagram dan Bukalapak adalah contoh yang menggunakan AWS. Kamu dapat mewujudkan startup dan <em>big data</em> dengan EC2 dan PostgreSQL dari AWS.</li><li>Merupakan pilihan terbaik untuk membuat proyek dan perusahaan yang besar.</li></ol><h4>Kekurangan</h4><ol><li>Proses registrasi AWS sulit dan berbelit-belit. Saya pernah cerita betapa sulitnya membuat akun AWS <a href="https://medium.com/@hardiannicko/cara-membuat-akun-amazon-web-services-aws-dd104ff22b0b">di sini</a>. Sedangkan untuk membuat akun Firebase hanya cukup dengan GMail saja.</li><li>AWS memiliki kurva belajar yang tinggi. AWS sangat sulit, kompleks dan rumit untuk dipelajari. Jika membuat fitur autentikasi dengan Firebase dapat dilakukan dalam sehari, maka AWS butuh waktu berminggu-minggu. Ambil contoh AWS Cognito yang merupakan saingan Firebase Auth. Meski AWS Cognito memiliki kelebihan untuk login dengan kustom username, namun sampai saat ini AWS Cognito masih memiliki kendala untuk mengintegrasikan login dengan provider Google &amp; Facebook. Login dengan Google &amp; Facebook pada AWS Cognito tidak berfungsi sama sekali!</li><li>AWS sangat lamban dalam menangani keluhan penggunanya. Orang tidak mau berlama-lama untuk menunggu AWS menyelesaikan <em>bug </em>yang mereka buat. Saya pernah melaporkan <a href="https://github.com/aws-amplify/aws-sdk-android/issues/471"><em>bug</em> AWS MobileClient</a> karena tidak mendukung login dengan Google pada Android untuk API level di bawah 23. Sudah 8 bulan sejak artikel ini ditulis, tapi mereka masih belum selesai juga memperbaikinya. Padahal Firebase Auth dapat login dengan Google &amp; Facebook hingga API level 14! Apa yang salah sebenarnya dengan tim AWS mobile SDK? AWS terlalu memiliki banyak bug, ditambah dengan timnya yang lamban membuat kita seperti berada di neraka.</li><li>DynamoDB yang tidak dapat diandalkan. Perlu diketahui, meski DynamoDB menawarkan kuota gratis penyimpanan 25GB, namun Anda akan dikenai biaya mahal ketika melakukan query. Biaya pemakaian DynamoDB bersifat menipu. Query yang ada pada DynamoDB pun tidak begitu kaya. Intinya, DynamoDB tidak cocok untuk <em>big data</em>!</li><li>Fokus AWS adalah platform web, bukan mobile. Sehingga AWS dengan mudahnya menelantarkan pengembang SDK mobile mereka. Lihatlah jumlah tim yang dimiliki oleh AWS dalam mengembangkan <a href="https://github.com/aws-amplify/aws-sdk-android">AWS SDK for Android</a>, hanya terdiri dari beberapa orang. Ini mengakibatkan lambatnya perkembangan AWS di platform mobile. Jadi, AWS tidak cocok untuk proyek yang berfokus pada platform mobile, yaitu Android dan iOS.</li></ol><h3>Kesimpulan</h3><ol><li>AWS ditujukan untuk platform web dan perusahaan yang besar. Sedangkan fokus Firebase adalah platform mobile.</li><li>Gunakan AWS jika kamu memiliki keahlian <em>expert</em> dan tidak bekerja sendiri. AWS dirancang untuk proyek besar dan perusahaan raksasa. Sedangkan Firebase dirancang untuk aplikasi sederhana yang tidak membutuhkan komputasi tinggi seperti game online.</li><li>PostgreSQL dan EC2 merupakan dua layanan terbaik milik AWS untuk mengembangkan proyek <em>big data </em>seperti media sosial dan <em>e-commerce</em>. Hanya saja mewujudkan proyek sebesar ini mustahil dilakukan seorang diri.</li></ol><p>Ini diambil berdasarkan penelitian yang telah saya lakukan selama 4 bulan. Saya dulunya mengembangkan aplikasi Android dengan AWS MobileHub dan Amplify, namun sekarang sudah pindah ke Firebase karena lebih mudah dipahami dan tidak memiliki banyak <em>bug </em>seperti AWS. Saya tidak ingin menghabiskan sebagian besar waktu saya untuk mengembangkan aplikasi Android demi belajar AWS.</p><p>Melalui banyak pertimbangan akhirnya saya tahu bahwa AWS tidak ditujukan untuk platform mobile. Lalu bagaimana dengan Instagram yang menggunakan AWS? Instagram adalah aplikasi raksasa yang dibuat oleh ratusan programmer jenius. Karena Instagram menggunakan konsep <em>big data</em>, maka sudah pasti ia menggunakan PostgreSQL dan EC2. Informasi login pengguna mereka bahkan tidak disimpan dalam AWS Cognito karena mereka sadar betapa cacatnya layanan yang satu ini. Kamu bisa cek teknologi apa yang mereka gunakan di <a href="https://instagram-engineering.com/what-powers-instagram-hundreds-of-instances-dozens-of-technologies-adf2e22da2ad">What Powers Instagram: Hundreds of Instances, Dozens of Technologies</a>.</p><p>Gunakan AWS jika kamu punya perusahaan besar yang berisi programmer jenius. Dan gunakan Firebase jika kamu punya proyek sederhana dengan sedikit sumber daya.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f866fc8c6722" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cara Membuat Akun Amazon Web Services (AWS)]]></title>
            <link>https://hardiannicko.medium.com/cara-membuat-akun-amazon-web-services-aws-dd104ff22b0b?source=rss-d4a98ff30fe7------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd104ff22b0b</guid>
            <category><![CDATA[registration]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Anggrayudi Hardiannicko]]></dc:creator>
            <pubDate>Fri, 30 Nov 2018 17:27:34 GMT</pubDate>
            <atom:updated>2018-11-30T17:32:28.470Z</atom:updated>
            <content:encoded><![CDATA[<h4>Pengen bikin aplikasi berbasis <em>cloud</em>? Yuk registrasi AWS.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YmlTwbD8xS27xHX1WCDQMA.png" /></figure><p>Amazon Web Services (AWS) adalah sekumpulan layanan-layanan berbasis Cloud Computing yang di sediakan oleh Amazon sejak tahun 2002. Perusahaan lain yang menyediakan layanan <em>cloud computing </em>adalah Google Cloud, Firebase, Microsoft Azure dan Alibaba Cloud. Namun dari semua itu, menurut penelitian penulis yang memiliki layanan paling lengkap, murah dan canggih adalah AWS. AWS menerapkan sistem pembayaran <em>Pay as You Go</em>, yang dibayar sesuai pemakaian saja.</p><p>Cloud computing adalah pemanfaatan teknologi komputer untuk menciptakan layanan di internet secara terpusat. Layanan cloud ini digunakan (atau disewa) oleh programmer untuk mengembangkan aplikasi mereka sehingga tidak perlu lagi membuat server fisik yang membutuhkan biaya milyaran rupiah. Programmer dapat fokus mengembangkan aplikasi mereka tanpa perlu memikirkan kode untuk sisi backend server. Data pengguna sekarang dapat disimpan dengan mudah. Instagram, Tokopedia dan Bukalapak adalah aplikasi yang menggunakan layanan AWS.</p><p>Saat membuat akun AWS, beberapa orang mungkin mendapatkan cara yang sulit karena pihak AWS Verification Team meminta dokumen penting seperti KTP untuk aktivasi akun. Jika kamu beruntung, kamu cuma butuh waktu satu hari untuk aktivasi akun AWS dan pihak AWS Verification Team tidak akan meminta dokumen penting darimu.</p><p>AWS akan mempersulit pendaftaran saat kartu kredit/debit yang kamu gunakan tidak valid atau bermasalah ketika membayar biaya pendaftaran sebesar $1. Yang penulis buat di sini adalah tutorial registrasi AWS yang sulit.</p><h3>Apa yang dibutuhkan?</h3><ol><li>Email</li><li>Nomor telepon</li><li>Kartu Kredit atau Kartu Debit Internasional</li><li>KTP dan Kartu Tanda Mahasiswa (jika ada)</li><li>Bank Statement yang berisi riwayat transaksi kamu dalam satu bulan terakhir</li><li>Bukti pembayaran tagihan rekening listrik, air, atau telepon rumah yang tertulis alamat rumah kamu. Pilih salah satu.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*bim2DLCXYo275xZ2mvp6AA.png" /><figcaption>Struk pembayaran tagihan listrik</figcaption></figure><p>Pastikan pada bukti pembayaran terdapat alamat rumah kamu.</p><h4>Catatan</h4><ol><li>Pastikan nomor telepon dan email dalam keadaan aktif. Pihak AWS akan menelpon kamu untuk memverifikasi nomor teleponmu.</li><li>Pastikan nama lengkap yang diisikan ketika registrasi AWS cocok dengan nama yang tertera pada bank.</li><li>Jika kamu memilih kartu debit, pastikan sudah diaktifkan untuk transaksi internasional. Bank BNI, BRI, Mandiri, BCA biasanya belum mengaktifkan transaksi internasional. Penulis menyarankan untuk menggunakan kartu debit Jenius. Selain tidak ada bunga dan biaya administrasi bulanan, kartu debit Jenius juga memiliki banyak fitur canggih dan mudah dibuat. Pembuatan kartu debit Jenius tidak sesulit kartu kredit yang susahnya minta ampun. Untuk mendapatkan kartu debit Jenius, kamu cukup mengisikan identitas diri melalui aplikasi Jenius yang dapat diunduh di <a href="https://play.google.com/store/apps/details?id=com.btpn.dc">Play Store</a>. Kemudian aktifkan akun kamu dengan mendatangi Bank BTPN terdekat. Jangan lupa bawa KTP dan NPWP kamu atau NPWP milik orang tua saat melakukan aktivasi.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*sctOR_ppjsnQkLU_nuA0Xw.png" /><figcaption>Penampakan Kartu Debit Jenius</figcaption></figure><h3>Cara Registrasi</h3><p>Lakukan registrasi AWS di <a href="https://portal.aws.amazon.com/billing/signup">sini</a>. Isikan semua identitas diri dan kartu kredit/debit kamu. Setelah selesai mendaftar, kamu akan diminta untuk membayar biaya pendaftaran sebesar $1. Jangan pernah gunakan Virtual Card Number (VCN) sebagai pengganti kartu kredit! Jika pembayaran gagal, di sinilah kamu akan dipersulit oleh AWS Verification Team.</p><p>Jika akun kamu tertahan, maka AWS akan mengirimkan kamu email seperti berikut:</p><blockquote><em>Greetings from Amazon Web Services.</em></blockquote><blockquote><em>We were unable to validate important details about your Amazon Web Services (AWS) account. Your AWS account has been placed on hold pending additional verification. At this time, we urgently need your support to confirm your address information.</em></blockquote><blockquote><em>You will not be able to log in to your Amazon.com or the AWS portal. If you do not respond within 3 days of this email (by Thursday, June 7, 2018), your AWS account will be suspended and you will no longer be able to access AWS services.</em></blockquote><blockquote><em>At your earliest convenience, please send us a copy of a </em><strong><em>current bill (utility bill, phone bill or similar)</em></strong><em>, showing your name and address. Please provide for both the credit card holder and account holder if different.</em></blockquote><blockquote><em>IMPORTANT: When you send us your information, please include your email address, so we are able to process your fax as soon as possible. We can be reached via secure fax line at </em><strong><em>+1–206–922–5831</em></strong><em> and </em><strong><em>866–437–9072</em></strong><em>.</em></blockquote><blockquote><em>Once you have sent the requested documents via fax, please contact us at </em><a href="/service/mailto:aws-verification@amazon.com"><em>aws-verification@amazon.com</em></a><em> and include the following details:</em></blockquote><blockquote><em>- The billing address and phone number of the credit card on the AWS account<br>- The billing phone number of the credit card on the AWS account <br>- Business name and phone number (if applicable) <br>- The URL for your website (if applicable)<br>- A contact phone number where you can be reached should we need additional information<br>- Potential business/personal expectations for using Amazon Web Services</em></blockquote><blockquote><em>If you have any additional information you feel will expedite this process, please feel free to include that as well.</em></blockquote><blockquote><em>We apologize for any inconvenience this may have caused you and appreciate your patience with our security measures.</em></blockquote><blockquote><em>Thank you for your immediate attention to this matter.</em></blockquote><blockquote><em>Sincerely,</em></blockquote><blockquote><em>Amazon Web Services</em></blockquote><p>Sesuai pesan dari email di atas, semua dokumen penting tersebut harus dikirim melalui fax. Jika dalam 3 bulan kamu masih belum mengirimnya, maka akun kamu akan dihapus permanen dan email yang sekarang tidak dapat lagi digunakan untuk mendaftar ulang ke AWS.</p><p>Scan semua dokumen yang dibutuhkan berikut dan lampirkan ke dalam satu file PDF:</p><ul><li>KTP</li><li>Kartu kredit/debit</li><li>Bank Statement</li><li>Bukti pembayaran tagihan rekening listrik, air, atau telepon rumah</li></ul><p>Lampirkan juga informasi berikut dengan cara diketik:</p><ul><li>Nama lengkap</li><li>Nomor telepon pribadi</li><li>Nomor telepon yang terhubung dengan kartu kredit/debit dan akun AWS</li><li>Alamat rumah, bisnis atau perusahaan</li><li>Tujuan kamu membuat akun AWS</li></ul><p>Setelah semuanya lengkap, saatnya mengirim dokumen lewat fax. Kamu dapat mengirim fax lewat <a href="https://faxzero.com/">FaxZero</a>. Gratis loh!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*3Y50DhOiU8_mP2DCSnsbAQ.png" /><figcaption>Mengirim dokumen lewat fax secara online</figcaption></figure><p>Buka email kamu. Kamu akan diminta oleh FaxZero untuk melakukan konfirmasi pengiriman dokumen. Setelah kamu konfirmasi, dokumen akan sampai ke AWS Verification Team setelah beberapa jam.</p><p>Jangan terlena dulu. Sekarang saatnya kamu mengirim email konfirmasi ke <a href="/service/mailto:aws-verification@amazon.com">aws-verification@amazon.com</a> bahwa kamu sudah mengirim dokumen yang diperlukan. Kirim informasi berikut:</p><ul><li>Nama perusahaan/bisnis jika ada.</li><li>Nama lengkap kamu sesuai yang terdaftar pada bank.</li><li>Nomor telepon kamu yang digunakan pada bank, AWS, dan bisnis.</li><li>Nomor telepon bank. Biasanya terdapat di belakang kartu kredit/debit.</li><li>Nomor kartu kredit/debit.</li><li>Alamat rumah dan perusahaan/bisnis.</li></ul><p>AWS Verification Team perlu waktu sekitar 2–4 hari untuk mengaktifkan akun kamu. Setelah akun kamu aktif, kamu dapat menggunakan layanan AWS sepenuhnya. Pastikan saldo kamu selalu ada agar tidak macet ketika membayar tagihan AWS setiap bulannya. Jika saldo kamu kurang, tentu pembayaran akan bermasalah. Jika pembayaran bermasalah, kamu akan berurusan serius dengan pihak AWS.</p><h3>Penutup</h3><p>Layanan <em>cloud computing</em> tumbuh begitu pesat. Perusahaan teknologi berlomba-lomba mengembangkan teknologi cloud mereka. Mereka menyadari bahwa inilah bisnis masa depan.</p><p>Jangan sampai kita ketinggalan teknologi dan ilmu pengetahuan. Pekerjaan manual yang kamu lakukan saat ini belum tentu masih membuka lowongan pekerjaan di masa depan. Bekerjalah di bidang kreatif, yang menciptakan inovasi dan solusi bagi masalah orang banyak.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd104ff22b0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>