<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prosenjit Chowdhury</title>
    <description>The latest articles on DEV Community by Prosenjit Chowdhury (@bonnopc).</description>
    <link>https://dev.to/bonnopc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F429256%2Fb3d8869d-e995-4ded-9c6d-06b3c5ed3708.jpg</url>
      <title>DEV Community: Prosenjit Chowdhury</title>
      <link>https://dev.to/bonnopc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bonnopc"/>
    <language>en</language>
    <item>
      <title>Boost Page Speed By Using Only A CSS Property!</title>
      <dc:creator>Prosenjit Chowdhury</dc:creator>
      <pubDate>Sat, 29 Aug 2020 13:50:21 +0000</pubDate>
      <link>https://dev.to/bonnopc/boost-page-speed-by-using-only-a-css-property-3g5g</link>
      <guid>https://dev.to/bonnopc/boost-page-speed-by-using-only-a-css-property-3g5g</guid>
      <description>&lt;p&gt;Google just released Chrome 85, the major update for this browser in 2020. Just like those previous major updates, Chrome got a bunch of fixes and new features. Which includes &lt;code&gt;content-visibility: auto&lt;/code&gt; also.&lt;/p&gt;

&lt;p&gt;When we develop a site or page for a browser, it requires several steps to render or to show the page to the users. Browser goes through multiple processes before even it paint its first pixel of our site. After that it does these process for the whole page including the contents or elements that is not visible or not in the viewport yet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp71gchnmcl4bq1xly10h.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp71gchnmcl4bq1xly10h.jpg" alt="browser-process-for-rendering-elements" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After publishing of Chrome 85, developers now can easily make this process shorter by using &lt;code&gt;content-visibility: auto&lt;/code&gt; to an element. This CSS property tells the browser that specific element can be skipped until it has been scrolled to the viewport.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nf"&gt;#element&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;content-visibility&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fubrsilhq5fjyrw5b3985.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fubrsilhq5fjyrw5b3985.jpg" alt="effects after applying content-visbility to auto" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have already applied it to one my project and the performance boosted impressively than earlier. Previously the Lighthouse speed was 66. But after applying &lt;code&gt;content-visibility: auto&lt;/code&gt; to the elements that will be scrolled later, made the performance speed to 83. Which is amazing!&lt;/p&gt;

&lt;p&gt;So start using it now and discuss your experience in the comments section.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>html</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Publishing React App on Google Play Store - Trusted Web Activity (TWA) Basic Guide</title>
      <dc:creator>Prosenjit Chowdhury</dc:creator>
      <pubDate>Sat, 11 Jul 2020 13:51:54 +0000</pubDate>
      <link>https://dev.to/bonnopc/publishing-react-app-on-google-play-store-trusted-web-activity-twa-basic-guide-1eao</link>
      <guid>https://dev.to/bonnopc/publishing-react-app-on-google-play-store-trusted-web-activity-twa-basic-guide-1eao</guid>
      <description>&lt;p&gt;When I first heard about Trusted Web Activity (TWA) I was very amazed and excited to publish my first app on play store. Recently I have published my Next.js (React SSR) PWA on Google Play Store as TWA and I will try to share all information, process and experiences about TWA in this article.&lt;/p&gt;

&lt;p&gt;As you already know, TWA is a way of publishing your PWA on Play Store. It runs in a Chrome instance or Chrome Custom Tab (CCT) on a user's device. It gives way beyond features than a web-view on an android app, such as - &lt;a href="https://developers.google.com/web/fundamentals/push-notifications/" rel="noopener noreferrer"&gt;Web Push Notification&lt;/a&gt;, &lt;a href="https://developers.google.com/web/updates/2015/12/background-sync" rel="noopener noreferrer"&gt;Background Sync&lt;/a&gt;, &lt;a href="https://support.google.com/chrome/answer/142893?co=GENIE.Platform%3DDesktop&amp;amp;hl=en" rel="noopener noreferrer"&gt;Chrome Form Autofill&lt;/a&gt;, &lt;a href="https://www.w3.org/TR/media-source/" rel="noopener noreferrer"&gt;Media Source Extensions (MSE)&lt;/a&gt; and &lt;a href="https://developers.google.com/web/updates/2016/09/navigator-share" rel="noopener noreferrer"&gt;Web Share API&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why TWA?
&lt;/h1&gt;

