<?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 Jov Mit on Medium]]></title>
        <description><![CDATA[Stories by Jov Mit on Medium]]></description>
        <link>https://medium.com/@jovmit?source=rss-8c3c80794b1f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bl2UK1W8YZsE007VHf4DoQ.png</url>
            <title>Stories by Jov Mit on Medium</title>
            <link>https://medium.com/@jovmit?source=rss-8c3c80794b1f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 12:16:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jovmit/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[CI/CD for Android — Initial Deployment]]></title>
            <link>https://medium.com/@jovmit/ci-cd-for-android-initial-deployment-4b7f9eb021f0?source=rss-8c3c80794b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b7f9eb021f0</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[andriod-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[cicd]]></category>
            <dc:creator><![CDATA[Jov Mit]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:48:24 GMT</pubDate>
            <atom:updated>2024-02-20T16:09:36.014Z</atom:updated>
            <content:encoded><![CDATA[<h3>CI/CD for Android — Initial Deployment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ohvfkVZd6PmCrs1UfmnNw.png" /></figure><blockquote>This is a series of articles. If you missed the previous parts, find the whole list of steps here: <a href="https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04">https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04</a></blockquote><p>As mentioned before in the previous lessons, it is a requirement from Google Play to perform the initial deployment of the app manually.</p><p>We need to do preparation for our app on Google Play by creating the app and adding essential application details and resources such as the app name, description, icons, branding, terms and conditions, permissions, data safety, and more.</p><ol><li>Open up your Google Play Console, and click on the <strong>Create app</strong> button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7BnQHPaM4F7pnNOf.png" /></figure><p>2. Fill out the form about the application details, and create the app.</p><p>3. Follow the instructions on Google Play to fill out all the requirements about your new app, such as <strong>Store Listing</strong>, <strong>Data Safety, Permissions,</strong> and so on.</p><p>4. Make sure to add a link to the <strong>terms and conditions</strong> page in your <strong>Store Listing.</strong> If you still don’t have the terms and conditions page, there are a lot of online generators that will ask for a few things about your app and generate and host terms and conditions for you for free. That’s a good temporal solution at least.</p><p>5. Generate a signed app version (bundle) on your local environment, using the <strong>Keystore</strong> and the <strong>key</strong> you used to set up the GitHub secrets.</p><ul><li>In Android Studio go to <strong>Build -&gt; Generate Signed Bundle / APK…</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*6TCX2TN0Su66F9ni" /></figure><ul><li>In the dialog that appears make sure <strong>Android App</strong> <strong>Bundle</strong> is selected. That’s the recommended way to ship Android apps for the last few years.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eklvHqK3NE8Ilk-g" /></figure><ul><li>Click <strong>Next</strong></li><li>In the dialog that shows now, fill out the form if it’s not already pre-filled</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CewaOo37wnB9XN2r" /></figure><ul><li>Make sure the correct <strong>Keystore</strong> file is selected, the correct <strong>password</strong> for the <strong>Keystore</strong>, and the correct <strong>key alias-password</strong> combination is used. Click on <strong>Next</strong></li><li>In the dialog that appears next, select the variant you are going to be creating. In my case, I will be creating a <strong>release</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YX3HCx4fQ7wKEwdd" /></figure><ul><li>Optionally, you can change the destination of the generated file if you wish so. Click <strong>Create.</strong></li><li>That will generate a new bundle that we can drag and drop inside the Google Play Console.</li></ul><p>6. Go back to the Google Play Console, and do the initial app upload manually, using the signed bundle we just generated.</p><p>Once we have the initial deployment done, we can start using our CI/CD system for future deployments. All we need to do is just integrate the new code into the branch we have set up in the deployment script, and then the job will run and make a new deployment to Google Play.</p><p>It saves an incredible amount of time and sets us free from the boring tasks of building, singing, and deploying the app manually. On top of that, it’s way more secure to not hold the secrets in the repository, or on your local machine.</p><h3>Next Steps</h3><p>That is the end of the series! I hope you got a lot of value from it and it will be of help.</p><p>If you are looking for more Andriod-related teaching materials, courses, and support, <a href="https://www.skool.com/android-devs/classroom">get it at no cost here</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b7f9eb021f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI-CD for Android — Project Setup]]></title>
            <link>https://medium.com/@jovmit/ci-cd-for-android-project-setup-e9879416a864?source=rss-8c3c80794b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9879416a864</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[cicd]]></category>
            <dc:creator><![CDATA[Jov Mit]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:46:24 GMT</pubDate>
            <atom:updated>2023-11-06T22:06:26.482Z</atom:updated>
            <content:encoded><![CDATA[<h3>CI-CD for Android — Project Setup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LgC6SNIW9NzKAIFBQbVwSw.png" /></figure><blockquote>This is a series of articles. If you missed the previous parts, find the whole list of steps here: <a href="https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04">https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04</a></blockquote><p>At this point, we are almost done with the setup. The only thing left is to add a trigger for running a GitHub Action and the action itself.</p><p>The standard way for a CI/CD setup is to run an action on each code integration (i.e., when we merge some code into a desired branch). That would trigger an action, which will usually perform some checks (like running tests) and then deploy a new version of the software. In our case, it deploys a new app version on <strong>Google Play</strong>.</p><p>To complete the remaining part of the setup, open the project in the <strong>Android Studio</strong>.</p><p>To create a <strong>GitHub Action,</strong> we have to add a script in a specific folder in the project structure. The script is a <strong>YAML </strong>file. YAML has a specific format, similar to the Python language, where even a single space can make a huge difference.</p><p>To help you with this process, I’ve included an example script in the resources, so make sure to download it while going through this lesson.</p><blockquote><strong><em>Note: </em></strong><em>If you are not using GitHub to host your code, and you cannot use GitHub Actions for CI/CD — please send me a DM, and depending on the interest I will extend this course to include other options.</em></blockquote><ol><li>In the project explorer panel on the left side of the <strong>Android Studio</strong> — make sure you are seeing the files in a project mode (The default is Android, but it hides a lot of things).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/0*8idBX9qaJB2ZeEZf" /></figure><p>2. In the root of the project, add a folder named <strong>.github</strong> (note the dot in front of the name — it will make the folder hidden). Inside that folder, add another one called <strong>workflows</strong>, and inside that one, create a new YAML file (name it as you wish). Eventually, you should have a structure similar to this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/0*ajzjoKR4lsfnMNq9" /></figure><p>As you can see, here I have 2 scripts — one is my CI/CD action, and the other one only runs tests for the pull requests. So you can have as many scripts as you need.</p><p>3. Open the newly created YAML file. Let’s write our CI/CD script. Remember — you may download the script from the resources below this lesson as an example to look at. Feel free to copy-paste parts if you need to.</p><p>4. We start off by defining a name</p><pre>name: Deploy Production</pre><p>This is the name of the action that will appear in GitHub when running</p><p>5. Next, we define a trigger. Mind the indentation — it is very important in the YAML format.</p><pre>on:<br>  push:<br>    branches: [ main ]</pre><p>In this case, the trigger will be a push to a specific branch - main. There are other triggering options, like pull_request for example. If we replace the push with a pull_request in the script above, the action will run when a new pull request is created against the targeting branch - main</p><p>6. Next, we define the <strong>jobs</strong> that are going to be executed. As we will see later, they can run in parallel, or we can make a job dependent on another one. In that case, job B will wait until job A is completed.</p><pre>jobs:<br><br>  test: &lt;- this is not a keyword, just a name we choose ourselves.<br>    ...<br><br>  distribute: &lt;- same here - not a keyword. We name jobs as we want.<br>    ...</pre><p>7. Our first <strong>job</strong> will run the tests. The name test: is for our own brevity and understanding, and we can type anything. It&#39;s not a keyword that we must use.</p><pre>test:<br>    name: Unit tests<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - uses: actions/checkout@v3<br><br>      - name: Set up JDK 17<br>        uses: actions/setup-java@v3<br>        with:<br>          distribution: &#39;temurin&#39;<br>          java-version: 17<br>          cache: &#39;gradle&#39;<br><br>      - name: Grand execute permissions to gradlew<br>        run: chmod +x gradlew<br><br>      - name: Run unit tests<br>        run: ./gradlew testDebug</pre><p>Above, we see the entire job definition that will run the tests. Let’s break it down to understand what’s going on.</p><ul><li><strong>name:</strong> This one is simple — it’s the name of the job.</li><li><strong>runs-on:</strong> we define the environment where the job will be run. Most of the time we use ubuntu-latest. The first thing that happens when this whole script is executed, a virtual machine with the arguments we provide will be fired up. In this case, the VM will run on the <strong>latest Ubuntu</strong> distribution.</li><li><strong>steps: </strong>Once the VM is up and running, the steps will be executed one after another. The order of the steps is important, so keep that in mind!</li><li>The first step is to check out the latest code version. Pay attention to the actions/checkout@v3 part. That thing is called <strong>action.</strong> If you Google it, it will lead you to <a href="https://github.com/actions/checkout">this page</a> where you can find the whole documentation of how you can use this action. As you are noticing, we have omitted the name argument for this step to show that the name is optional.</li><li>The second step is to set up <strong>Java.</strong> We need Java to be able to run gradle commands and to build the project at all. For this step, we provide a name, and then we define the action that we will use: actions/setup-java@v3. In the with block we can add additional arguments, as to which Java version we will use, and which distribution. Here we are defining a cache as well, but it is optional and we can omit it. Again, by Googling: actions/setup-java@v3 we can see all the possibilities we can utilize when using this action.</li><li>The third step is to grant an execute permission to the gradlew file. This step is optional and we add it <em>just in case</em>. Note that in this step we use run. That is equivalent to running a command in the shell.</li><li>Finally, we fire up a command to run the tests: ./gradlew testDebug. Pay attention to the command here. In this example, we don&#39;t have any flavors. If we had for example staging and production flavors, the command would have been something like ./gradlew testStagingDebug or ./gradlew testProductionDebug depending on your need. A good approach is to run the command locally at the time of writing the script to see if that is what you need.</li></ul><p>8. The second job is to do the actual deployment.</p><pre>distribute:<br>    name: Distribute App<br>    needs: test<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - uses: actions/checkout@v3<br><br>      - name: Set Up JDK 17<br>        uses: actions/setup-java@v3<br>        with:<br>          distribution: &#39;temurin&#39;<br>          java-version: 17<br>          cache: &#39;gradle&#39;<br><br>      - name: Version Bump<br>        uses: chkfung/android-version-actions@v1.2.1<br>        with:<br>          gradlePath: app/build.gradle<br>          versionCode: ${{ github.run_number }}<br><br>      - name: Assemble Release Bundle<br>        run: ./gradlew bundleRelease<br><br>      - name: Sign Release<br>        uses: r0adkll/sign-android-release@v1<br>        with:<br>          releaseDirectory: app/build/outputs/bundle/release<br>          signingKeyBase64: ${{ secrets.KEYSTORE }}<br>          keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}<br>          alias: ${{ secrets.APP_NAME_KEY }}<br>          keyPassword: ${{ secrets.APP_NAME_KEY_PASSWORD }}<br><br>      - name: Setup Authorization With Google Play Store<br>        run: echo &#39;${{ secrets.GOOGLE_PLAY_API_AUTH }}&#39; &gt; service_account.json<br><br>      - name: Deploy to Internal Channel<br>        uses: r0adkll/upload-google-play@v1.0.19<br>        with:<br>          serviceAccountJson: service_account.json<br>          packageName: com.example.app<br>          releaseFiles: app/build/outputs/bundle/release/app-release.aab<br>          track: internal<br>          status: &#39;completed&#39;<br>          whatsNewDirectory: whatsNewDirectory/</pre><p>Let’s break this down as well, as this is the most important part.</p><ul><li><strong>needs:</strong> Right at the definition of the distribute job, we notice the &quot;<strong>needs&quot;</strong> argument. It tells this job that it has to wait on another one, in this case on the &quot;<strong>test</strong>&quot;. Without this argument, the jobs will run in parallel. For example, if we had a job to run the UI tests, we could run it in parallel with the other tests.</li><li><strong>steps: </strong>Same as above. And since we have an explanation for the first 2 steps above — let’s skip them here.</li><li>The third step in this job will bump the versionCode property of our build.gradle file. The value ${{ github.run_number }} is the run number of the script. Each time we run the script, the run_number increases by one. Of course, we can add some offsets if needed. Google chkfung/android-version-actions@v1.2.1 to find out more about this action and its possibilities.</li><li>Next, we are assembling a bundle. Back in the day, we were distributing APKs to Google Play, but that is no longer recommended. These days we are much better off distributing bundles, but the whys are out of the scope of this course. The command used is straightforward: run: ./gradlew bundleRelease. Again, if we happened to have flavors, the command would have been different depending on the flavor we are going to be distributing. In the case of flavors, running bundleRelease will make a bundle for all flavors. That&#39;s not necessarily a problem, but it will take more time and it is wasteful if we need only one flavor to distribute. A good approach is to run the command locally to test out if that is what you need.</li><li>Once we have the bundle created, we need to sign it. The first thing to figure out is where the bundle is being created (in which directory). That’s why it is important to run the proper bundle command locally and then find out the folder where the bundle is being created at. In case of no flavors, it will be something like this: app/build/outputs/bundle/release.</li><li>In the with block of the Sign Release step, we have a few arguments. Let&#39;s see them one by one:</li><li><strong>releaseDirectory: </strong>the folder where the bundle is being created (as described above)</li><li><strong>signingKeyBase64:</strong> here we need to put a reference for our <strong>Keystore</strong>. We have it inside our secrets that we created in the previous lesson.</li><li><strong>keyStorePassword: </strong>the password of the <strong>Keystore.</strong> Also available as a secret</li><li><strong>alias</strong>: the key we want to use to sign the bundle. Available in the secrets too.</li><li><strong>keyPassword:</strong> As the name suggests — the password of the key. Coming from the secrets as well.</li><li>All of the values except the releaseDirectory come from the secrets we created in the previous lesson, and we reference them through the secrets reference, like so ${{ secrets.NAME_OF_THE_SECRET_TO_USE }} where NAME_OF_THE_SECRET_TO_USE is a name of a secret (KEYSTORE, KEYSTORE_PASSWORD, etc).</li><li>Next, we prepare our authorization with Google Play Console. The command run: echo &#39;${{ secrets.GOOGLE_PLAY_API_AUTH }}&#39; &gt; service_account.json is actually creating a file named service_account.json, and it inserts the value that comes from the secrets (in this case the value of GOOGLE_PLAY_API_AUTH) inside that file. The name is irrelevant, we can choose any name we like. Only the extension is important to be <strong>.json</strong></li><li>Remember, this file is being created on demand when running this job, and it is temporarily available only until the job is done. Then the VM is shut down and all files created during the job run are deleted.</li><li>Finally, we have everything we need to make the final step — ship to Google Play. We utilize r0adkll/upload-google-play@v1.0.19 for deploying, and if you Google it - you will find the documentation of this action and all the possibilities it provides when it comes to shipping to Google Play.</li><li><strong>serviceAccountJson:</strong> the JSON file created in the previous step. We came full circle — we had a JSON file downloaded, but we couldn’t upload files to <strong>GitHub Secrets.</strong> So we had to extract the content of the file into a secret, and here create the file again.</li><li><strong>packageName: </strong>This is the package of your app. Google Play uses the package names as a unique identifier for the app, and if there is already an app on Google Play with the same package name it will not allow you to upload yours. You can find your package name in your manifest or build.gradle file as an <strong>applicationId</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/0*5C5CjcKlqw0qgBpq" /></figure><ul><li><strong>releaseFiles:</strong> the full path to the <strong>.aab </strong>file (bundle) created 3 steps before (assembling the bundle). Again, it is recommended that you run the assembling command locally and then figure out the folder structure where the <strong>.aab</strong> file is going to be created. In case of no flavors, and having the application module called app, most probably the bundle will be located in app/build/outputs/bundle/release/app-release.aab</li><li><strong>track:</strong> here we define which track we are going to deploy the app to. I highly recommend shipping it into a track that is used for internal testing (<strong>internal</strong> or <strong>alpha</strong>) where you can add a small group of people to be able to test the app manually, for example, your QA team, and then from that track promote to beta/production.</li><li><strong>status: </strong>what will be the status of the deployed app. If we are deploying to a channel available for internal use only, we can set this to &#39;completed&#39; . Available options are &#39;completed&#39;, &#39;inProgress&#39;, &#39;draft&#39;, &#39;halted&#39; . You can find many more options to customize the deployment <a href="https://github.com/r0adkll/upload-google-play">in the official documentation of the action</a>.</li><li><strong>whatsNewDirectory:</strong> we can create a directory in the project where we can define localized files for each different language that we want to write release notes for.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*TGXLVbxk1gQRjDtp" /></figure><ul><li>The files contained in this folder <strong>must</strong> use the pattern whatsnew-&lt;LOCALE&gt; where LOCALE is using <a href="https://www.rfc-editor.org/info/bcp47">BCP 47</a> format.</li><li>In the example above, I have only one file targeting en-US.</li><li>As you can imagine, we can add jobs in the script that will generate release notes automatically based on the git history, but that’s beyond the scope of this course.</li></ul><p>That’s it! We have our CI/CD setup in place and we can start using it. Once the script is added to the project when we push it to the remote repository — <strong>GitHub</strong> — it will automatically recognize it and it will run it. We can see the details of each job and each step in the <strong>Actions </strong>tab of the project. That’s also how we can debug and troubleshoot possible mistakes and errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YqZLB4cG-2_mPjH8.png" /></figure><p>There is only one single thing left to complete the entire setup, and that is a requirement from Google Play to do the initial app deployment manually. In fact, if we push this script to <strong>GitHub </strong>before making a manual deployment — it will fail and it will tell in the error message that the initial deployment has to be done manually. We will look into that in the last lesson of this course.</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-initial-deployment-4b7f9eb021f0">Jump to Initial Deployment</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9879416a864" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD for Android — Repository Setup]]></title>
            <link>https://medium.com/@jovmit/ci-cd-for-android-repository-setup-a874eec9ffda?source=rss-8c3c80794b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a874eec9ffda</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[cicd]]></category>
            <dc:creator><![CDATA[Jov Mit]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:45:31 GMT</pubDate>
            <atom:updated>2023-11-06T22:06:05.420Z</atom:updated>
            <content:encoded><![CDATA[<h3>CI/CD for Android — Repository Setup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOJ8gE5_Zi4QSEkCNTZ5Qg.png" /></figure><blockquote>This is a series of articles. If you missed the previous parts, find the whole list of steps here: <a href="https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04">https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04</a></blockquote><p><strong><em>Disclaimer: </em></strong><em>This course assumes you are using </em><strong><em>GitHub</em></strong><em> and walks you through setting up </em><strong><em>Actions </em></strong><em>for the repository on </em><strong><em>GitHub.</em></strong><em> If you happen to use a different platform as your code repository (like GitLab, BitBucket, etc) please send me a DM, and depending on your interest I will extend the course to cover more options.</em></p><p>If you already have a <strong>GitHub account</strong> created — great news! We can proceed and use it for the follow-up steps. If not, go ahead and create a new account — it’s free!</p><p>If you are using a <strong>GitHub account</strong> that belongs to a company or an organization — you will need to request permissions to be able to manage the account, or at least, the project that you are going to be setting up the CI/CD.</p><p>Once you are ready with the <strong>GitHub account</strong> setup, and you have the desired project that you are going to be setting up the CI/CD pipeline for available on the repository — you can proceed with the steps below. The setup of the repository and the project are out of the scope of this course, but if you have difficulties setting that up — feel free to drop me a DM, and I will gladly help you out!</p><ol><li>Open the project in <strong>GitHub </strong>using your favorite browser. You’ll see something like this</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DxwOwG_JG1JXtude.png" /></figure><p>2. From the top menu where you have the <strong>Code</strong> section selected — open <strong>Settings</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IDMh4DnzrEV5zRyh.png" /></figure><p>If you don’t have the <strong>Settings</strong> tab available — that’s a sign that you don’t own the project and you have no permissions to manage the project. Make sure you get that right before you proceed.</p><p>3. On the left side, you will see a menu with sections like <strong>Access, Code and automation</strong>, etc… Scroll down to the <strong>Security</strong> section, and select <strong>Actions</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/0*OHUCn--dOAE19FmG" /></figure><p>On the right hand side it will open a panel that is empty by default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z6gvIT99R3bbTtKF.png" /></figure><p>Our goal is to put here the things we’ve collected so far. Namely:</p><ul><li>The authorization with Google Play Console (the JSON file)</li><li>The Keystore + its password</li><li>The key (alias) + its password that we are going to use to sign the app with</li></ul><p>Let’s go ahead and add those things one by one.</p><p>4. Click on the <strong>New repository secret</strong> green button on the top right</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g3nZE50RgoFmn2Sn.png" /></figure><p>In the panel that gets opened, we can add a new secret. Beware that we can <strong>add</strong> <strong>only a single thing at a time.</strong> Let’s start off with the simple things first.</p><p>5. Let’s add the Google Play Console Authorization JSON first. In the <strong>Name</strong> field type: GOOGLE_PLAY_API_AUTH or any name that you prefer. Make sure to follow the naming convention as the hint suggests - all caps with an underscore.</p><p>In the <strong>Secret</strong> field put the content of the JSON file we’ve downloaded previously, at the <a href="https://medium.com/@jovmit/ci-cd-for-android-google-play-authorization-9f70192f94ed">Google Play Authorization</a> step. Just open the file using any text editor, copy the whole content, and paste it into the <strong>Secret</strong> field. Click on the <strong>Add secret</strong> button to confirm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lYQ7JHuSLMsDJrxh.png" /></figure><p>At this point we have 1 repository secret added.</p><p>6. Click on the <strong>New repository secret</strong> button again to repeat the process. Add the following items one by one, creating new repository secret for each and every item:</p><ul><li><strong>Name: </strong>KEYSTORE_PASSWORD -&gt; <strong>Secret:</strong> the password of the keystore we created</li><li><strong>Name: </strong>APP_NAME_KEY -&gt; <strong>Secret:</strong> the alias value of the key we created when creating the key store. In my case, the alias value was: <strong>appnamekey</strong>, so in my case the name-secret combination will be APP_NAME_KEY - appnamekey respectively</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cPHUBhtbb-uqahDg.png" /></figure><ul><li><strong>Name: </strong>APP_NAME_KEY_PASSWORD -&gt; <strong>Secret:</strong> the password of the key. In my case, I need to use the password of the <strong>appnamekey </strong>alias. Let&#39;s assume the password of the key was <em>something</em>, so I need to put that value inside the <strong>Secret</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o-y6EgEymJ-WnFnD.png" /></figure><p>At this point we have all the <strong>textual values</strong> added as secrets in our <strong>GitHub</strong> project secrets. We should have something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4zOHlfbcwU9SW5rh.png" /></figure><p>where the values inside these secrets correspond with the values we typed when creating our <strong>Keystore</strong> + the key, like so</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZkV6vaOvgLwj_f3P" /></figure><p>There is only 1 thing left to add, and that is the <strong>Keystore</strong> file.</p><p>7. Adding the textual values in the secrets was pretty straight forward. But the <strong>Keystore</strong> is a file, and in the secrets we can only add text values. How do we solve this problem? — <strong>Base64</strong> for the rescue. <strong>Base64</strong> allows us to encode a file into text and then use it.</p><ul><li>Open the terminal</li><li>Navigate to the folder where you have created the keystore file in the <a href="https://medium.com/@jovmit/ci-cd-for-android-keystore-setup-6fdaca1b0662">Keystore Setup Section</a>, in my case it was my <strong>Desktop</strong> directory</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/0*VT9ow2F23TycH-zm" /></figure><ul><li>Run: base64 -i my_keystore -o the_keystore.txt Explanation: we run the <strong>base64</strong> command, providing input <strong>(-i)</strong> the <strong>Keystore</strong> file, and asking it to write the output <strong>(-o)</strong> into a text file. You can type any name you want, just add <strong>.txt</strong> extension at the end.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/0*8wU9Xr4Flwz0Xq6I" /></figure><ul><li>Now we have the <strong>Keystore</strong> file as text available, and we can add it into our <strong>GitHub</strong> secrets. Either open the file with a text editor and copy the content, or run cat the_keystore.txt in the terminal, then copy the output.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vmewvl2fq2QEXYIy" /></figure><ul><li>Using the same steps from above, add <strong>New repository secret</strong> and type in the <strong>Name</strong> and the <strong>Secret</strong> respectively</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3LWJkX4aUttS44r_.png" /></figure><ul><li>Click on <strong>Add secret</strong> to confirm</li></ul><p>At this point, we have our secrets ready. We have very little to do in order to complete the whole setup. It might be heavy, but boy is it worth it. Next up — setting up the project</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-project-setup-e9879416a864">Jump to Project Setup</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a874eec9ffda" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD for Android — Keystore Setup]]></title>
            <link>https://medium.com/@jovmit/ci-cd-for-android-keystore-setup-6fdaca1b0662?source=rss-8c3c80794b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fdaca1b0662</guid>
            <category><![CDATA[android-keystore]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[andorid-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[cicd-pipeline]]></category>
            <dc:creator><![CDATA[Jov Mit]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:44:02 GMT</pubDate>
            <atom:updated>2023-11-06T22:05:40.739Z</atom:updated>
            <content:encoded><![CDATA[<h3>CI/CD for Android — Keystore Setup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sSE6gNvfPAqnMt8Wv4y_5Q.png" /></figure><blockquote>This is a series of articles. If you missed the previous parts, find the whole list of steps here: <a href="https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04">https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04</a></blockquote><p>One of the requirements to run an app on a device or emulator, or deploy it to the Google Play Store is the signature. An app must be signed with a special key for Google Play to accept it or a device to run it. You can think of the signature as something that proves your identity or brand.</p><p>The keys to sign apps are kept in a container that is called <strong>Keystore</strong>. As we will see below, one Keystore can hold many keys to sign different apps. In this section, we are going to create a new Keystore with keys inside it from scratch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-TZpVv_g6kzzvvqE" /></figure><p>The most common way to create a new keystore is to use <strong>Android Studio</strong>, which has a built-in wizard for doing so. If you don’t have an <strong>Android Studio</strong> installed, this is a great time to go ahead and install it. You can download it for free from the <a href="https://developer.android.com/studio">official Android Studio page</a></p><p>By default, the Android Studio implicitly creates a so-called <strong><em>debug keystore</em></strong> that is being used to run apps on an emulator or a real device. This Keystore, however, cannot be used to sign apps in order to deploy to Google Play. Just as its name suggests, it can be used only for debugging purposes. It is located in a hidden folder that the Android Studio normally creates in the <strong>home</strong> directory: ~/.android/debug.keystore</p><p>Now, let’s create our own Keystore.</p><ol><li>Open the Android Studio (make sure you run a newer if not the newest version), and then open any existing project. If you don’t have one, just create a new project. The project is absolutely irrelevant at this point, but we need one to be able to access the keystore creation menu.</li><li>From the <strong>Build</strong> menu, choose <strong>Generate Signed Bundle / APK…</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/0*s3t3HyqEpLTvuhPS" /></figure><p>It will open a dialog that allows us to choose how are we going to package our app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*USJTSaDC19UMH9DY" /></figure><p>It is irrelevant at this point, so you can leave the selection as is and click <strong>Next. </strong>It will open a new dialog which is the app signing dialog</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4XEeuyz_S_oaRr-W" /></figure><p>3. Since we don’t have a Keystore created yet, click on the <strong>Create new…</strong> button. As we can see, we can choose an existing keystore which is useful if we happened to have created one before. By choosing <strong>Create new…</strong> we will face a dialog where we need to type some information about our new Keystore</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DUe_3en-ORAvytJI" /></figure><p><strong>4. Key store path</strong> — select a directory where you want your new keystore file to be created. You can choose your <strong>Desktop</strong> folder for example, since we won’t keep this file locally on the computer for too long anyway.</p><ul><li>Type in a <strong>password</strong> for your keystore and <strong>confirm</strong> it. Remember, this password is for your <strong>Keystore</strong>, and the Keystore is the container that holds keys. Check out the illustration below for better visualization.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Aocl9JnXkN8fqOZR" /></figure><p>5. It won’t make sense to have an empty <strong>Keystore </strong>— so we should add at least 1 <strong>key</strong> (the section below the keystore password).</p><ul><li><strong>Alias</strong> — this is how we identify and differentiate a key from other keys. My suggestion is to associate the alias with the app name that you will be singing with this key. So you will have 1:1 mapping of an app with a key.</li><li><strong>Password</strong> — This is a password for the key itself. It is highly recommended to be different than the keystore password. Imagine your key store being a house, and your keys being different rooms inside your house. Each room has its own key which is different than the key of the house.</li><li><strong>Validity</strong> — indicates the validity duraiton of the keystore. Feel free to leave it as is (25 years).</li><li><strong>Certificate</strong> — Fill out the fields in the certificate section. If you have no organization to fill in, you can skip those 2 fields (<strong>Organization Unit</strong> and <strong>Organization</strong>)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VU0ASOvCBK0r-QiI" /></figure><p><strong>MAKE SURE</strong> to remember the passwords of the keystore and the key. Maybe write them down into a file or something handy until we finish the process of configuring the CI/CD.</p><p>6. Finally, click on <strong>OK</strong> and you will be taken back to the signing dialog, with the data of the new keystore pre-filled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5bz2fejE64sO1-YD" /></figure><blockquote><strong>Note:</strong> Feel free to untick the <strong>Export encrypted key</strong> checkbox at the bottom of the dialog as it is deprecated. Google Play is introducing a new process to upload signing keys for increased security.</blockquote><p>At this point, we have the <strong>Keystore</strong> with a single key inside it ready to use for signing! This is one more big step completed towards our goal! Time to set up the repository.</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-repository-setup-a874eec9ffda">Jump to Repository Setup</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fdaca1b0662" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD for Android — Google Play Authorization]]></title>
            <link>https://medium.com/@jovmit/ci-cd-for-android-google-play-authorization-9f70192f94ed?source=rss-8c3c80794b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f70192f94ed</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[google-play]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[cicd-pipeline]]></category>
            <dc:creator><![CDATA[Jov Mit]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:43:12 GMT</pubDate>
            <atom:updated>2023-11-06T22:05:17.625Z</atom:updated>
            <content:encoded><![CDATA[<h3>CI/CD for Android — Google Play Authorization</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ceKP5voaIvPQd9yqslEmOA.png" /></figure><blockquote>This is a series of articles. If you missed the previous parts, find the whole list of steps here: <a href="https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04">https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04</a></blockquote><p>As we have discovered in the previous section, once we create (or log in to an existing) Google Play Developer Account, we will land on a page that looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*92AXhjtGE6XaRzx5.png" /></figure><p>It means that we have access to the Developer Console, so we can already start deploying apps to Google Play.</p><p>Your Google Play Developer Console is a unique instance where you can deploy your apps.</p><p>The important part regarding the CI/CD setup is to be able to deploy to this console automatically. But how would our potential system know which Developer Console is ours? How do we link to our unique instance?</p><p>That’s where the <strong>API access</strong> comes into play. On the left-hand side menu, there is an item called <strong>API access,</strong> which is the starting point for our next steps in this setup.</p><blockquote><strong>Important</strong>: If you are not an owner of the Google Play Developer Account, you will not have the rigts to access this menu and therefore it won’t be shown at all. In that case you will need to use the owner account to login to the console.</blockquote><p>The way we use the Google Play Developer Console APIs is by using a single file (at the moment of creating this course it comes in a JSON format) that contains information about our unique instance and authorization to use the APIs.</p><p>Our job is to obtain that file so that we can use it.</p><ol><li>Open the <strong>API access</strong> from the side menu</li><li>You might be prompted with a question about <strong>Google Cloud Project</strong> with 2 options to choose from: <strong>Link an existing </strong>| <strong>Create new</strong></li></ol><ul><li>For the sake of this course, we will work on a new one, so select <strong>Create new</strong></li></ul><p>3. You will be faced with a screen similar to this one :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4wHPuFmx5WSd4hUm.png" /></figure><blockquote><strong>Note</strong> <strong>that</strong> at the moment you are going through this article, the page might differ as it is software made by Google and they are continuously improving it.</blockquote><p>The page contains a few sections, one of which is the APIs. You will see the <strong>Google Play Android Developer API</strong> turned <strong>ON.</strong> If that&#39;s not the case - don&#39;t worry, it will get there eventually.</p><p>4. Next, we focus on the <strong>Credentials</strong> section, Service accounts specifically. Our goal is to create a new service account. In the example above we can see already an item in there, as that is something I have created before. If you are setting up for the first time, the list will be empty. In both cases, it should show a button/link to View in Google Cloud Platform. If that&#39;s not the case, by clicking on Learn how to create service accounts we will get offered a link to open the <strong>Google Cloud Platform</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dklTFtACra14wEqJ" /></figure><p>The main goal is to get to the <strong>Google Cloud Platform</strong>, and it is irrelevant how we will get there. It’s a different system where we can manage the APIs we will use and the access to them. This is how does it look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-99Xhyea2-GyvDIy.png" /></figure><p>As we can see on the left top side, we have the <strong>APIs &amp; Services</strong> page currently opened. There is also a hamburger menu available where we can go to different pages. Go ahead and click on the menu, then select <strong>IAM &amp; Admin</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lilzLn3jmEqVpxWL" /></figure><p>5. From this submenu, select <strong>Service Accounts.</strong> It will show a page like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XgkXsF6eREEMYPUq.png" /></figure><p>As we can see here, I already have created a service account before, and we can see it listed here. If you are setting it up for the first time, this list will be empty. Go ahead, and click on the <strong>+ CREATE SERVICE ACCOUNT</strong> button on the top middle of the page. You will face a form like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aSru7SY_VyiP_7fA" /></figure><p>6. Fill out the form according to your needs/desires. If you are about to deploy multiple apps on the same google play account (which is what most people and companies do), you can choose more generic data. On the other hand, if you want to be more strict, you can name the things according to the project you are working on, and then create multiple items as you need. That’s also an option.</p><p>The following step asks to grant permissions to the service account. I recommend granting <strong>Owner</strong> permissions, but again — choose according to your needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ifXlJ3qqhQHtow5e" /></figure><p>Once you are done and you have the service account created, you will be taken back to the start page where you will see your new service account listed, like so</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K8ziWmPrUTAEu7_S.png" /></figure><p>As we can see here, I have no <strong>Key ID </strong>for my newly created account. Let’s go ahead and click on it to open it in detail. You have to click on the left-side email-like link to open it. It will show the detail page, like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WtX-7sTldHvoQufP" /></figure><p>7. Click on the <strong>KEYS</strong> section at the top to see the keys. Initially, we have no keys so the page is empty</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*54s_cz9HoI2Bx42z" /></figure><p>Go ahead and click on <strong>ADD KEY</strong> drop-down button, and select <strong>Create new key</strong>. You will be prompted to choose the type of the key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s7Cw38BnXxOZaXdg" /></figure><p>Make sure the <strong>JSON</strong> type is selected (which is also the recommended type) and click on <strong>CREATE.</strong> It will download a JSON file to your preferred folder for downloads (mine is Desktop).</p><blockquote><strong>Note:</strong> Depending on your browser, it might not automatically download the JSON. I have seen issues with some browsers, but in general, Chrome, Firefox and Safari work fine.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DjigKL7pKNbqzPQi.png" /></figure><p>This <strong>JSON</strong> file is the file we need to use the <strong>Google Play Developer</strong> APIs. <strong>Beware</strong> that you <em>cannot</em> re-download this file. If you lose it before you finish the whole setup of your CI/CD, you will have to create a new key. The good thing is that you don’t have to re-create the account tho. Only the key. As we can see now, the newly created key is listed as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6z-BImVPCpIwb9G5.png" /></figure><p>With this step, we have completed a huge part of the preparation for the whole CI/CD setup. Make sure you keep the JSON file safe as we will need it together with the <strong>Keystore</strong> when setting up the repository. Next up: the Keystore Setup</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-keystore-setup-6fdaca1b0662">Go to the Keystore Setup</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f70192f94ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD for Android — Google Play Developer Account Setup]]></title>
            <link>https://medium.com/@jovmit/ci-cd-for-android-google-play-developer-account-setup-434114994547?source=rss-8c3c80794b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/434114994547</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[cicd-pipeline]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Jov Mit]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:42:08 GMT</pubDate>
            <atom:updated>2023-11-06T22:04:44.485Z</atom:updated>
            <content:encoded><![CDATA[<h3>CI/CD for Android — Google Play Developer Account Setup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4lkp3X8fkWQF_3Lam7vAJw.png" /></figure><blockquote>This is a series of articles. If you missed the previous parts, find the whole list of steps here: <a href="https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04">https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04</a></blockquote><p>The standard way to deploy an Android application is to publish it on <strong>Google Play Store</strong>.</p><p>There are alternative stores like Samsung and Huawei, but they mostly serve their own set of devices with apps tailored for them.</p><p>Google Play is by far the biggest store for Android apps available at the moment. Chances are you want to publish the app on Google Play Store.</p><p>The first step forward is to get access to the Google Play Developer account. You may already own one, or you are using an account owned by the company you are working for.</p><p>For the purpose of this course, we will assume you don’t have an account so we will go ahead and create one. It is worth mentioning that creating a developer account costs <strong>$25 (one-time payment)</strong>.</p><ol><li><a href="https://play.google.com/console/signup">Open the Google Play Developer Console</a>. Use your existing Google account to log in. It might ask you to set up 2-step verification for your Google account if you haven’t already.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k-RwlMbnqL3Cm-xM.png" /></figure><p>2. Choose the type of account you are about to create. We will choose the first option <strong>“Yourself”</strong> to create a personal one.</p><p>3. Fill out the <strong>“About You”</strong> section. The form is small and straightforward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fCEa6HeNoCED11AD.png" /></figure><p>4. Fill out the basic information about your new Developer Account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1hpZUgJNh_sbtw0W.png" /></figure><p>5. Fill out the Apps section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-VD8S_nkjgH1Jf2a.png" /></figure><p>6. Finally, check out the terms and conditions and tick the agreement boxes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SJqP-v1T9NOZEIV7.png" /></figure><p>When you click the <strong>“Create account and pay”</strong> button it will ask you to add a credit card if you haven’t already linked one with your Google account, and it will charge you <strong>$25.00 (one-time payment)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*erj8YL06hNaqUzBc" /></figure><p>Once you have that completed, we have access to our Google Play Developer Account, and we can access the Developer Console where we can publish apps.</p><p>You will see the landing page which is a dashboard that will be listing your apps on Google Play. Since you have no apps published yet it will be empty, but below is an image of how it would look once you publish some apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VlnmGQYKceOO3VjS.png" /></figure><p>The most important part, for now, is having access to this page, and we will start from there in the following Google Play Authorization section.</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-google-play-authorization-9f70192f94ed">Go to Google Play Authorization</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=434114994547" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD for Android — Requirements]]></title>
            <link>https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04?source=rss-8c3c80794b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fd7f5a92a04</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[Jov Mit]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:38:08 GMT</pubDate>
            <atom:updated>2023-08-22T12:38:08.098Z</atom:updated>
            <content:encoded><![CDATA[<h3>CI/CD for Android — Requirements</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4VAiLZhZxAi1NCwaxnBPA.png" /></figure><p>In order to set up a basic CI/CD pipeline for deploying Android apps to the Google Play Store — we need to get through a list of requirements:</p><h4>Google Play Developer Account</h4><p>The first thing that is required to set up the CI/CD for Android is creating a Google Play Developer Account so that the CI/CD will have a destination where to deploy to. Go to the Google Play Developer Account Setup section for more details and steps to set it up.</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-google-play-developer-account-setup-434114994547">Jump to Google Play Developer Account Setup</a></p><h4>Authorization to Google Play Developer Account</h4><p>Once we have the Google Play Developer account in place, we will need to be able to use it for deployment. That is done through an API provided by the Google Play Developer Console. Go to the Google Play Authorization section for more details and steps to set it up.</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-google-play-authorization-9f70192f94ed">Jump to Google Play Authorization Setup</a></p><h4>Keystore and signing setup</h4><p>Now that we have the Developer Account up and ready, we can start working on preparing the app for deployment to Google Play. In order to deploy to Google Play, the applications need to be signed with a special key that we can create inside the Android Studio. Go to the Keystore setup section for more details and setup steps.</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-keystore-setup-6fdaca1b0662">Jump to Keystore Setup</a></p><h4>Repository Setup</h4><p>At this point, we have the signing ready to sign our applications before we deploy them to Google Play. We are good to go if we are about to do manual deployments. But the idea behind this course is to make automated deployments and get rid of all the manual work related to it. Therefore, our next step is to set up the repository. In the Repository Setup section we go into the details and steps to get it ready.</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-repository-setup-a874eec9ffda">Jump to Repository Setup</a></p><h4>Project Setup</h4><p>In addition to the repository setup, we might need to do a little update for the project itself. This depends on the choice of the repository solution (GitHub, BitBucket, etc.) and the CI/CD runner. We go over the details in the Project Setup section.</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-project-setup-e9879416a864">Jump to Project Setup</a></p><h4>Initial Deployment</h4><p>We are pretty done at this point, and our CI/CD system could already start doing the job for us. The only last bit missing is a first manual deployment which is a requirement from the Google Play Console. Let’s get through it in the Initial Deployment section.</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-initial-deployment-4b7f9eb021f0">Jump to Initial Deployment</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fd7f5a92a04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Most Complete CI/CD Setup For Android Devs]]></title>
            <link>https://medium.com/@jovmit/the-most-complete-ci-cd-setup-for-android-devs-2c3482715139?source=rss-8c3c80794b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c3482715139</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[cicd]]></category>
            <dc:creator><![CDATA[Jov Mit]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:36:27 GMT</pubDate>
            <atom:updated>2023-08-22T12:36:27.784Z</atom:updated>
            <content:encoded><![CDATA[<h4>Continuous Integration/Continuous Delivery for Android App Development</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eXSMbnKfEbgw134dUdLr2g.png" /><figcaption>Intro to CI/CD for Android</figcaption></figure><p>This is a series of articles that are going to get into the deepest details about setting up a CI/CD pipeline for deploying to the Google Play Store from scratch! Let’s get started!</p><h3>Introduction</h3><p>One of the things computers are best at is performing repetitive operations over and over again. They are never getting bored or tired, rather, they are happy to do those tasks for us.</p><p>The idea behind CI/CD is to establish a workflow that allows us to deliver the work we do to the customers quickly, reliably, and frictionlessly.</p><p>It is a system that enables us to trigger a whole set of operations that are working in a sequence or parallel by a simple push to a remote repository. These operations can be anything from running custom scripts that we can write ourselves, all the way to writing release notes based on the changes done from release to release. For most of the projects, most of the time, the CI/CD does at least the following tasks:</p><ul><li>Pull the latest code changes</li><li>Build it</li><li>Run checks (like lint and tests)</li><li>Deploy</li></ul><p>Doing that sequence of tasks every time manually is super painful, time-consuming, mistake-prone, and gets very boring over time. Establishing a CI/CD system will enable us to run the sequence as many times as we want effortlessly. So it is a great return on investment.</p><p>In this course, we will get through the steps to set up CI/CD for deploying an Android App to Google Play Store, and we will look into many interesting things along the way. Enjoy!</p><p><a href="https://medium.com/@jovmit/ci-cd-for-android-requirements-2fd7f5a92a04">Jump to Requirements</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c3482715139" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing Screenshot Tests with Paparazzi]]></title>
            <link>https://medium.com/@jovmit/writing-screenshot-tests-with-paparazzi-5fd4d413c760?source=rss-8c3c80794b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fd4d413c760</guid>
            <category><![CDATA[android-testing]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[screenshot-testing]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Jov Mit]]></dc:creator>
            <pubDate>Sat, 19 Aug 2023 12:49:47 GMT</pubDate>
            <atom:updated>2023-08-19T12:49:47.899Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LmrQYgjWGE8xsFrNFPLCxQ.png" /></figure><p>Screenshot testing is one of the most potent ways to make sure your UI remains looking the same over time. With screenshot testing, we aren’t only checking if the UI elements are present on the screen, but also if they are positioned well, and if they look as they should.</p><p>What’s good about the Screenshot testing lately is that it gets a fast, stable, and reliable way to test UI. In terms of Android, a bunch of frameworks are available lately, and one of them is <a href="https://github.com/cashapp/paparazzi">Paparazzi</a></p><p>In this article, we’ll look into how to set it up and use it.</p><h3>Setup</h3><p>Probably the most important thing to keep in mind before approaching Paparazzi is that <em>it must be set up in a module other than your main app module</em>. The problem is in the way and the order in which things are being compiled, and @jrodbx explained it well, so if you are looking for the details — John got them all.</p><p>That’s in fact a good thing because it forces us to move the composables into a different module and make them stateless. In general, that is good practice.</p><h4>Dependencies</h4><p>When it comes to the dependencies, there is only a single plugin dependency that we need to bring in. Depending on your current build.gradleconfiguration, you would either do:</p><p><strong>Plugin Application</strong><br>At your project level build.gradle add the following:</p><pre>buildscript {<br> repositories {<br>   mavenCentral()<br>   google()<br> }<br> dependencies {<br>   classpath &quot;app.cash.paparazzi:paparazzi-gradle-plugin:version&quot;<br> }<br>}</pre><p>And then in your app level build.gradle add:</p><pre>apply plugin: &quot;app.cash.paparazzi&quot;</pre><p><strong>Plugins DSL</strong><br>If you are using plugins DSL, in your root build.gradle add the following:</p><pre>plugins {<br> id &quot;app.cash.paparazzi&quot; version &quot;&lt;paparazzi_version&gt;&quot;<br>}</pre><p>and then also pull the plugin in the module(s) where you will be writing the Paparazzi tests.</p><p><strong>Version Catalog</strong><br>Ultimately, if you are using Version Catalog (which you should), do this:</p><p>In your libs.versions.toml in the plugins section, add:</p><pre><br>paparazzi = { id = “app.cash.paparazzi”, version.ref = “paparazzi-version” }<br></pre><p>Next, in your root build.gradle plugins add:</p><pre><br>plugins {<br> …<br> alias libs.plugins.paparazzi apply false<br>}</pre><p>And ultimately, in your module(s) build.gradle where you will be writing Paparazzi tests, in the plugins, add:</p><pre><br>plugins {<br> …<br> alias libs.plugins.paparazzi<br>}<br></pre><p>That is enough for the setup. BTW, if you need help introducing the version catalog in your app — comment below, and I’ll write a tutorial.</p><h3>Usage</h3><p>Now we can go ahead and start writing screenshot tests. If you are using Previews for your composables, you are already in a great position, because writing screenshot tests for your composables will be as effortless as a copy-paste.</p><blockquote>Note: Paparazzi works with the traditional View system just as well. However, in this post we only talk about Composables.</blockquote><p>As established before, we should be in a module other than the main app module. It can be a single module where we host all our composable and their states, or we might have feature modules holding their own composables. Both are equally fine.</p><p><strong>Writing Tests</strong><br>The best thing about Paparazzi is that we write unit tests that run very fast. Plus they are stable and reliable. A Paparazzi test is very similar to a regular unit test. First, we need to get the Paparazzi rule:</p><pre><br>@get: Rule<br>val paparazzi = Paparazzi(<br> deviceConfig = DeviceConfig.PIXEL_5<br>)</pre><p>Then we can use it to write a test:</p><pre><br>@Test<br>fun loginScreenSnapshot() {<br> paparazzi.snapshot {<br>   LoginScreen(…) //&lt;- The composable to make a screenshot from.<br> }<br>}</pre><p>That’s all! Now we can run this test. As we can examine from the example above, the API is super simple and easy to use. The rule allows us to create a configuration that suits us. All we need to do is wrap our composables in the snapshot lambda.</p><p><strong>Taking Screenshots</strong><br>Once we write a test and run it — it will pass. But it won’t make a screenshot. It will pass because there was no screenshot created before. We need to generate screenshots from our tests initially, so then when we rerun the tests, they will be checking against something.</p><p>To create the screenshots, in the terminal, we need to run:</p><pre>./gradlew module:recordPaparazziDebug</pre><p>Running this command will generate the screenshots in the tests directory snapshots folder.</p><p>Then, for subsequent runs, we can use</p><pre>./gradlew module:verifyPaparazziDebug</pre><p>to check if we happened to break any of the composables.</p><p><strong>Leveraging Previews</strong><br>A very good and common practice in a typical Jetpack Compose codebase is writing previews for the composables. It allows us and other developers to see what a composable is rendering and what the UI it spits out looks like. When that is the case, writing the Paparazzi tests boils down to copy-pasting the preview to the paparazzi.snapshot{} lambda.</p><h3><strong>Next Steps</strong></h3><p>If you are looking for more resources to learn Jetpack Compose and Android Development — <a href="https://www.skool.com/android-devs?invite=e7235a1900bf49cb89c043e0fb9753d3">join my free training here</a>.</p><p>Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fd4d413c760" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improving Design — Separating responsibilities]]></title>
            <link>https://medium.com/@jovmit/improving-design-separating-responsibilities-4a3669dc8544?source=rss-8c3c80794b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a3669dc8544</guid>
            <category><![CDATA[solid]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Jov Mit]]></dc:creator>
            <pubDate>Thu, 28 May 2020 10:09:28 GMT</pubDate>
            <atom:updated>2020-05-28T10:09:28.911Z</atom:updated>
            <content:encoded><![CDATA[<h3>Improving Design — Separating responsibilities</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b6CII_Ek7YCgn9hT_nitoA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@fdelgado?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Francisco Delgado</a> on <a href="https://unsplash.com/s/photos/free-design?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Most probably everyone in the software development is familiar with the SOLID principles, as they are very well established across the industry. By applying the SOLID principles, the code’s structure becomes more robust, more comfortable to change, and better in general. I recently came into an example, which was an excellent motivation for me to wrap my thoughts into a blog post and record a screencast where I demonstrate how the code is getting improved:</p><p><a href="https://jovmit.io/posts/simple-design/">Improving Design - Separating responsibilities</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a3669dc8544" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>