<?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 Codeible on Medium]]></title>
        <description><![CDATA[Stories by Codeible on Medium]]></description>
        <link>https://medium.com/@Codeible?source=rss-1a504610e589------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*biWtH3ZgXBh4fsqcAfnaCA.png</url>
            <title>Stories by Codeible on Medium</title>
            <link>https://medium.com/@Codeible?source=rss-1a504610e589------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:30:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Codeible/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[Adding Google Admob Ads to your Unreal Engine Android & iOS Apps | with Test Ads setup (Blueprint]]></title>
            <link>https://medium.com/@Codeible/adding-google-admob-ads-to-your-unreal-engine-android-ios-apps-with-test-ads-setup-blueprint-6cad75310692?source=rss-1a504610e589------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cad75310692</guid>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[google-admob]]></category>
            <category><![CDATA[unreal-engine-4]]></category>
            <category><![CDATA[admob]]></category>
            <category><![CDATA[unreal-engine-5]]></category>
            <dc:creator><![CDATA[Codeible]]></dc:creator>
            <pubDate>Wed, 05 Apr 2023 23:58:50 GMT</pubDate>
            <atom:updated>2023-04-06T22:47:24.948Z</atom:updated>
            <content:encoded><![CDATA[<h3>Adding Google Admob Ads to your Unreal Engine Android &amp; iOS Apps | with Test Ads setup (Blueprint)</h3><p>Hello, in this tutorial, I’ll show you how to use the <a href="https://www.unrealengine.com/marketplace/en-US/product/admob-blueprint">AdMob Blueprint Plugin</a> for Unreal Engine to place ads on your app.</p><p>Follow on Twitter: <a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fcodeible.com%2F&amp;ref_src=twsrc%5Etfw&amp;region=follow_link&amp;screen_name=KingWaiMark&amp;tw_p=followbutton">Codeible (@codeible) / Twitter</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fz3NnAc5a1Fg%3Fstart%3D2%26feature%3Doembed%26start%3D2&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dz3NnAc5a1Fg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fz3NnAc5a1Fg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/495db956f229bdda10e1303e12c2a693/href">https://medium.com/media/495db956f229bdda10e1303e12c2a693/href</a></iframe><h3>Documentations</h3><p><a href="https://codeible.com/view/videotutorial/8k92mQRVWseK67IjfOMg">Setup &amp; Test Ads</a></p><p><a href="https://codeible.com/view/videotutorial/8k92mQRVWseK67IjfOMg;title=Adding%20a%20Banner%20Ad">Creating a Banner Ad</a></p><p><a href="https://codeible.com/view/videotutorial/8k92mQRVWseK67IjfOMg;title=Interstitial%20Ads">Creating an Interstitial Ad</a></p><p><a href="https://codeible.com/view/videotutorial/8k92mQRVWseK67IjfOMg;title=Rewarded%20Ads">Creating an Rewarded Ad</a></p><p><a href="https://codeible.com/view/videotutorial/8k92mQRVWseK67IjfOMg;title=Packaging%20the%20Google%20AdMob%20Blueprint%20Plugin">Packaging your project</a></p><h3>Installing the Plugin</h3><ol><li>To begin, go to the Unreal Engine Marketplace. Search for <a href="https://www.unrealengine.com/marketplace/en-US/product/admob-blueprint"><strong>Admob Blueprint</strong></a> and install the plugin.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bvat7kW6nCJr8-xooTS03w.png" /><figcaption>Codeible.com — Installing Plugin Image</figcaption></figure><p>2. Now go to <a href="http://Now go to console.firebase.google.com in your favorite browser.">console.firebase.google.com</a> in your favorite browser.</p><p>3. Sign in with your Google Account or create one if you don’t have one already.</p><p>4. Create a New Project or use an existing one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*MBzUSui1ZoetlkBaLDl8xQ.png" /><figcaption>Codeible.com — Firebase Console</figcaption></figure><p>5. Click on the Gear Icon on the navigation menu and select Project settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*Ac7LgP84oZNCMvN-jGutxw.png" /><figcaption>Codeible.com — Project Settings</figcaption></figure><p>6. If you want to show ads on Android, click on the Android icon. If you want to show ads on iOS, click on the iOS icon.</p><blockquote>If you plan to deploy your app on Android and iOS, you’ll need to do both.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*3aHqJyP449raYlaqfcAFGQ.png" /><figcaption>Codeible.com — Icons</figcaption></figure><h3>Android Setup</h3><ol><li>Insert the package name for your app. Make sure it matches your app or your real ads from AdMob will not show and you’ll not be able to package your app.</li></ol><blockquote>For testing, use this package name <strong>com.ue.admob.blueprint.plugin</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*slGkLst_tzDRRpDwTNQHcA.png" /><figcaption>Codeible.com — Android Package Name</figcaption></figure><p>2. Now click on Register app to start the project creation.</p><p>3. On the next step, download the <strong>google-services.json</strong> file and click next until you reach the last step.</p><p>4. Click on<strong> Continue to console</strong>.</p><p>5. Now that you have the <strong>google-services.json file</strong>, you can begin adding ads to your app. Locate your Unreal Engine project and put the <strong>google-services.json</strong> file into the root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iXm0FtqnvWZox_l_fKZe0Q.png" /><figcaption>Codeible.com — Android Root Dir</figcaption></figure><p>6. Now open your Unreal Engine app and open the Plugins window.</p><p>7. Search for <a href="https://www.unrealengine.com/marketplace/en-US/product/admob-blueprint"><strong>Admob Blueprint</strong></a> and add it to your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*Xjf0x_jSxONDptWucw5fyQ.png" /><figcaption>Codeible.com — Install Plugin</figcaption></figure><p>8. Once you have the plugin installed, open the Project Settings window, and look for the Android menu on the left under Platforms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*Z1dyxVOZ366qswmxoUD5fw.png" /><figcaption>Codeible.com — Android Platform Menu</figcaption></figure><p>9. Configure your project for Android.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*49wUPayfkGe8KbIc2njx2Q.png" /><figcaption>Codeible.com — Configure for Android</figcaption></figure><p>10. Then change the package name to match the one on Firebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*T3xSo1Xx0LzHSmBFI2WVvQ.png" /><figcaption>Codeible.com — Android Package Name Change</figcaption></figure><p>11. Now go to the <a href="https://codeible.com/view/videotutorial/8k92mQRVWseK67IjfOMg;title=Google%20AdMob%20Blueprint%20Plugin%20Setup"><strong>Plugin Documentation</strong></a> for the setup and locate the <strong>meta-data</strong> code snippet.</p><p>12. Copy it and scroll until you find the Advanced APK Packaging section. In the Extra Settings for Application section. Paste the code inside the text box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*8oWARtjoQFJbCOtjmAAZpw.png" /><figcaption>Codeible.com — Andoid Meta-data</figcaption></figure><blockquote>The App ID is a test id, so you’ll need to place your own approved AdMob App id for your own ads.</blockquote><p>Now you’re ready to show ads on Android</p><h3>IOS Setup</h3><ol><li>Now for iOS, create a new iOS app on Firebase.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*kIUIE3_ihote7h8lzozbNA.png" /><figcaption>Codeible.con — IOS Create</figcaption></figure><p>2. Put the <strong>Bundle ID</strong> for your app.</p><blockquote>Make sure it matches the bundle id you have on Apple Developer and Unreal Engine.</blockquote><blockquote>For testing, use this package name <strong>com.ue.admob.blueprint.plugin</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*EfSlhyhMmp-t4stXAegtvQ.png" /><figcaption>Codeible.com — IOS Bundle ID</figcaption></figure><p>3. Click on Register app to start the app creation.</p><p>4. Click on <strong>Download GoogleService-info.plist</strong> and download the plist file and keep clicking next until you reach the last step.</p><p>5. Click on <strong>Continue to console</strong> to complete the process.</p><p>6. Locate your Unreal Engine project and put the <strong>googleservices-info.plist</strong> file into the root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*wnCMRN9wFgi-Z8Y5KN6dVw.png" /><figcaption>Codeible.com — IOS Root</figcaption></figure><p>7. Now open your unreal engine app and open the Plugins window. Search for Admob Blueprint and add it to your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*Xjf0x_jSxONDptWucw5fyQ.png" /><figcaption>Codeible.com — IOS Plugin</figcaption></figure><p>8. Once you have the plugin installed, open the Project Settings window, and look for the iOS menu on the left under Platforms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*MHKOY6ss80hA2FmXmUZc4Q.png" /><figcaption>Codeible.com — IOS Platform</figcaption></figure><p>9. Change the Bundle Identifier to match the one in Apple Developer and Firebase. Then select your provisions and certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*OMzn5FAt3CoKqWmcidkxFQ.png" /><figcaption>Codeible.com — IOS Bundle Id</figcaption></figure><p>10. Scroll until you find the <strong>Additional Plist Data</strong> section and go to the plugin documentation for the setup. Scroll until you find the example plist info and copy it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zRs23-yJa7emmgCX4le4vA.png" /><figcaption>Codeible.com — Additional PLIST</figcaption></figure><h3>Creating Banner Ads</h3><ol><li>Open the level blueprint.</li><li>Call Event Begin Play and then initialize google mobile ads by using the Initialize Google Mobile Ads node.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*eSP3rm1fYWUJAj29nSDufA.png" /><figcaption>Codeible.com — GMA Init</figcaption></figure><blockquote>You’ll just need to initialize it once so you should do it in the Game Instance. For the tutorial, I’ll do it in the level blueprint.</blockquote><p>It has 2 callbacks. One will get executed when the initialization was successful and the other one gets executed when something failed.</p><p>3. Click and hold on to them, then drag on an empty spot. Select <strong>Add Event</strong>, then <strong>Add Custom Event</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*Td1jTiZuOYoORqps6CwkVw.png" /><figcaption>Codeible.com — Add Init Events</figcaption></figure><p>4. To create banner ads, use the Create Banner Ad node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*nkx2wpCo65cIzPQLicrqZw.png" /><figcaption>Codeible.com — Create Banner Ad</figcaption></figure><p>Then place the Ad Unit id from your Admob console. For testing, use this test Banner Ad id.</p><blockquote>ca-app-pub-3940256099942544/6300978111</blockquote><p>5. For the size, you can select from the list. Experiment with each to find the right size for your app.</p><p>6. For the position, you can choose from a list as well.</p><p>7. When you have your ad, use the Load Ad node to put ads into the banner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*DNYefO0NopZW4Z9T_Gzg-g.png" /><figcaption>Codeible.com — Load Ad Node</figcaption></figure><blockquote>Ads will automatically refresh so you do not need to keep using it to load new ads.</blockquote><p>It also has 2 callbacks, one for success and one for fail.</p><p>8. When ads are loaded, use the Show Ad node to display the ad.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*xr4d6RKIFvfc7CIMCLs9jw.png" /><figcaption>Codeible.com — Show Ad</figcaption></figure><p>There is only one callback for the node, so we’ll know if it failed.</p><p>Now when you launch your app on the phone, the ad should show.</p><h3>Creating Interstitial Ads</h3><p>The process is the same for interstitial ads.</p><ol><li>Instead of using Create Banner Ad, use the <strong>Create Interstitial Ad</strong> node.</li><li>Then put the interstitial Ad Unit Id from Admob.</li></ol><p>To testing, use this test ad id:</p><blockquote>ca-app-pub-3940256099942544/1033173712</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*yyks4--KRq0EPuxYvJQd5g.png" /><figcaption>Codeible.com — Interstitial Ad</figcaption></figure><p>That’s all for this tutorial. Thanks for reading.</p><p><a href="https://codeible.com/view/videotutorial/8k92mQRVWseK67IjfOMg;title=Google%20AdMob%20Blueprint%20Plugin%20Setup">Google AdMob Blueprint Plugin Setup</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cad75310692" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making a HTTP Request in Unreal Engine Blueprints using One Node]]></title>
            <link>https://medium.com/@Codeible/making-a-http-request-in-unreal-engine-blueprints-using-one-node-972b67f20347?source=rss-1a504610e589------2</link>
            <guid isPermaLink="false">https://medium.com/p/972b67f20347</guid>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[unreal-engine-4]]></category>
            <category><![CDATA[codeible]]></category>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[unreal-engine-5]]></category>
            <dc:creator><![CDATA[Codeible]]></dc:creator>
            <pubDate>Sun, 12 Mar 2023 01:26:23 GMT</pubDate>
            <atom:updated>2023-04-06T22:12:04.721Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, in this tutorial, I will show you how to make http requests in Unreal Engine using the <a href="https://unrealengine.com/marketplace/en-US/product/http-requests-for-blueprints">HTTP Requests for Blueprints plugin</a> with one node.</p><p><a href="https://codeible.com/view/videotutorial/l3YmQNogvPWK2zhtkzXM;title=Converting%20the%20Response%20into%20a%20JSON%20Object">Converting the Response into a JSON Object — Codeible</a></p><p>Follow on Twitter: <a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fcodeible.com%2F&amp;ref_src=twsrc%5Etfw&amp;region=follow_link&amp;screen_name=KingWaiMark&amp;tw_p=followbutton">Codeible (@codeible) / Twitter</a>.</p><h3><strong>Make a HTTP Request</strong></h3><p>To make HTTP requests, use the Make a HTTP Request node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*R1n5lOVHI8PxJFAAUdxEbw.png" /></figure><p>Then select the request method you want from the drop-down menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*ATUXec3n4swvX-b6mHM8vg.png" /></figure><p>Enter the URL for the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*6F5TGJMpPWPEGtGehvbmEg.png" /></figure><h3><strong>Add Query Parameters</strong></h3><p>Set the query parameters if your request requires them.</p><blockquote>Click and hold on the Params pin, then drag on an empty spot. Search for Make Map and select it in the menu.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*kNKtF9kJ8Sd7d7dn40lD4g.png" /></figure><blockquote>If your request does not require any parameters, right click on the key, then remove it so you have an empty map.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*y9nnUUbYP-36y0-Xp39F_g.png" /><figcaption>img — Make A HTTP Request params map empty</figcaption></figure><p>If you need parameters, add it to the map.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*TVeSmTY3bRIR33i1O8ODjQ.png" /><figcaption>img — Make A HTTP Request params filled</figcaption></figure><h3><strong>Adding Headers</strong></h3><p>For the headers, it is the same. Click and hold on it, then drag on an empty spot. Search for Make Map. Then select it in the menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*s-AdIy0DyrrkBtHqYcylhQ.png" /><figcaption>img — Make A HTTP Request Headers Make Map</figcaption></figure><blockquote>If no headers are needed, delete the key for the empty map. If you need headers, add it to the map.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*SFg6MTsLrHjx1V4wYsTsmw.png" /><figcaption>img — Make A HTTP Request headers map</figcaption></figure><h3><strong>Add Data</strong></h3><p>If you need to send data with the request, add them to the Body pin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*3zX6C-Gf_nvYnYVZLijCyg.png" /><figcaption>img — Make A HTTP Request Add Data</figcaption></figure><h3><strong>Add the Callback</strong></h3><p>The callback is a function that gets executed when the request is completed.</p><p>Click and hold on the pin and drag on an empty spot.</p><p>Select Add Event, then Add Custom Event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*w9Gm5xcUC5gC5xvZowyIbw.png" /><figcaption>img — Make A HTTP Request Add Callback</figcaption></figure><p>It returns a status code which specifies if the request is successful or not.</p><p>The response string is the response returned from the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*B0nm5dWfP1wJ1FMlz2bcDw.png" /><figcaption>img — Make A HTTP Request callback added</figcaption></figure><h3><strong>Converting the Response into a JSON</strong></h3><p>To convert the Response String from the Make a HTTP Request node into a JSON object, make sure that the string is a JSON object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*pZ-uHeD8vIjX_OvKYYF7ag.png" /><figcaption>img — Make A HTTP Request response string</figcaption></figure><p>Use the To JSON node and connect the Response String.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*IcRgE1wPpIi6nCrpWsEMFQ.png" /><figcaption>img — Make A HTTP Request OnComplete Callback</figcaption></figure><p>It returns a JSON object that we can then use any of these Get Nodes to get the data from the object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*rMyvH-771WQhuMIjEuE84A.png" /><figcaption>img — Make A HTTP Request Headers Get nodes</figcaption></figure><h3><strong>Extracting the contents</strong></h3><p>Take a look at the example JSON string from the response:</p><pre>{<br>&quot;purchaseToken&quot;:&quot;some-token-value&quot;,<br>&quot;orderId&quot;:&quot;abc123&quot;,<br>&quot;purchaseTime&quot;:&quot;6&quot;,<br>&quot;isValid&quot;:false<br>}</pre><p>The <strong>purchaseToken </strong>and <strong>orderId </strong>is a string, the <strong>purchaseTime </strong>time is most likely a number, and <strong>isValid </strong>is a boolean.</p><p>To get the purchaseToken or orderId, use the <strong>Get String</strong> node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*qSZIeYHEJkiPntVEWL6ZSQ.png" /><figcaption>img — Make A HTTP Request get string</figcaption></figure><p>For the purchaseTime, use <strong>Get Number</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*IyFq4vlcX1Ig9ojOYz7BmQ.png" /><figcaption>img — Make A HTTP Request get number</figcaption></figure><p>For the boolean, use <strong>Get Boolean</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*esLME1K0v-thV0T1cTBiAw.png" /></figure><h3><strong>Nested JSONs</strong></h3><p>Sometimes your JSON object may contain another JSON or an array of them like this:</p><pre>{<br>&quot;purchaseToken&quot;:&quot;some-token-value&quot;,<br>&quot;orderId&quot;:&quot;abc123&quot;,<br>&quot;purchaseTime&quot;:&quot;6&quot;,<br>&quot;isValid&quot;:false,<br>&quot;contacts&quot;: [<br>  {<br>    &quot;name&quot;: &quot;Codeible&quot;,<br>    &quot;email&quot;: &quot;Codeible@ccodeible.com&quot;<br>  },<br>  {<br>    &quot;name&quot;: &quot;King&quot;,<br>    &quot;email&quot;: &quot;Codeible@ccodeible.com&quot;<br>  }<br>]<br>}</pre><p>To get them, use the <strong>Get Object</strong> or the <strong>Get Object Array</strong> nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*U3Fj6ilHBq53Y8izmlIpyA.png" /><figcaption>img — Make A HTTP Request Get Object</figcaption></figure><p>The <strong>contacts </strong>property is an array of JSON objects, so we need to use the <strong>Get Object Array</strong> node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*MUdtOuIFv-kEzX6UvVNKsA.png" /><figcaption>img — Make A HTTP Request Get Object Array</figcaption></figure><p>Once we have the array, we can use the For Each Loop node to iterate through all the Objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*xWcvnGq_jSxhxBTXZTRNDQ.png" /><figcaption>img — Make A HTTP Request Headers For Each Loop</figcaption></figure><p>The Array Element from the loop represents the JSON objects. We can then use the Get nodes to get the data from it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*RlK3Vev3q-p3W8hTBoy6fA.png" /></figure><p><a href="https://codeible.com/view/videotutorial/l3YmQNogvPWK2zhtkzXM;title=Converting%20the%20Response%20into%20a%20JSON%20Object">Converting the Response into a JSON Object — Codeible</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*NOaZeXHv0NKkv4QKj0792Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=972b67f20347" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unreal Engine Login System — 4.27, 5.0, 5.1]]></title>
            <link>https://medium.com/@Codeible/unreal-engine-login-system-4-27-5-0-5-1-b073d491bac?source=rss-1a504610e589------2</link>
            <guid isPermaLink="false">https://medium.com/p/b073d491bac</guid>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[codeible]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[unreal-engine-4]]></category>
            <category><![CDATA[unreal-engine-5]]></category>
            <dc:creator><![CDATA[Codeible]]></dc:creator>
            <pubDate>Mon, 26 Dec 2022 01:55:26 GMT</pubDate>
            <atom:updated>2023-07-18T12:20:40.433Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unreal Engine Login System — 4.27, 5.0, 5.1, 5.2</h3><p>Follow on Twitter: <a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fcodeible.com%2F&amp;ref_src=twsrc%5Etfw&amp;region=follow_link&amp;screen_name=KingWaiMark&amp;tw_p=followbutton">Codeible (@codeible) / Twitter</a>.</p><p>Hello, in this tutorial, I will show you how to create a Login system in Unreal Engine 5 using Firebase and the Firebase Blueprint Plugin Library.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FYOcfOJOMr_c%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DYOcfOJOMr_c&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FYOcfOJOMr_c%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/614671ed2cec95f1981a304fb25dda81/href">https://medium.com/media/614671ed2cec95f1981a304fb25dda81/href</a></iframe><p>Here’s what we’ll be doing.</p><p>When we start our app, there will be a simple login screen. We can reset our password, create an account, OR sign in.</p><h3>Prerequisites</h3><p>Before we begin, we need to setup a few things for Unreal Engine and Firebase.</p><ol><li>First download the <a href="https://www.youtube.com/redirect?event=video_description&amp;redir_token=QUFFLUhqa1VOVFlkY3lUbzR5TU15VVhOdm5tMHdHMEtOQXxBQ3Jtc0tsc3FIVU0za29UYWEyQTZBOHdROTktTlRENE1ZcmJSUzYxUW1BOVp6RVZZaEIzdE9yS3ZkbF80dTR3VWlJcm92Z0czZ3dKMHNaMmdUVUd6a0lQNnJRZk1pTzdhQVcyd1E2MExSOEZrT1ltQ1FEeFBTNA&amp;q=https%3A%2F%2Fcodeible.com%2Fcoursefiles%2Funrealengineloginsystem&amp;v=YOcfOJOMr_c">assets</a> I am using to follow along.</li><li>Then go to the Unreal Marketplace and install the <a href="https://www.youtube.com/redirect?event=video_description&amp;redir_token=QUFFLUhqa2lOa25aOVpsMHZZZUpveExqc1loaTlyNTdFQXxBQ3Jtc0tsRExjMHg1S3lDQmFDbWFlNVpTcWVmSzI4WmZXeDc3bUdnREtKcmZVbzJvNGJpUGpzTUNfcmw0YVhFMExQeUc0Q0ZMczB3VHJwaHdTVmRQcHdmeVJPNkNWV0VXN2RLR1FGdUNJdXZmRFl2a2lsYWJfQQ&amp;q=https%3A%2F%2Fwww.unrealengine.com%2Fmarketplace%2Fen-US%2Fproduct%2Ffirebase-blueprint-plugin-library&amp;v=YOcfOJOMr_c">Firebase Blueprint Plugin</a> for Unreal Engine.</li><li>Now go to <a href="https://console.firebase.google.com/">console.firebase.google.com</a> and sign in with a Gmail account. We’ll use Firebase to store the users’ account information.</li><li>Add a new project and name it whatever you want.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*Txw2KWITsQ3x0Vwji22g5Q.png" /><figcaption>Firebase Add Project</figcaption></figure><p>5. Inside the console. Expand the “Build” tab and select Authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*CAO3ZLv0X9mmvlF7i-jtPQ.png" /><figcaption>Firebase Console Authentication</figcaption></figure><p>6. Click on “Get started” and enable the Email and Password sign in method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c7euURzgRV5PdC9EU13aTQ.png" /><figcaption>firebase_console_auth_email_enable</figcaption></figure><p>7. Click on the “Build” tab again and select Realtime Database.</p><p>8. Click on “Create Database” and proceed to complete the steps.</p><blockquote>Once Authentication and Realtime Database is ready, we’ll need to download the Google Services file for this Firebase project so we can connect to it using the plugin.</blockquote><p>9. Click on the Gear icon and select Project Settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*c04LKE1dPChwTSx2rODuBw.png" /><figcaption>firebase_console_project_settings_gear</figcaption></figure><p>10. Scroll down to the “Your apps” section and create an Android project if you are using Windows. For Mac users, create an iOS app instead.</p><p>11. Insert a name for the package, then click on Register app.</p><p>12. Download the google-services file and then click next until you reach the last step.</p><p>13. Click on Continue to console to complete the process.</p><p>14. Now that the setup for Firebase is completed, create a new Unreal Engine project.</p><p>15. Open the Plugins Menu and search for FBP.</p><p>16. Enable it and restart the project.</p><p>17. Locate the Google-Services file that you downloaded earlier and move it to the Unreal Engine project folder. The file will be used by the Plugin to connect with your Firebase project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/154/1*t5MIE0b80YeAiEEnUsYxew.png" /><figcaption>unreal_engine_root_folder</figcaption></figure><p>That’s all for the setup, we can start building the UI for our login screen.</p><h3>Plugin Information</h3><p>Setup Video: <a href="https://www.youtube.com/watch?v=CH0p2kNH99s">https://www.youtube.com/watch?v=CH0p2kNH99s</a></p><p><strong>View YouTube Playlist here (On Going):</strong> <a href="https://www.youtube.com/playlist?list=PLfamdLYuDv-Kx7ueWqTnePBW0xS8nvnpG">Unreal Engine 5 — Firebase Blueprint Plugin Library — YouTube</a></p><p><strong>Plugin URL: </strong><a href="https://www.unrealengine.com/marketplace/en-US/product/firebase-blueprint-plugin-library">Firebase Blueprint Plugin Library in Code Plugins — UE Marketplace (unrealengine.com)</a></p><h3>Creating the UI</h3><p>We’ll create all the components for the UI first and then I’ll explain what we’ll do with them after.</p><ol><li>In the Content Drawer, create a Game Instance call App_Instance.</li><li>Then Create a new Level and call it Login_Level.</li><li>Create 4 blank widgets.</li><li>Call one Login_Page. Another call Reset_Password_Page. The 3rd Create_Account_Page, and the last 1 Game_Widget.</li><li>Now Import all the images from the assets folder.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*HW5kMKHEH3PLxFhRCi4k5g.png" /><figcaption>unreal_ui_components</figcaption></figure><p>We’ll use the App_Instance to handle the login state changes and navigate the user to different screens based on whether they logged in or not. If they are logged in, the game screen should show up, otherwise the login scren should be active.</p><p>3 of the widgets represent the 3 different UI for the login screen and the Game_Widget is for the game so we can log out.</p><h3>App_Instance Blueprint</h3><p>Now open the App_Instance blueprint.</p><p>Add the “Event Init” node and then call “Listen For Sign In Changes” from the plugin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*hXG9vC1BW3eq_B4gk8fC0g.png" /></figure><p>Click and hold on the On Signed In callback pin and drag on an empty spot on the Blueprint. Select “Add Event” then “Add Custom Event.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*4di1KW28Rkik-uWIoBgGIQ.png" /></figure><p>Do the same for On Signed Out as well.</p><blockquote>We’re listening to the Sign In states in the Game Instance because when the game starts, it will execute the Event Init node and then attach a listener that’ll detect whether someone signed in or out of the app.</blockquote><blockquote>Another reason why it is done in the Game Instance is because it’ll remain active throughout the lifecycle of your app. This way, we can direct the user to different screens based on their login states.</blockquote><p>To test this, add 2 Open Level by Object Reference nodes and connect them to the callbacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*0AK881B0GfCSgOplEsHCkg.png" /></figure><p>For On Signed In, we want to display the default level since that’s our game. For On Signed Out, use the Login_Level.</p><p>Compile, save, and go to the Project Settings under the Edit menu.</p><p>Select the Maps &amp; Modes menu and scroll down until you see the section for Game Instance. In the Game Instance Class dropdown, select the App_Instance blueprint that we created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*e_aCMjoWsAJI4m8I4r1cSA.png" /><figcaption>game_instance_dropdown</figcaption></figure><p>Close the menu, and and then run the app. We should see a black screen since we did not add anything to the Login_Level.</p><h3>Login Level Blueprint</h3><p>Open the Login_Level Blueprint.</p><p>Add the Event Begin Play node. Then grab the Player Controller and call Set Show Mouse Cursor. This’ll allow us to see the mouse cursor so we can interact with the login page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*477bCzt6JxXUbPqAfP3xRw.png" /></figure><p>After that, use the Create Widget node and add it to the View Port. Inside the Create Widget node, click on the drop down menu and select the Login_Page widget.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*HvejZNh_YsoGsm4E0ZUD9A.png" /></figure><p>Compile, save, and run the app to see if everything is working. Since our widget is empty, we’ll still see a black screen.</p><p>Let’s add some content to it.</p><p>In the Content Drawer, open the Login_Page widget.</p><p>In the Palette, add a Canvas and set the size to 1280 x 720.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/187/1*ESY9PAAI2Td4LvtZ2ihf0g.png" /></figure><p>Go back to the Palette and place image for the login page inside the canvas. Set the Anchor to use the 4 corners and then set all the offset to 0 to fill the screen. Once the image is resized, set the anchor to the center.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*7iHjB6VCkUBAZmn-ZbL06A.png" /></figure><p>If we compile, save and run the app, it’ll no longer show a black screen. All we need now is to add the text fields and buttons for the UI.</p><p>In the palette, add 2 Editable Text objects and resize them to fit the image. Rename the top input box to email_input, and set the anchor to the center. Then set the Hint Text to Email. Change the font size to 27 and color to black.</p><p>For the 2nd input, rename it to password_input and use the same values for the font size,color, and Anchor. Set the Hint Text to Password and enable the Is Password appearance.</p><p>For the buttons add a long 1 underneath the password input. Then add 2 smaller ones under the long button. Make sure to anchor all the buttons to the center.</p><p>Rename the long one, login_button, the small one on the left to reset_button, and the one on the right to create_button.</p><p>Now drag a Text object into each of the buttons to label them. The long one is Login. The one on the left is Reset, and the one on the right is Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*Iaay1M23TFdk03l8AWcazQ.png" /></figure><p>Compile, save, and run the app again to make sure it is still working.</p><p>Now, we’ll do the same for the Reset_Password_Page.</p><h3>Reset Password Widget</h3><p>In the Content Drawer, open the Reset_Password_Page widget.</p><p>Add a canvas and make sure the size is 1280 x 720.</p><p>Then add the Reset_Password_Page image.</p><p>Add an Editable Text field and set its font-size to 27 and color to black. Set the hint to Email and name to email_input.</p><p>Add 2 buttons underneath the input box.</p><p>Label the button on the top to Reset and name it to reset_button. Then set the label to Cancel for the one at the bottom and rename it cancel_button.</p><p>We’ll also need to anchor all the elements to the center as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*vHz0pVtOnroq2lj4Ix80Vg.png" /></figure><p>That’s all for the Reset page. We just need to do one more widget for the login screen.</p><h3>Create Account Widget</h3><p>Open the Create_Account_Page widget. Then add the canvas and image for it. Fill the page to make it look like mine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*tps9htQgDxsRp5EF267Qhw.png" /></figure><p>Rename the email input to email_input, the password input to password_input, the cancel button to cancel_button, and the create button to create_button.</p><p>Make sure all the elements are anchor to the center.</p><p>That’s all for the login screen widgets, we can begin working on the logic and connect everything. We’ll start by adding a click event to the Create button in the login page so we can click on it to display the Create_Account_Page.</p><p>Compile and save the changes.</p><h3>Displaying the Create Account Widget</h3><p>Open the Login_Page widget blueprint and go to the Graph. Grab a reference to the Create Button and bind it with a On Click event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*AmhxSRsasQz4K_aSaxtpqw.png" /></figure><p>Then use the Create Widget node to create the Create_Account_Page widget and add it to the Viewport when we click on the button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*FV-BBARz7qEaXSh9Know2A.png" /></figure><p>Compile, save, and run the app. If we click on the create button now, the Create_Account_Page should appear.</p><h3>Create Account Logic with the Firebase Blueprint Plugin Library</h3><p>Now go into the Create_Account_Page widget graph. Grab a reference to the Create button then bind it with a On Click event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*HAWyxOVigjCrdRII_boRzw.png" /></figure><p>To create an account, use the <strong>Create Account with Email and Password</strong> node from the Firebase Blueprint Plugin. Then grab a reference to the Email and Password inputs and connect the values with the pins in the node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*P80Bbc9OSi9NrOLvemCS2w.png" /></figure><p>To create the callbacks, click and hold on the pin, then drag on an empty spot. Select “Add Event” then “Add Custom Event.”</p><p>For the On Success callback, print out a message telling us that the account is successfully created. For On Fail, print out the error message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*kE-TrsLdiUVXHWX2IYHNrA.png" /></figure><p>If we compile, save, and run the app, we should be able to use the Create_Account_Page to create the account.</p><p>Navigate to the Create_Account_Page, then enter an email and password. If we click Create, we should get a message telling us that the account is created, and the screen will change since it automatically logs us in when the account is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/167/1*07SqYlA9VM6lVS2dmKy-vA.png" /></figure><p>If we restart the app, you can see that the game screen will be shown. That’s because the login session is saved when we sign in, so we need to log out to go back to the login screen.</p><h3>Logging Out</h3><p>Open the Content Drawer and go into the Game_Widget. Add canvas and a button. Then label it Logout and rename it to logout_button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*0OaPMSRXlgbEapsVdcA9VA.png" /></figure><p>Compile, save, and open the Default game blueprint.</p><p>Add the <strong>Event Begin Play</strong> node and get the player controller. Then set Show Cursor to true so we can interact with the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*V1wDn_Ft5F8C9rNStnemXQ.png" /></figure><p>Now add the Game_Widget to the view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*W3cBaKisEx1VKSFnZmo9vw.png" /></figure><p>Compile, save, and run the app. The logout button should appear.</p><p>Go back to the Game_Widget Graph and grab a reference to the logout button. Then add a click event to it and call the Sign Out node from the plugin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*Q4CmAGllfFvHOKZsz9xORw.png" /></figure><p>If we compile, save, run the app again and click on the Logout button, the login screen should appear.</p><h3>Logging In</h3><p>Now that we have an account, we can define the logic to sign in. Go back to the Login_Page widget graph.</p><p>Grab a reference to the login_button and attach a click event to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*vPS8Cf5ees67ilez4OYWmQ.png" /></figure><p>Now call the <strong>Sign In With Email and Password</strong> node and add the callbacks.</p><p>For the email and password, we’ll use the values from the inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*21gcstYxbICWcAN3mePtqA.png" /></figure><p>Compile, save, and run the app.</p><p>If we enter the credentials for the account and hit the Login button, we should transition to the Game screen. Now let’s put in the logic to reset the account password.</p><h3>Reset Password</h3><p>Open the Reset_Password_Page widget and go to the Graph.</p><p>Grab a reference to the Reset button. Then add a click event to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*q-104N4euSKO-hO66Vw9Ng.png" /></figure><p>To reset the password, call the Send Password Reset Email.</p><p>Add the callbacks and pass in the text from the email_input textbox.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*SBCJoxOw1fOeNuPHvtRy3Q.png" /></figure><p>Compile and save the changes.</p><p>Go back to the Login_Page widget and get the reference to the reset button. Add a click event to it.</p><p>Then call <strong>Create Widget</strong> and create the <strong>Reset_Password_Page</strong> widget. Lastly, add it to the viewport.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*i1l0-9P9Fh5ftHBjPhKglA.png" /></figure><p>Compile, save, and run the app.</p><p>Navigate to the Reset password page and enter the email for the account.</p><p>If we click on the reset button, we should get an email with instructions to reset the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*w34tEpQYBaOUplTxWvJT1A.png" /></figure><p>That’s all for the login system portion of the tutorial. Thanks for reading.</p><h3>Cleaning Up</h3><p>For the last section, we’ll add the logic to cancel each page so we can go back if we do not want to do anything.</p><p>Go to the <strong>Create_Account_Page </strong>Graph. Grab a reference to the Cancel button and add a click event to it.</p><p>To go back, just use the <strong>Remove from Parent</strong> node. Compile and save the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*Rr0iWDa4aNFsAS0QbkNBSA.png" /><figcaption>Create_Account_Page Widget remove from parent</figcaption></figure><p>Now go to the <strong>Reset_Password_Page</strong> widget graph and do the same. Get the reference to the cancel button. Add click event. Call <strong>Remove from Parent</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*Rr0iWDa4aNFsAS0QbkNBSA.png" /><figcaption>Reset_Password_Page widget remove from parent</figcaption></figure><p>Compile, save, and run the app.</p><p>If we navigate to the Create account page and hit cancel, we’ll go back. Now navigate to the Reset Password page and hit cancel, it’ll go back as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uk-CqIUSlM7z6mm147XUZg.png" /><figcaption>Thumbnail — Codeible.com</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b073d491bac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase Blueprint Plugin Library for Unreal Engine 4.27, 5.0, 5.1]]></title>
            <link>https://medium.com/@Codeible/firebase-blueprint-plugin-library-for-unreal-engine-5-780d0ddcb304?source=rss-1a504610e589------2</link>
            <guid isPermaLink="false">https://medium.com/p/780d0ddcb304</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[firebase-plugin]]></category>
            <category><![CDATA[unreal-engine-5]]></category>
            <category><![CDATA[codeible]]></category>
            <category><![CDATA[firebase-unreal-engine]]></category>
            <dc:creator><![CDATA[Codeible]]></dc:creator>
            <pubDate>Sun, 30 Oct 2022 01:03:28 GMT</pubDate>
            <atom:updated>2023-04-11T02:02:33.857Z</atom:updated>
            <content:encoded><![CDATA[<p>Follow on Twitter: <a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fcodeible.com%2F&amp;ref_src=twsrc%5Etfw&amp;region=follow_link&amp;screen_name=KingWaiMark&amp;tw_p=followbutton">Codeible (@codeible) / Twitter</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*653rI4bQYgIJahCyI31rGQ.jpeg" /><figcaption>Firebase Blueprint Plugin Library</figcaption></figure><p>Hello, the Firebase Blueprint Plugin Library is now available for Unreal Engine 5.</p><p>Setup Video: <a href="https://www.youtube.com/watch?v=CH0p2kNH99s">https://www.youtube.com/watch?v=CH0p2kNH99s</a></p><p><strong>View YouTube Playlist here (On Going):</strong> <a href="https://www.youtube.com/playlist?list=PLfamdLYuDv-Kx7ueWqTnePBW0xS8nvnpG">Unreal Engine 5 — Firebase Blueprint Plugin Library — YouTube</a></p><p><strong>Plugin URL: </strong><a href="https://www.unrealengine.com/marketplace/en-US/product/firebase-blueprint-plugin-library">Firebase Blueprint Plugin Library in Code Plugins — UE Marketplace (unrealengine.com)</a></p><p>Documentation on <a href="https://codeible.com/view/videotutorial/MghD5KMFo7hLKvsHTug7">Codeible</a>.</p><p>Currently Support Features:</p><h3>Firebase Plugin for Unreal Engine</h3><p>Add the plugin to use Firebase features in your app.</p><p>Setup tutorial at <a href="https://codeible.com/view/videotutorial/MghD5KMFo7hLKvsHTug7">Codeible</a>.</p><p>See Packaging your Project tutorial <a href="https://codeible.com/view/videotutorial/MghD5KMFo7hLKvsHTug7;title=Packaging%20your%20Project">here</a>.</p><p>Follow on Twitter: <a href="https://twitter.com/KingWaiMark">Codeible (@codeible) / Twitte</a><a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fcodeible.com%2F&amp;ref_src=twsrc%5Etfw&amp;region=follow_link&amp;screen_name=KingWaiMark&amp;tw_p=followbutton">r</a>.</p><h3>Authentication</h3><h4>(Windows, Mac, Android, IOS)</h4><ul><li>Anonymous Sign In</li><li>Email &amp; Password Sign In</li><li>Account Creation with Email &amp; Password</li><li>Send Password Reset Email</li><li>Send Verification Email</li><li>Sign In State Handling (Sign In, Sign Out, Email Verified)</li></ul><h3>Cloud Storage</h3><h4>[ Mac, Android, IOS)</h4><ul><li>Download File</li><li>Upload File</li><li>Delete File</li></ul><h3>Realtime Database</h3><h4>(Windows, Mac, Android, IOS)</h4><ul><li>Add Data</li><li>Update Data</li><li>Delete Data</li><li>Get Data</li><li>Listen to Data</li></ul><p>Supported Data Types</p><ul><li>Integer</li><li>Float</li><li>String</li><li>Boolean</li><li>Array for [String, Integer, Float, Boolean] (Add)</li><li>Array for [String, Integer, Float, Boolean] (Get)</li><li>Map (Add &amp; Get)</li></ul><h3>Firestore</h3><h4>(Windows, Android, IOS, Mac Editor)</h4><p>[Engine V5.0, 5.1]</p><h4>( Android, IOS, Window Editor, Mac Editor)</h4><p>[Engine V4.27 ]</p><ul><li>Add Documents</li><li>Update Documents</li><li>Delete Documents</li><li>Get Documents</li><li>Get Collections</li><li>Listening to Document Changes</li><li>Listening to Collection Changes</li><li>Queries</li><li>WhereEqualTo [String, Boolean, Number]</li><li>WhereNotEqualTo [String, Boolean, Number]</li><li>WhereGreaterThan [String, Number]</li><li>WhereLessThan [String, Number]</li><li>WhereGreaterThanOrEqualTo [String, Number]</li><li>WhereLessThanOrEqualTo [String, Number]</li><li>OrderBy</li><li>Limit</li></ul><p>Supported Data Types</p><ul><li>Integer</li><li>Float</li><li>String</li><li>Boolean</li><li>Array for [String, Integer, Float, Boolean] (Add)</li><li>Array for [String, Integer, Float, Boolean] (Get)</li><li>Map (Add &amp; Get)</li></ul><h3>Analytics</h3><h4>(Android, IOS)</h4><ul><li>Log events [String, Integer, Floats, Multi-Parameters (String, Integer, Floats)]</li><li>User Parameters</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=780d0ddcb304" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding, Loading, and Using JavaScript in Angular]]></title>
            <link>https://medium.com/@Codeible/adding-loading-and-using-javascript-in-angular-3281ea4b056b?source=rss-1a504610e589------2</link>
            <guid isPermaLink="false">https://medium.com/p/3281ea4b056b</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[google-play]]></category>
            <category><![CDATA[codeible]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Codeible]]></dc:creator>
            <pubDate>Mon, 26 Sep 2022 12:27:53 GMT</pubDate>
            <atom:updated>2023-04-06T22:03:56.622Z</atom:updated>
            <content:encoded><![CDATA[<p>Learn how to load and use JavaScript code inside your Angular project</p><p>Follow on Twitter: <a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fcodeible.com%2F&amp;ref_src=twsrc%5Etfw&amp;region=follow_link&amp;screen_name=KingWaiMark&amp;tw_p=followbutton">Codeible (@codeible) / Twitter</a>.</p><p>View article on <a href="https://codeible.com/view/videotutorial/RPeL7Rnim8LCYxZJa2Dz;title=Loading%20and%20Using%20JavaScript%20in%20Angular">Codeible.com</a>.</p><p><a href="https://codeible.com/view/videotutorial/RPeL7Rnim8LCYxZJa2Dz;title=Loading%20and%20Using%20JavaScript%20in%20Angular">Loading and Using JavaScript in Angular</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fk6o8H4YMwGE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dk6o8H4YMwGE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fk6o8H4YMwGE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a3d6d4d4f69d81ff63764f7dec0c3e8/href">https://medium.com/media/0a3d6d4d4f69d81ff63764f7dec0c3e8/href</a></iframe><p>Hello, in this tutorial, you will learn how to load and use JavaScript code inside your Angular project.</p><h3>Adding JavaScript files to your project</h3><p>To add JavaScript files, locate the files on your computer and place them inside the assets folder of the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*9ummxVYtkTIGrdMoGfEy4g.jpeg" /><figcaption>Copying JavaScript Files to Angular Project</figcaption></figure><p>Next, open the angular.json file and locate the scripts property inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*VP0iCLPwBhcCJ624jHN_PQ.jpeg" /><figcaption>Angular.json scrips property</figcaption></figure><p>In here, place the path of each JavaScript file you want to load into the array.</p><p>You can right click on the file in the explorer pane to get the path of the document and paste each path inside the array.</p><p>Remember to change the backward slashes into forward slashes.</p><pre>&quot;scripts&quot;: [</pre><pre>   &quot;src/assets/ExampleJS1.js&quot;</pre><pre>]</pre><p>The assets folder is inside the src folder so we do “src/assets/” and the name of our file.</p><p>When we run our app, it will load and execute the code in JavaScript files.</p><p>Here is what is inside the ExampleJS1.js file:</p><pre>function greet(){</pre><pre>   alert(&quot;Hello&quot;);</pre><pre>}</pre><pre>alert(&quot;Pop up&quot;);</pre><p>Result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*9x_F7alD9XyV5ARZ7hSaow.jpeg" /><figcaption>Results from JS file</figcaption></figure><h3>Using Functions in the JS File</h3><p>To use the functions or variables in the JavaScript files, declare a reference in a TypeScript file by typing declare and then the variable or function you want to reference.</p><pre>import { Component } from &#39;..&#39;</pre><pre><strong>declare function greet(): void;</strong></pre><pre>@Component({</pre><pre>   ....</pre><pre>})</pre><pre>export class AppCompoent {</pre><pre>}</pre><p>Then call it in the code.</p><pre>import { Component } from &#39;..&#39;</pre><pre><strong>declare function greet(): void;</strong></pre><pre>@Component({</pre><pre>....</pre><pre>})</pre><pre>export class AppCompoent {</pre><pre>   constructor(){</pre><pre><strong>      greet();</strong></pre><pre>   }</pre><pre>}</pre><h3>Using CDNs</h3><p>If you have a CDN or a link to an online repository for the JavaScript file, you can just put script tags in the index.html page to load your files.</p><pre>&lt;!doctype html&gt;</pre><pre>&lt;html lang=&quot;en&quot;&gt;</pre><pre>&lt;head&gt;</pre><pre>   <strong>&lt;script src=&quot;...&quot;&gt;&lt;/script&gt;</strong></pre><pre>&lt;/head&gt;</pre><pre>&lt;body&gt;</pre><pre>&lt;app-root&gt;&lt;/app-root&gt;</pre><pre>&lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><p>However, you cannot add script elements in the html page of your components.</p><p>To do load JavaScript files in a component, you have to do it manually inside the TypeScript file.</p><p>Go into the app component TypeScript file and create a script element object.</p><p>Then set the value of the src property to the path of the JavaScript file you want to load. This can be a URL or a local path in the project.</p><p>Lastly, add the script element to the body of the HTML page.</p><pre>import { Component } from &#39;..&#39;</pre><pre><strong>declare function greet(): void;</strong></pre><pre>@Component({</pre><pre>   ....</pre><pre>})</pre><pre>export class AppCompoent {</pre><pre><strong>myScriptElement: HTMLScriptElement;</strong></pre><pre>   constructor(){</pre><pre><strong>      greet();</strong></pre><pre><strong>      this.myScriptElement = document.createElement(&quot;script&quot;);</strong></pre><pre><strong>      this.myScriptElement.src = &quot;.....&quot;;</strong></pre><pre><strong>      document.body.appendChild(this.myScriptElement);</strong></pre><pre>   }</pre><pre>}</pre><h3>Recommended:</h3><p>Download and try a New Auto Clicker / Click Assistant app in Google Play Store:</p><p><a href="https://play.google.com/store/apps/details?id=com.loopclicker.app">Loop Clicker — Apps on Google Play</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3EM750BxcTIy9mKk37eAw.png" /><figcaption>Loop Clicker</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*asa5Nhz6-bTDIEKBLPq68A.jpeg" /><figcaption>Thumbnail</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3281ea4b056b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Loop Clicker — An New Auto Clicker app on Google Play]]></title>
            <link>https://medium.com/@Codeible/loop-clicker-an-new-auto-clicker-app-on-google-play-bc41ecaa8f03?source=rss-1a504610e589------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc41ecaa8f03</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[codeible]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Codeible]]></dc:creator>
            <pubDate>Thu, 15 Sep 2022 20:01:15 GMT</pubDate>
            <atom:updated>2023-04-06T22:11:03.368Z</atom:updated>
            <content:encoded><![CDATA[<h3>Loop Clicker — An New Auto Clicker app on Google Play</h3><p>Follow on Twitter: <a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fcodeible.com%2F&amp;ref_src=twsrc%5Etfw&amp;region=follow_link&amp;screen_name=KingWaiMark&amp;tw_p=followbutton">Codeible (@codeible) / Twitter</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcDVP7-v0BsM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcDVP7-v0BsM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcDVP7-v0BsM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/651f587a5ba89093954cc7dc95920afa/href">https://medium.com/media/651f587a5ba89093954cc7dc95920afa/href</a></iframe><p>Hi please check out an new Android app on Google Play and leave a feedback! Thank you for your time!</p><p>Helps you perform clicks and swipe actions on the screen.</p><p>Easy-to-use interface.</p><p>Customizable settings for each action!</p><p>Hope you find the app useful!</p><p>Get on <a href="https://play.google.com/store/apps/details?id=com.loopclicker.app">Google Play</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*XgbHHqBFrhTqzfO2vrjtGg.png" /><figcaption>Loop Clicker Logo</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc41ecaa8f03" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swipe or Slide and Drag and Drop items in RecyclerView]]></title>
            <link>https://medium.com/@Codeible/swipe-or-slide-and-drag-and-drop-items-in-recyclerview-6dbe4871f87?source=rss-1a504610e589------2</link>
            <guid isPermaLink="false">https://medium.com/p/6dbe4871f87</guid>
            <category><![CDATA[codeible]]></category>
            <category><![CDATA[android-app-developers]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Codeible]]></dc:creator>
            <pubDate>Thu, 25 Aug 2022 12:44:39 GMT</pubDate>
            <atom:updated>2023-04-06T22:10:30.632Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, in this tutorial, I’ll be showing you how to add swipe and drag gesture events to a RecyclerView.</p><p>Follow on Twitter: <a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fcodeible.com%2F&amp;ref_src=twsrc%5Etfw&amp;region=follow_link&amp;screen_name=KingWaiMark&amp;tw_p=followbutton">Codeible (@codeible) / Twitter</a>.</p><p><a href="https://codeible.com/view/videotutorial/fU37QIkkGTqBnJ5BCMgm;title=Adding%20Swipe%20and%20Drag%20Gestures%20Events%20to%20RecyclerViews">Adding Swipe and Drag Gestures Events to RecyclerViews</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fyua1exHtFB4&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dyua1exHtFB4&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2Fyua1exHtFB4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec6a2526aae16e54b9942cfa6f5b8f2a/href">https://medium.com/media/ec6a2526aae16e54b9942cfa6f5b8f2a/href</a></iframe><h4>Download Sample Project to Follow Along</h4><p>Before we begin, you’ll need to have a RecyclerView ready, and populated with some views.</p><p>You can download the project I am using for this tutorial by <a href="https://codeible.com/coursefiles/swipe4recyclerview">clicking here</a>.</p><h4>Intro</h4><p>To add swipe and drag events to a RecyclerView, we need the help of the ItemTouchHelper class, and Callback from ItemTouchHelper.</p><p>The ItemTouchHelper help us connect touch events to a RecyclerView and activate the Callback class to handle what happens when a swipe or drag event occur.</p><h4>Adding Swipe/Slide</h4><p>In the MainActivity where the RecyclerView is, create a new ItemTouchHelper object inside the onCreate() method. Then pass in a new Callback object.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/df60234975bf79eabe0f23706878ae19/href">https://medium.com/media/df60234975bf79eabe0f23706878ae19/href</a></iframe><p>There are 3 methods that are automatically implemented.</p><p>The <strong>getMovementFlags</strong>() method is used to tell the helper what directions we want to support for our swipe or drag gestures.</p><p>Zero (0) means nothing so we will not be able to move anything. If we run the app, we will not be able to swipe or drag.</p><p>To enable the events, add the helper to the RecyclerView using the <strong>attachToRecyclerView </strong>() method from the helper.</p><pre>helper.attachToRecyclerView(recyclerView);</pre><p>Replace <strong>0</strong> with makeMovementFlags() in getMovementFlags().</p><pre>@Override<br>public int getMovementFlags(<br>@NonNull RecyclerView recyclerView,<br>@NonNull RecyclerView.ViewHolder viewHolder) {<br>      return makeMovementFlags();<br>}</pre><p>It takes 2 arguments. One for the drag flags and another for the swipe flags. These flags determine the direction we support.</p><p>Put 0 for the drag flags for now.</p><pre>return makeMovementFlags(0, );</pre><p>To allow swiping from the left, pass ItemTouchHelper.END in the second argument.</p><pre>return makeMovementFlags(<br>   0, <br>   ItemTouchHelper.END<br>);</pre><p>If we run the app, we will be able to swipe from left to right. If we try to swipe from right to left, nothing happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*_YtMCPUqgv4LRFmyrHtz4g.gif" /><figcaption>Left To Right Swipe</figcaption></figure><h4>Muti-Direction Support</h4><p>To allow multiple directions, separate each direction with the <strong>pipe </strong>symbol.</p><pre>ItemTouchHelper.<em>END </em>| </pre><p>Enable right to left movement by passing in START.</p><pre>ItemTouchHelper.<em>END </em>| ItemTouchHelper.<em>START</em></pre><p>Restart the app and we’ll be able to swipe from both directions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*LlOFjo2kAqldR1OdpbDTKQ.gif" /><figcaption>Both directional Swipe Demo</figcaption></figure><h4>Enable Dragging</h4><p>To enable dragging, the same method is used.</p><p>If we look at the <a href="https://developer.android.com/reference/androidx/recyclerview/widget/ItemTouchHelper#DOWN">documentation</a>, the directions we can use are DOWN, END, LEFT, RIGHT, START and UP.</p><p>In the drag flags parameter, use the UP and DOWN flags.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86acf77ac2caa592fdadc83239c5c81a/href">https://medium.com/media/86acf77ac2caa592fdadc83239c5c81a/href</a></iframe><p>If we run the app now, we will be able to drag the items up and down. Press and hold on the item for a second and you’ll be able to move the item.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*iXG2MLV2KgtzjS9e1B4fCQ.gif" /><figcaption>Drag Demo</figcaption></figure><h4>Removing Item on Swipe</h4><p>Now let’s see how we can handle the swipe events.</p><p>Whenever the item in the RecyclerView goes out of screen, the onSwiped() callback will be called. The direction parameter returns the direction that triggered the event.</p><pre>public void <strong>onSwiped</strong>(@NonNull RecyclerView.ViewHolder viewHolder, <strong>int direction</strong>) {<br><br>}</pre><p>Add a switch statement inside and use the direction as the activation expression.</p><p>Since we provided 2 flags for swipe, we’ll have 2 cases. The first case is ItemTouchHelper.END and the second case is ItemTouchHelper.START.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/216da2b17b0dc33a63f4b86e1580ee95/href">https://medium.com/media/216da2b17b0dc33a63f4b86e1580ee95/href</a></iframe><p>Now we can provide the logic to what we want to do.</p><p>To remove the item when we swipe from the right, inside the START case, grab the list that the RecyclerView is using for its data. Call remove() and get the item index using the viewHolder parameter.</p><p>Lastly, call <strong>notifyItemRemoved</strong>() from the adapter. This’ll update the view and create the delete animation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea600736938052d1abdd75c86db408ae/href">https://medium.com/media/ea600736938052d1abdd75c86db408ae/href</a></iframe><p>If we run the app, and swipe from the right, the item will be removed from the view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*_YtMCPUqgv4LRFmyrHtz4g.gif" /><figcaption>Swipe Left to Right Demo</figcaption></figure><h4>Swapping Items with Drag</h4><p>To handle drag events, we do it in the onMove() callback method.</p><p>To swap the items when we drag the items on top of each other, declare a variable call draggedItemIndex in the onMove() method. This will represent the index of the currently dragged item in the RecyclerView.</p><pre>@Override<br>public boolean onMove(...) {</pre><pre>    int draggedItemIndex;<br><br>    return false;<br>}</pre><p>To get the index, grab the viewHolder object from the parameter and call getAdapterPosition().</p><pre>int draggedItemIndex = viewHolder.getAdapterPosition();</pre><p>Declare another variable call targetIndex under draggedItemIndex. This will represent the index of the item that it was dragged on top of.</p><p>To get the index, grab the target object from the parameter and call getAdapterPosition().</p><pre>int targetIndex = target.getAdapterPosition();</pre><p>To swap the items, use the <strong>swap</strong>() method from the Collections class.</p><p>It takes 3 arguments, <strong>(1)</strong> the first is the list that is used by the RecyclerView, <strong>(2)</strong> the second is the index of the item we’re trying to swap, and <strong>(3)</strong> the third is the index of the target.</p><pre>Collections.swap(recyclerViewItems, draggedItemIndex, targetIndex);</pre><p>Lastly, call <strong>notifyItemMoved</strong>() from the adapter and pass in the position of the current item followed by the position of the target.</p><pre>adapter.notifyItemMoved(draggedItemIndex, targetIndex);</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/739b69352746a371c87f8366ae6e57ae/href">https://medium.com/media/739b69352746a371c87f8366ae6e57ae/href</a></iframe><p>If we run the app, we’ll be able to move the items around.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*z4m7KJf1bUmODVCOejnQ_Q.gif" /><figcaption>Swapping Demo</figcaption></figure><p>That is all for this tutorial. If you find this helpful, give it a like, share, and subscribe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wKazhiFDpWZUXSp11hCfog.png" /><figcaption>Thumbnail (Codeible.com)</figcaption></figure><p><a href="https://codeible.com/view/videotutorial/fU37QIkkGTqBnJ5BCMgm;title=Adding%20Swipe%20and%20Drag%20Gestures%20Events%20to%20RecyclerViews">Adding Swipe and Drag Gestures Events to RecyclerViews</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6dbe4871f87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shaped ImageViews — Shapeable ImageView]]></title>
            <link>https://medium.com/@Codeible/shaped-imageviews-shapeable-imageview-6e549f31ae3c?source=rss-1a504610e589------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e549f31ae3c</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[codeible]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-developers]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Codeible]]></dc:creator>
            <pubDate>Wed, 24 Aug 2022 01:07:41 GMT</pubDate>
            <atom:updated>2022-08-24T01:07:41.552Z</atom:updated>
            <content:encoded><![CDATA[<h3>Shaped ImageViews — Shapeable ImageView</h3><p>Hello, in this tutorial, I’ll show you how to create custom shaped ImageViews using the Material UI Components library for android.</p><p><a href="https://codeible.com/view/videotutorial/Z9ZOeVO9Rl6KYc3LmsOW">Shapeable ImageView</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FFNbnXxcZEBk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DFNbnXxcZEBk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FFNbnXxcZEBk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/484e2bdba176621de39cf66a7a136c2d/href">https://medium.com/media/484e2bdba176621de39cf66a7a136c2d/href</a></iframe><h3><strong>Setup</strong></h3><p>To begin, go to your app’s build.gradle file and add the dependency for Material UI Components.</p><pre>implementation &#39;com.google.android.material:material:1.6.0&#39;</pre><p>For the latest version of the library, visit to the <a href="https://mvnrepository.com/artifact/com.google.android.material/material">Maven Repository</a> for Android Material.</p><p>Sync the project and wait for the process to finish.</p><h3><strong>Shaping the ImageView</strong></h3><p>When you have the library loaded in, add an ImageView to a layout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*834F_ErAYeQtsDxg1xkk6g.jpeg" /><figcaption>Shaping the ImageView 1</figcaption></figure><p>To add a shape to this ImageView, we have to turn it into a ShapeableImageView.</p><p>Swap into the code view for the layout.</p><p>Highlight the ImageView element and type Shapeable. You should see a context menu for the ShapeableImageView.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*KIckBEMh3GL0fwwQ7vQoMw.jpeg" /><figcaption>Shapeable Code</figcaption></figure><p>Select it and press enter.</p><p>To add a shape to it, locate the themes.xml file.</p><p>Under the main style, define a new style and call it circle.</p><pre>&lt;style name=&quot;circle&quot;&gt;</pre><pre>&lt;/style&gt;</pre><p>To change the corners for the ImageView, add an item element with the name cornerSize.</p><p>In between the tags, set the value to 50%.</p><pre>&lt;style name=&quot;circle&quot;&gt;</pre><pre><strong>   &lt;item name=&quot;cornerSize&quot;&gt;50%&lt;/item&gt;</strong></pre><pre>&lt;/style&gt;</pre><p>Go back to the ImageView, search for the shapeAppearance attribute, and apply the style to change the shape.</p><p>Make sure the width and height are the same if you want the image to be circular.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*gRQTEXpu6Uw62sR7TGzS_w.jpeg" /><figcaption>shape appearance</figcaption></figure><p>If we run the app, the image would have a circular shape.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*KZpblQkKI6Z5P_TT9YNcLw.jpeg" /><figcaption>Result 1</figcaption></figure><h3><strong>Other shapes</strong></h3><p>Instead of changing all four corners of the image at once, we can change each one individually.</p><p>Go back to the themes.xml file and define a new style call custom shape.</p><pre>&lt;style name=&quot;custom_shape&quot;&gt;</pre><pre>&lt;/style&gt;</pre><p>Instead of using cornerSize to change all 4 corners at once, we can use cornerSizeTopLeft and right to change the corners on the top side.</p><p>The same can be done with the bottom with cornerSizeBottomLeft and right.</p><pre>&lt;style name=&quot;custom_shape&quot;&gt;</pre><pre><strong>   &lt;item name=&quot;cornerSizeTopLeft&quot;&gt;50%&lt;/item&gt;</strong></pre><pre><strong>   &lt;item name=&quot;cornerSizeTopRight&quot;&gt;50%&lt;/item&gt;</strong></pre><pre><strong>   &lt;item name=&quot;cornerSizeBottomRight&quot;&gt;30dp&lt;/item&gt;</strong></pre><pre><strong>   &lt;item name=&quot;cornerSizeBottomLeft&quot;&gt;30dp&lt;/item&gt;</strong></pre><pre>&lt;/style&gt;</pre><p>If we go back to the image and apply this shape, we will get a different result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*yWM_Q0sxOxfEBb77r-8n7w.jpeg" /><figcaption>Result 2</figcaption></figure><h3><strong>Cut Edges</strong></h3><p>We can also have sharp edges instead of round ones. Go back to the themes.xml file and set the <strong>cornerFamily </strong>to cut.</p><p>This will turn all the edges into sharp edges.</p><pre>&lt;style name=&quot;custom_shape&quot;&gt;</pre><pre>   &lt;item name=&quot;cornerSizeTopLeft&quot;&gt;50%&lt;/item&gt;</pre><pre>   &lt;item name=&quot;cornerSizeTopRight&quot;&gt;50%&lt;/item&gt;</pre><pre>   &lt;item name=&quot;cornerSizeBottomRight&quot;&gt;30dp&lt;/item&gt;</pre><pre>   &lt;item name=&quot;cornerSizeBottomLeft&quot;&gt;30dp&lt;/item&gt;</pre><pre><strong>   &lt;item name=&quot;cornerFamily&quot;&gt;cut&lt;/item&gt;</strong></pre><pre>&lt;/style&gt;</pre><p>If you want to change each corner individually, you can use cornerFamilyTopLeft and Right and cornerFamilyBottomLeft and Right.</p><pre>&lt;style name=&quot;custom_shape&quot;&gt;</pre><pre>   &lt;item name=&quot;cornerSizeTopLeft&quot;&gt;50%&lt;/item&gt;</pre><pre>   &lt;item name=&quot;cornerSizeTopRight&quot;&gt;50%&lt;/item&gt;</pre><pre>   &lt;item name=&quot;cornerSizeBottomRight&quot;&gt;30dp&lt;/item&gt;</pre><pre>   &lt;item name=&quot;cornerSizeBottomLeft&quot;&gt;30dp&lt;/item&gt;</pre><pre><strong>   &lt;item name=&quot;cornerFamilyTopLeft&quot;&gt;cut&lt;/item&gt;</strong></pre><pre><strong>   &lt;item name=&quot;cornerFamilyTopRight&quot;&gt;cut&lt;/item&gt;</strong></pre><pre><strong>   &lt;item name=&quot;cornerFamilyBottomLeft&quot;&gt;cut&lt;/item&gt;</strong></pre><pre><strong>   &lt;item name=&quot;cornerFamilyBottomRight&quot;&gt;rounded&lt;/item&gt;</strong></pre><pre>&lt;/style&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*wY1ExGzjcKb1-iMxc7RUgg.jpeg" /><figcaption>Result 3</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*iL9XSPrzGuDY2vJLQOeXsA.jpeg" /><figcaption>Shapeable ImageView Thumbnail</figcaption></figure><p><a href="https://codeible.com/view/videotutorial/Z9ZOeVO9Rl6KYc3LmsOW">Shapeable ImageView</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e549f31ae3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Animation: Animating Views using ValueAnimator in Minutes — Android]]></title>
            <link>https://medium.com/@Codeible/animation-animating-views-using-valueanimator-in-minutes-android-671542e8de62?source=rss-1a504610e589------2</link>
            <guid isPermaLink="false">https://medium.com/p/671542e8de62</guid>
            <category><![CDATA[codeible]]></category>
            <category><![CDATA[value-animator]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[animation]]></category>
            <dc:creator><![CDATA[Codeible]]></dc:creator>
            <pubDate>Mon, 22 Aug 2022 17:28:23 GMT</pubDate>
            <atom:updated>2023-04-06T22:09:55.222Z</atom:updated>
            <content:encoded><![CDATA[<h3>Animation: Animating Views using ValueAnimator in Minutes — Android</h3><p>Hello, in this tutorial, I will show you how to use the ValueAnimator to animate views.</p><p>Follow on Twitter: <a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fcodeible.com%2F&amp;ref_src=twsrc%5Etfw&amp;region=follow_link&amp;screen_name=KingWaiMark&amp;tw_p=followbutton">Codeible (@codeible) / Twitter</a>.</p><p><a href="https://codeible.com/view/videotutorial/2DIBwhhHJla2iLVrFFpg;title=ValueAnimator">ValueAnimator</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FArVhJAW5ZCE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DArVhJAW5ZCE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FArVhJAW5ZCE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c0852bae4074398b1e31df3fb0db4bb/href">https://medium.com/media/9c0852bae4074398b1e31df3fb0db4bb/href</a></iframe><p>The ValueAnimator is a timing engine that calculates the change between one value to another overtime.</p><p>We can utilize this change in value to modify our view’s values and create animations.</p><h4><strong>Setup</strong></h4><p>To begin, create a new project.</p><p>In the MainActivity’s layout file, make sure that the root is a ConstraintLayout. Then add a button and add the constraints to center it on the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*AWR6BOofe-xNwQhqRAUmQA.jpeg" /><figcaption>add a button</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/207d880ebf83edcb8abdb36ea5cb9e07/href">https://medium.com/media/207d880ebf83edcb8abdb36ea5cb9e07/href</a></iframe><h4><strong>Defining the ValueAnimator</strong></h4><p>Go to the MainActivity file and declare a ValueAnimator.</p><pre>ValueAnimator valueAnimator;</pre><p>In the onCreate() method grab the ValueAnimator object and use the ofInt() method from ValueAnimator to create the object.</p><p>Inside the parenthesis, pass in the starting value for the engine and then use a comma to add the ending value.</p><pre>@Override</pre><pre>protected void onCreate(Bundle savedInstanceState) {</pre><pre>   super.onCreate(savedInstanceState);</pre><pre>   setContentView(R.layout.value_animator);</pre><pre><strong>   valueAnimator = ValueAnimator.ofInt(0, 100);</strong></pre><pre>}</pre><p>When the engine starts, it will start from 0 and gradually increase to 100.</p><p>To set the <strong>duration</strong>, grab the valueAnimator object and call <strong>setDuration</strong>().</p><p>It accepts the duration in milliseconds. We’ll use 2000 to represent 2 seconds.</p><pre>valueAnimator.setDuration(2000);</pre><p>For the next part, we need to add a listener to the animator object to listen the changes. This way, we’ll be able to modify the button’s position overtime.</p><p>Grab the ValueAnimator, call <strong>addUpdatedListener</strong>(), and pass in a new <strong>AnimatorUpdatedListener</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/413800cf028b37ca4229abb3506f5bf7/href">https://medium.com/media/413800cf028b37ca4229abb3506f5bf7/href</a></iframe><p>To get the value of the changes, grab the animation object and call getAnimatedValue(). Then create an integer variable to store it.</p><pre>public void onAnimationUpdate(ValueAnimator animation) {</pre><pre><strong>   int value = (int) animation.getAnimatedValue();</strong></pre><pre>}</pre><p>It is an integer because we used the ofInt() method when we created the ValueAnimator object.</p><p>We can see the other methods we can use if we take the ValueAnimator class, put a period at the end of it, and type ”of.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*1jZ1sGitu2l9Q5pIa9647Q.jpeg" /><figcaption>ValueAnimator of</figcaption></figure><h4><strong>Animating</strong></h4><p>Now that the animator engine is completed, create a reference to the button in the layout.</p><pre>Button button = findViewById(R.id.button);</pre><p>To begin moving the button, go to the <strong>onAnimationUpdate</strong>() callback, grab the button, call <strong>setTranslationX</strong>(), and pass in the value from the engine.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7910c718cda86e9f68387c802976a23e/href">https://medium.com/media/7910c718cda86e9f68387c802976a23e/href</a></iframe><p>This will move the button in the x from left to right because our engine will start from 0 and end at 100.</p><p>To start the animation, attach a click listener to the button.</p><pre>button.setOnClickListener(new View.OnClickListener() {</pre><pre>   @Override<br>   public void onClick(View v) {</pre><pre>   }</pre><pre>});</pre><p>Grab the value animator object and call start.</p><pre>public void onClick(View v) {</pre><pre><strong>   valueAnimator.start();</strong></pre><pre>}</pre><p>If we run the app and click on the button, it’ll move the button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*woaenIRPIoO_Pm4n14NFxQ.gif" /><figcaption>demo1</figcaption></figure><h4><strong>Complex Animations</strong></h4><p>For more complex animations, we can pass in multiple values in the creator method such as ofInt().</p><p>Replace the values with this set of numbers. This will create a simple shake animation.</p><pre>ValueAnimator.ofInt(0, 20, -20, 18, -18, 15, -15, 6, -6, 0);</pre><p>Run the app and click on the button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*sVL-iOld9gtWY_BOW3ryBQ.gif" /><figcaption>shake animation</figcaption></figure><p>You can see that the ValueAnimator engine can be really powerful. Not only that it can change the value of one property, it can change the value of <strong>multiple </strong>properties at once.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f1f57c4fc664fe277b20dcdcba1b9e9/href">https://medium.com/media/1f1f57c4fc664fe277b20dcdcba1b9e9/href</a></iframe><p>If we run the app and click on the button now, it’ll change the position and the width.</p><h4><strong>Applying Interpolators</strong></h4><p>Now let’s take a look at interpolators. If we take a look at the <a href="https://developer.android.com/reference/android/animation/ValueAnimator">documentation for ValueAnimator</a>, the default interpolation it uses is the <a href="https://developer.android.com/reference/android/view/animation/AccelerateDecelerateInterpolator">AccelerateDecelerateInterpolator</a>.</p><p>With this interpolator, our values will gradually change and increase overtime. Then it’ll slowly decrease as it approaches the end.</p><p>Other types of interpolators can be found in the <a href="https://developer.android.com/reference/android/view/animation/Interpolator">official Interpolator documentation</a>.</p><p>If we click on the <a href="https://developer.android.com/reference/android/view/animation/BounceInterpolator">BounceInterpolator</a>, it says that the “change bounces at the end.”</p><p>Let’s see how we can apply this interpolator and change the behavior of our animation.</p><p>In the onCreate() method right after we set the duration, grab the ValueAnimator object, call <strong>setInterpolator</strong>(), and pass in a <strong>BounceInterpolator </strong>object.</p><pre>valueAnimator.setInterpolator(</pre><pre>   new BounceInterpolator()</pre><pre>);</pre><p>Run the app and click on the button to see the change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*ScN7ewSgAzag8uvnZrP7rA.gif" /><figcaption>demo4</figcaption></figure><p>That is all for this tutorial. If you find this helpful, please give it a like, share, and subscribe.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/df7708283ea41e3309c4aeb823a744c9/href">https://medium.com/media/df7708283ea41e3309c4aeb823a744c9/href</a></iframe><p>Additional Resources:</p><p><a href="https://codeible.com/view/videotutorial/2DIBwhhHJla2iLVrFFpg;title=ValueAnimator">ValueAnimator</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w7FLr0OM2c0e9RhYSKbWDQ.png" /><figcaption>Codeible.com</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=671542e8de62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generating the JSON Web Token for the Google Play Developer API]]></title>
            <link>https://medium.com/@Codeible/generating-the-json-web-token-for-the-google-play-developer-api-f6be6439b1af?source=rss-1a504610e589------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6be6439b1af</guid>
            <category><![CDATA[google-play-developer-api]]></category>
            <category><![CDATA[json-web-token]]></category>
            <category><![CDATA[codeible]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[google-play-developer]]></category>
            <dc:creator><![CDATA[Codeible]]></dc:creator>
            <pubDate>Sun, 30 Jan 2022 05:48:01 GMT</pubDate>
            <atom:updated>2023-04-06T22:05:27.403Z</atom:updated>
            <content:encoded><![CDATA[<p>Follow on Twitter: <a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fcodeible.com%2F&amp;ref_src=twsrc%5Etfw&amp;region=follow_link&amp;screen_name=KingWaiMark&amp;tw_p=followbutton">Codeible (@codeible) / Twitter</a>.</p><p>View article on <a href="https://codeible.com/view/videotutorial/EUVd83616z4AppnnKk4Y;title=Generating%20the%20JWT%20and%20Retrieving%20the%20OAuth%202.0%20Token">Codeible.com</a>.</p><p><a href="https://codeible.com/view/videotutorial/EUVd83616z4AppnnKk4Y;title=Generating%20the%20JWT%20and%20Retrieving%20the%20OAuth%202.0%20Token">Generating the JWT and Retrieving the OAuth 2.0 Token</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F91PlQyrebbk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D91PlQyrebbk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F91PlQyrebbk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa460e44b4c88fce4986336825c0011a/href">https://medium.com/media/aa460e44b4c88fce4986336825c0011a/href</a></iframe><p>Hello, in this tutorial, I’ll show you how to generate the JSON Web Token for OAuth so you can use the Google Play Developer API in server-to-server applications.</p><h3>Creating the Service Account</h3><p>To begin, you will need a Service Account to access the API on behalf of the user.</p><p>Go to the <a href="https://play.google.com/console/api-access">API Access</a> page on the Google Play Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*TI82_mglIv7XRTf8_5T2Rw.jpeg" /><figcaption>API Access — Codeible.com</figcaption></figure><p>Select “Create new project” and click on the “Link project” button at the bottom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*QTxz0J_rk4ifnLQ4F-3cgg.jpeg" /><figcaption>Create new project — Codeible.com</figcaption></figure><p>Once the project is created, you’ll see a new screen with the linked project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*6Dtrxk0o1ua00EpZAL0EYw.jpeg" /><figcaption>Link Google Cloud Project — Codeible.com</figcaption></figure><p>Under the Service accounts section, click on the “Create new service account” button to begin creating the account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*Avp3aAECVkrk6JQyIfVxWQ.jpeg" /><figcaption>Create new service account — Codeible.com</figcaption></figure><p>Click on the “<a href="https://console.developers.google.com/iam-admin/serviceaccounts/project">Google Cloud Platform</a>” link in the dialog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*1eKo4JeTcsne8gHpCqOqvw.jpeg" /><figcaption>Google Cloud Platform link — Codeible.com</figcaption></figure><p>Make sure that the project is selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*fttt56r24gP8WBQiX5qSFA.jpeg" /><figcaption>Selected Project — Codeible.com</figcaption></figure><p>Then click on “CREATE SERVICE ACCOUNT.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*wiXhj76zVAuvCcX9SJNYUw.jpeg" /><figcaption>Create service account — Codeible.com</figcaption></figure><p>Give the account a name and continue to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*XxZUaG3HkQuydcGwRHvpYA.jpeg" /><figcaption>Account name — Codeible.com</figcaption></figure><p>For the role, select “Service Account User,” then click on “Done” to complete the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*unFa2NzaYm1zV6keaMHbqA.jpeg" /><figcaption>Role — Codeible.com</figcaption></figure><p>Go back to the <a href="https://play.google.com/console/api-access">API Access</a> page and click “Done” to close the dialog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*1eKo4JeTcsne8gHpCqOqvw.jpeg" /><figcaption>Done service account — Codeible.com</figcaption></figure><p>The page should refresh and your account will appear in the Service accounts section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*6SWXpxnh9HK_doZ-5D8WeQ.jpeg" /><figcaption>Service Account shown — Codeible.com</figcaption></figure><h3><strong>Granting Permissions</strong></h3><p>The next thing we need to do is to give access to the account to perform actions with the Google Play Developer API.</p><p>Click on the “Grant access” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*bq1FOE-Rd21S_lr7bqhVoQ.jpeg" /><figcaption>Grant access — Codeible.com</figcaption></figure><p>If you want to allow all access, check the Admin permission. For Google Play Billing, check the financial data and Manager orders option.</p><pre>View financial data, orders, and cancellation survey responses</pre><pre>View financial reports, sales reports, and orders; view buyer metrics on the User acquisition page; access the Purchases API; view revenue information for any associated Play Games Services projects; and download written responses to the cancellation survey</pre><p>—</p><pre>Manage orders and subscriptions</pre><pre>View orders, refund orders, and cancel subscriptions. Users also need the ‘View financial data’ permission to view aggregate financial reports</pre><p>Then click on “Invite user” to complete the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*DgGUwLiuCBwWPTvXOHOJew.jpeg" /><figcaption>Invite user — Codeible.com</figcaption></figure><h3><strong>Retrieving the Service Account Information</strong></h3><p>After you grant the necessary permissions, go back to the <a href="https://play.google.com/console/api-access">API access</a> page and click on the “Google Cloud” button next the account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*_QLHpDDQnsWkF6oZzxd_IA.jpeg" /><figcaption>View in Google Play — Codeible.com</figcaption></figure><p>Click on the account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*-Xvo1aSciEr8z-PQFgZA3w.jpeg" /><figcaption>Google Cloud Account — Codeible.com</figcaption></figure><p>Select the “Keys” tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*yw70oRn2VQQ1854CmpdmYw.jpeg" /><figcaption>Keys tab — Codeible.com</figcaption></figure><p>Click on “ADD KEY” and then “Create new key.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/207/1*bet3Bik16MWc7gRKpUnOng.jpeg" /><figcaption>Create new key — Codeible.com</figcaption></figure><p>Select JSON and then click on “CREATE” to create the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*GhmFc0-37pB4jZXs9Es9Dw.jpeg" /><figcaption>JSON Key File — Codeible.com</figcaption></figure><p>A file should be downloaded automatically. It contains information about the account that we’ll need to generate the JSON Web Token.</p><p>Keep it safe somewhere and try not to lose it. If you did lose it, you will need to repeat this step and create a new Key file.</p><p>Sample JSON Key file</p><pre>{</pre><pre>&quot;type&quot;: &quot;...&quot;,</pre><pre>&quot;project_id&quot;: &quot;...&quot;,</pre><pre>&quot;private_key_id&quot;: &quot;...&quot;,</pre><pre>&quot;private_key&quot;: &quot;...&quot;,</pre><pre>&quot;client_email&quot;: &quot;...&quot;,</pre><pre>&quot;client_id&quot;: &quot;...&quot;,</pre><pre>&quot;auth_uri&quot;: &quot;https://accounts.google.com/o/oauth2/auth&quot;,</pre><pre>&quot;token_uri&quot;: &quot;https://oauth2.googleapis.com/token&quot;,</pre><pre>&quot;auth_provider_x509_cert_url&quot;: &quot;...&quot;,</pre><pre>&quot;client_x509_cert_url&quot;: &quot;...&quot;</pre><pre>}</pre><h3><strong>Generating the JSON Web Token</strong></h3><p>After you obtain the private key for the service account, you’ll need to create a JSON Web Token to request an access token to communicate with the Google Play Developer API.</p><p>A JSON Web Token is divided into 3 parts:</p><pre>1. Header</pre><pre>2. Claim Set</pre><pre>3. Signature</pre><p>Each part is encoded using the Base64url encoding format and separated by a period.</p><pre>{ Base64Url Header } . { Base64Url Claim Set } . { Base64Url Signature }</pre><p>The header and claim set are JSON objects that contains information about the token.</p><p>And the signature is used validate the information when it is received by the server.</p><p>Let’s see how this is done in code.</p><p>To begin, create a new JavaScript file call <strong>jwt.js</strong>. Then create a JSON object call header.</p><pre>const header = {</pre><pre>}</pre><p>The header consists of 2 fields that indicate the signing algorithm and format of the information.</p><p>Use “<strong>alg</strong>” to represent the algorithm field and then set it to “<strong>RS256</strong>.” It is the only algorithm supported by the Google OAuth Authorization Server.</p><p>Add another field call “<strong>typ</strong>” to represent the format and set it to “<strong>JWT</strong>.”</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6a751aa4f22943c067fb63c9ddec9ba/href">https://medium.com/media/d6a751aa4f22943c067fb63c9ddec9ba/href</a></iframe><p>Now for the claim set, create another JSON object call claimSet.</p><pre>const claimSet = {</pre><pre>}</pre><p>We use the claim set to provide some information about the token such as when it’ll expire, the time it was issued, what permission we want, and the service account we are using to access the information.</p><p>Use “<strong>iss</strong>” to represent the service account and set it to the account you have created earlier.</p><pre>const claimSet = {</pre><pre>   iss: &quot;....iam.gserviceaccount.com&quot;,</pre><pre>}</pre><p>Then add 2 more fields call iat and exp.</p><p><strong>iat </strong>represents the time the token is issued.</p><p>Create a new date object call now, call the getTime() function to get the time into milliseconds and then divide it by 1000 to convert it to seconds.</p><p>Then pass it inside the claimSet.</p><pre>const now = new Date().getTime() / 1000;</pre><pre>const claimSet = {</pre><pre>   iss: &quot;....iam.gserviceaccount.com&quot;,</pre><pre>   iat: now</pre><pre>}</pre><p>For exp, it represents the time the token will expire. The maximum time it can last is 1 hour.</p><p>Create a new variable call oneHour.</p><p>To get one hour in seconds, we do 60 to represent 1 minute. Then we need to multiply it by 60 to get 1 hour.</p><p>Create a new variable call expireTime and add now and hourOne together. This’ll get us the amount one hour after the token was issued.</p><p>Now pass it inside the claimSet for exp.</p><pre>const now = new Date().getTime() / 1000;</pre><pre>const oneHour = 60 * 60;</pre><pre>const expireTime = now + oneHour;<br></pre><pre>const claimSet = {</pre><pre>   iss: &quot;....iam.gserviceaccount.com&quot;,</pre><pre>   iat: now,</pre><pre>   exp: expireTime,</pre><pre>}</pre><p>For the last 2 fields, use “<strong>scope</strong>” and” <strong>aud</strong>”.</p><p>“scope” represents the permissions we want.</p><p>If we look at the documentation for the <a href="https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/get">Google Play Developer API</a> and scroll to the bottom of the method page. It’ll tell use what scope we need to use to call a particular method.</p><p>Copy it and set it into the claimSet.</p><pre>const claimSet = {</pre><pre>   iss: &quot;....iam.gserviceaccount.com&quot;,</pre><pre>   iat: now,</pre><pre>   exp: expireTime,</pre><pre><strong>   scope: &quot;https://www.googleapis.com/auth/androidpublisher&quot;</strong></pre><pre>}</pre><p>“<strong>aud</strong>” represents the url we are using to get the token from. It is always going to <a href="https://oauth2.googleapis.com/token."><strong>https://oauth2.googleapis.com/token</strong>.</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed332e760060c0f7fced7d099e1e74e0/href">https://medium.com/media/ed332e760060c0f7fced7d099e1e74e0/href</a></iframe><h3><strong>Encoding the header and claim set</strong></h3><p>Now that we have the header and claim set, we need to turn them into a byte array and then encode them using Base64url encoding.</p><p>To do this, create a function call <strong>toBase64URL </strong>with a parameter call json.</p><p>Inside the function, turn the json into a string to serialize it and store it inside a variable call jsonString.</p><p>Then turn it into a Byte array using the Buffer class and store it inside a variable call byteArray.</p><p>To encode the array into Base64url, grab the array, call toString() using “base64”, and replace all the +’s with hyphens, all the forward slashes with underlines, and all the equal symbols with an empty string.</p><p>Lastly return the encoded string.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1335f13a924093c77144ed8444aacfb0/href">https://medium.com/media/1335f13a924093c77144ed8444aacfb0/href</a></iframe><p>Now create a variable call encodedHeader and call the toBase64URL() function to encode the header.</p><p>We’ll do the same for the claim set.</p><pre>const encodedHeader = toBase64URL(header);</pre><pre>const encodedClaimSet = toBase64URL(claimSet);</pre><h3><strong>Generating the signature</strong></h3><p>To create the signature, import the crypto module from NodeJS.</p><p>Then use the createSign() function to create the signer object.</p><pre>const crypto = require(&quot;crypto&quot;);</pre><pre>const signer = crypto.createSign(&quot;RSA-SHA256&quot;);</pre><p>The first part to getting the signature is to pass in the data to the signer to get it sign.</p><p>Grab the signer, call write(), and pass in the header and claim set. Use the period symbol to separate them.</p><p>Then, call end() to complete the writing process.</p><pre>signer.write(encodedHeader + &quot;.&quot; + encodedClaimSet);</pre><pre>signer.end;</pre><p>The second part to get the signature is to get the private key that is unique for the account. It is located inside the JSON file that you downloaded earlier when you created the service account.</p><p>Copy the private_key and store it inside a variable of the project.</p><pre>const privateKey = &quot;-----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY-----\n&quot;;</pre><p>Then grab the signer, call sign, pass in the private key for the first parameter, use “base64” for the second, and store the signature.</p><pre>const signature = signer.sign(privateKey, &quot;base64&quot;)</pre><p>The third and final part to getting the signature is to encode it using Base64url.</p><p>Create a variable call encodedSignature and replace all the +’s, forward slashes, and equal symbols like how we did it earlier.</p><pre>const encodedSignature = signature.replace(/\+/g, &quot;-&quot;).replace(/\//g, &quot;_&quot;).replace(/=/g, &quot;&quot;);</pre><h3><strong>Obtaining the JWT</strong></h3><p>Once we have the encoded header, claim set, and signature, we have the JSON Web Token.</p><p>Create a variable call jwt and set it to the sum of the header, claimSet, and signature. Then use the period symbol to separate it.</p><pre>const jwt = `${encodedHeader}.${encodedClaimSet}.${encodedSignature}`;</pre><p>If we print it out, we’ll get some long-encoded string which is what we want.</p><pre>eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJiaWxsaW5nc2VydmljZWFjY291bnRAYXBpLTQ2NDE1NTM5ODcyMzczOTQyMDUtNTUxMzU5LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiaWF0IjoxNjQyNDc0Nzg3LjAyOCwiZXhwIjoxNjQyNDc4Mzg3LjAyOCwic2NvcGUiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9hdXRoL2FuZHJvaWRwdWJsaXNoZXIiLCJhdWQiOiJodHRwczovL29hdXRoMi5nb29nbGVhcGlzLmNvbS90b2tlbiJ9.vagBHLgdfzyaDO0mutpVZWqzXcrK4K0M7o6s6jQNFB5m50mcvJyLTI9E6RcoHv14ujGodP-NvKSdsg4-mASBV6Ay65bjsQta4GNrpVRAp8Xse8Rsl3Z8j7EtDOtFvdEs9TjHvj_LPThtr0FlFE3yr-513cJmyeAd53kxDOdKeHguuTOrvtp58IrYoAKyuJURY20ijg7ibZD07r-lcDK2cx9yejHs-TYGcvEjAxL7PECEP4JbXaA2NmTKoiNClXfm533Qq-8JqOHUPINx6iKtIkkLmZmzHDvArWZ5WyuvnJuQz83Eyk-iwgY7H_4_6zuv1IU-VG69vaitipCPfMh53g</pre><h3><strong>OAuth and Access Token</strong></h3><p>Now let’s see how we can get the OAuth token using the JSON Web Token.</p><p>Import the https module from Node.</p><pre>const https = require(&quot;https&quot;);</pre><p>Define a function call getOAuthToken() with one parameter for the JSON Web Token.</p><p>This function will return a Promise(). Inside the Promise, create a JSON object call option. We’ll use this to provide information for the request we’ll make to get the OAuth token.</p><p>Set the hostname to oauth2.googleapis.com.</p><p>For the path, use forward slash, token, followed by a question mark to start the query string.</p><p>Set the grant_type to <strong>urn:ietf:params:oauth:grant-type.jwt-bearer</strong> and then set the assertion using the JSON Web Token.</p><p>For the method, we’ll use <strong>POST </strong>and for the headers, we’ll set the <strong>Content-Type to application/x-www-form-urlencoded</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b2e6e9e37d0168ce8f62ebb0aa4f25c/href">https://medium.com/media/8b2e6e9e37d0168ce8f62ebb0aa4f25c/href</a></iframe><p>Once we have the option, make the request by taking the https module and calling the request() function.</p><pre>var req = https.request();</pre><p>For the first parameter, pass in the option, and for the second parameter, pass in a callback to handle the response.</p><pre>var req = https.request(option, function (res) {</pre><pre>});</pre><p>Inside the callback add a callback for the data and when it ends.</p><p>Then store the data inside a string.</p><p>Call the resolve() function from the promise to stop the promise when it ends and pass in the result so we can get it.</p><pre>var req = https.request(option, function (res) {</pre><pre>   var result = &#39;&#39;;</pre><pre>   res.on(&#39;data&#39;, function (chunk) {</pre><pre>      result += chunk;</pre><pre>   });</pre><pre>   res.on(&#39;end&#39;, function () {</pre><pre>      resolve(result);</pre><pre>   });</pre><pre>});</pre><p>After, add a callback to handle any errors and then end the request.</p><pre>req.on(&#39;error&#39;, function (err) {</pre><pre>   reject(err);</pre><pre>});</pre><pre>req.end();</pre><p>Full function</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a47872a571f4ead67d0883d5087b055f/href">https://medium.com/media/a47872a571f4ead67d0883d5087b055f/href</a></iframe><h3><strong>Testing</strong></h3><p>To test this, create an async function call test() and call the getOAuthToken() function inside.</p><p>Convert it into a JSON and print it out to the console.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d241dbf50ef27a86f5a9d4bda30f769e/href">https://medium.com/media/d241dbf50ef27a86f5a9d4bda30f769e/href</a></iframe><p>Call the test() function and run the app.</p><p>You should see an response with the access token</p><pre>{</pre><pre>   access_token: &#39;...&#39;,</pre><pre>   expires_in: 3599,</pre><pre>   token_type: &#39;Bearer&#39;</pre><pre>}</pre><ul><li><a href="https://codeible.com/view/videotutorial/EUVd83616z4AppnnKk4Y;title=Generating%20the%20JWT%20and%20Retrieving%20the%20OAuth%202.0%20Token">Generating the JWT and Retrieving the OAuth 2.0 Token</a></li><li><a href="https://twitter.com/KingWaiMark">JavaScript is not available.</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6be6439b1af" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>