&lt;p&gt;So far I have gathered some of my personal experiences regarding TWA. Including -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Efficient codebase&lt;/strong&gt; - This technology gives a company or a developer to maintain a single code base for most of the platform which is very efficient,&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant update&lt;/strong&gt; - Updates on TWA doesn’t require to go through the review process of Play Store after every update, which saves time and serves to the user instantly,&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Device Compatibility&lt;/strong&gt; - Most of the android app developers face a problem of providing support to every devices, specially for the devices having less amount of RAM. But for TWA, it isn't required to test for all device models as it works on every device that supports Chrome 72+.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F06gntydrej2p1rv32pzv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F06gntydrej2p1rv32pzv.png" alt="TWA Basic Guide" width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Criterias for TWA
&lt;/h1&gt;

&lt;p&gt;This is actually the most important part to publish your app on Play Store. To publish your web app on play store some requirements need to fulfilled, such as -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To become a TWA, web-apps need to be a PWA at first. Which means, you have to fulfill all the &lt;a href="https://web.dev/pwa-checklist/" rel="noopener noreferrer"&gt;requirements of PWA&lt;/a&gt;. Some articles say that loading speed is measured using &lt;a href="https://developers.google.com/web/tools/lighthouse/" rel="noopener noreferrer"&gt;Lighthouse&lt;/a&gt; and web content in TWAs must achieve a performance score of 80. But in my case, I had to use libraries like Material UI and others to deliver the app ASAP, that’s why I had to compromise with my app performance which was 66 (measured by Lighthouse). But After going through the review process of the Play Store, my app was finally approved. That's why I think having the performance score of 80 isn’t a requirement anymore for TWA.&lt;/li&gt;
&lt;li&gt;TWA needs to have a &lt;a href="https://developers.google.com/digital-asset-links/v1/getting-started" rel="noopener noreferrer"&gt;Digital Assets Link&lt;/a&gt; which proves both app has been published by the same developer,&lt;/li&gt;
&lt;li&gt;The app must meet the Play Store policies. As google can't always guarantee that your web contents meet the &lt;a href="https://support.google.com/googleplay/android-developer/answer/9893335?hl=en&amp;amp;ref_topic=9877766" rel="noopener noreferrer"&gt;Family Program Requirements&lt;/a&gt;, you have to select your audience age should be 13+ while publishing your app through Play Console.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Setting up the Environment
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Get the Java Development Kit (JDK) 8
&lt;/h2&gt;

&lt;p&gt;The Android Command line tools requires the correct version of the JDK to run. To prevent version conflicts with a JDK version that is already installed, &lt;a href="https://www.npmjs.com/package/@bubblewrap/cli" rel="noopener noreferrer"&gt;Bubblewrap&lt;/a&gt; uses a JDK that can be unzipped in a separate folder.&lt;/p&gt;

&lt;p&gt;Download a version of JDK 8 that is compatible with your OS from &lt;a href="https://adoptopenjdk.net/releases.html?variant=openjdk8&amp;amp;jvmVariant=hotspot" rel="noopener noreferrer"&gt;AdoptOpenJDK&lt;/a&gt; and extract it in its own folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Using a version lower than 8 will make it impossible to compile the project and higher versions are incompatible with the Android command line tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get the Android command line tools
&lt;/h2&gt;

&lt;p&gt;Download a version of Android command line tools that is compatible with your OS from &lt;a href="https://developer.android.com/studio#command-tools" rel="noopener noreferrer"&gt;https://developer.android.com/studio#command-tools&lt;/a&gt;. Create a folder and extract the downloaded file into it. This will further install the androidSdk and android SDK manager without needing to install the whole Android IDE.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tell Bubblewrap where the JDK and Android command line tools are
&lt;/h2&gt;

&lt;p&gt;When running bubblewrap for the first time, it will ask where it can find the JDK and Android command line tools. So, take note of the location where both were decompressed.&lt;/p&gt;

&lt;p&gt;To ensure if you are taking note of the correct location, check if each directory contains the following files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The OpenJDK path should contain bin,com,include ..&lt;/li&gt;
&lt;li&gt;The AndroidSDK path should contain tools which should have bin, cli&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Updating the location of the JDK and / or the Android command line tools
&lt;/h2&gt;

&lt;p&gt;If the location for the JDK or the Android command line tools have been setup with the wrong path or if their location has changed after the initial configuration, the location for either of those can be changed by editing the configuration file at &lt;code&gt;${USER_HOME}/.llama-pack/llama-pack-config.json&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sample llama-pack-config.json
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ 
  "jdkPath":"\\user\\home\\bubblewrap-user\\open-jdk",
  "androidSdkPath":"\\user\\home\\bubblewrap-user\\android-cli"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Quick-start Guide
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Installing Bubblewrap
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -g @bubblewrap/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Initializing an Android Project
&lt;/h2&gt;

&lt;p&gt;Generate an Android project from an existing Web Manifest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bubblewrap init --manifest https://your-web-app-url.com/manifest.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When initializing a project, Bubblewrap will download the Web Manifest and ask you to confirm the values that should be used when building the Android project.&lt;/p&gt;

&lt;p&gt;It will also ask you for the details needed to generate a signing key, used to sign the app before uploading to the Play Store.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building the Android Project
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bubblewrap build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When building the project for the first time, the Android Build Tools will need to be installed. The tool will invoke the installation process for the build tools. Make sure to read and accept the license agreement before proceeding. This process will install the other required files inside the directory/decompressed root directory of the android CLI package.&lt;/p&gt;

&lt;p&gt;As a result of the build step, the tool will generate a signed APK (app-release-signed.apk) and an unsigned APK (app-release-unsigned.apk). You can choose any of them to be uploaded to the Play Store.&lt;/p&gt;

&lt;h2&gt;
  
  
  Publish your App through Play Console
&lt;/h2&gt;

&lt;p&gt;You can choose to upload the unsigned APK and let Google manage your app's signing key. Go to Google Play console and signup for your developer account if you don’t have any. You’ll need to pay $25 to create this account. Then create an alpha, beta or internal release for your App. You can follow their guidelines to create your releases. Don’t forget to choose the age range from 13+ or your app publishing request won’t be accepted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Asset Link File
&lt;/h2&gt;

&lt;p&gt;To create an Asset Link, you need to have a JSON file accessible from your web app URL. The URL of that JSON file should be &lt;code&gt;https://your-web-app-url/.well-known/assetlinks.json&lt;/code&gt;. As mentioned earlier, I have used Next.js to build my web-app. If you have done the same, then create a folder named &lt;code&gt;.well-known&lt;/code&gt; in your &lt;code&gt;public&lt;/code&gt; folder of your project directory. In that folder create a file named &lt;code&gt;assetlinks.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then go to Google Play Console, select your app release and copy SHA-256 certificate fingerprint from under the App signing certificate section. Edit your &lt;code&gt;assetlinks.json&lt;/code&gt; file like this,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.appspot.pwa_directory",
    "sha256_cert_fingerprints": [
      "FA:2A:03:CB:38:9C:F3:BE:28:E3:CA:7F:DA:2E:FA:4F:4A:96:F3:BC:45:2C:08:A2:16:A1:5D:FD:AB:46:BC:9D",
    ]
  }
}]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change the &lt;code&gt;package_name&lt;/code&gt; value that was given or created when you have built you APK using Bubblewrap. Usually it becomes like &lt;code&gt;com.your-web-app-url.pwa&lt;/code&gt; where your web-app URL might be &lt;code&gt;https://pwa.your-web-app-url.com&lt;/code&gt;. Place &lt;code&gt;sha256_cert_fingerprints&lt;/code&gt; value of SHA-256 certificate fingerprint that was copied from Google Play Console. Don’t forget to publish this JSON file ASAP after you applied for publishing your android app to Play Store.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wait For Confirmation
&lt;/h2&gt;

&lt;p&gt;After finishing the procedure as mentioned above, wait for the confirmation from Play Store authority about publishing your app. Usually it takes 1-2 days to finish the review process. But I published my app in June 2020 and due to COVID-19 situation Google took more time to finish the review process.&lt;/p&gt;

&lt;p&gt;After submitting for review Google confirmed the publication of my first TWA app on Play Store after 5 days. Try publishing your web app on Google Play Store today. Happy Coding!&lt;/p&gt;

</description>
      <category>react</category>
      <category>android</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
