<?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 Soumya Ranjan Sethy on Medium]]></title>
        <description><![CDATA[Stories by Soumya Ranjan Sethy on Medium]]></description>
        <link>https://medium.com/@soumyasethy?source=rss-3741046cf8b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tkuPFRa4KKKA95t9.</url>
            <title>Stories by Soumya Ranjan Sethy on Medium</title>
            <link>https://medium.com/@soumyasethy?source=rss-3741046cf8b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 22:00:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@soumyasethy/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[Add Typescript to React Package]]></title>
            <link>https://medium.com/@soumyasethy/add-typescript-to-react-package-9140f98059e3?source=rss-3741046cf8b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9140f98059e3</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Soumya Ranjan Sethy]]></dc:creator>
            <pubDate>Sun, 30 Jan 2022 18:34:06 GMT</pubDate>
            <atom:updated>2022-01-30T18:39:20.973Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why Typescript?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*pykAAMGW7GUX6EU4T7D5fA.png" /></figure><h4>Add Typescript as devDependency</h4><pre>/// Navigate to schema repo directory<br>$ cd design-component/schema</pre><pre>/// Add Typescript as devDependency<br>$ yarn add -D typescript</pre><p>Add Typescript Config file “<strong>tsconfig.json”</strong></p><pre>{<br>  &quot;compilerOptions&quot;: {<br>    &quot;outDir&quot;: &quot;lib&quot;,--&gt; Output directory of JS code of Typescript<br>    &quot;module&quot;: &quot;esnext&quot;,<br>    &quot;target&quot;: &quot;esnext&quot;,<br>    &quot;declaration&quot;: true,<br>    &quot;moduleResolution&quot;: &quot;node&quot;,<br>    &quot;allowSyntheticDefaultImports&quot;: true,<br>    &quot;jsx&quot;: &quot;react&quot;<br>  },<br>  &quot;include&quot;: [&quot;src&quot;], --&gt; Input path of Typescript(Ts)<br>  &quot;exclude&quot;: [&quot;node_modules&quot;, &quot;lib&quot;] --&gt; Exclude Ts check<br>}</pre><h4>Add “index.ts” — Root file of your package</h4><blockquote>Export everything from root level . Your repository will look something like this:</blockquote><pre>schema/       <br>  index.ts    -&gt; Root of file, export all required files here                             <br>  package.json -&gt; added typescript here as devDependency<br>  tsconfig.json -&gt; we just added above Ts Config file</pre><h4>Modify package.json</h4><pre>{<br>  &quot;name&quot;:<strong> &quot;@design-component/schema&quot;,</strong><br>  &quot;version&quot;:<strong> &quot;1.0.0&quot;,</strong></pre><pre><strong>&quot;main&quot;: &quot;lib/index.js&quot;, </strong>--&gt;<strong> </strong>Auto<strong> </strong>Generated<strong> </strong>Js code of Ts code written in index.ts</pre><pre><strong>&quot;types&quot;: &quot;lib/index.d.ts&quot;, </strong>--&gt; Auto<strong> </strong>Generated<strong> </strong>file provides typescript type information about a module that&#39;s written in JavaScript</pre><pre><strong>&quot;scripts&quot;: {<br>    &quot;build&quot;: &quot;tsc&quot;,  </strong>--&gt;<strong> </strong>TS<strong> </strong>compile &amp; build. Run cmd <strong>yarn build<br>    &quot;dev&quot;: &quot;tsc -w&quot; </strong>--&gt;<strong> </strong>TS compile &amp; build in Watch mode on change.<strong><br>  },</strong><br>  &quot;dependencies&quot;: {},<br>  &quot;devDependencies&quot;: {<br>    &quot;typescript&quot;: &quot;^4.5.5&quot; //latest version of Typescript<br>  }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9140f98059e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#Hashtag Pro]]></title>
            <link>https://medium.com/@soumyasethy/hashtag-pro-783f5684fcf0?source=rss-3741046cf8b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/783f5684fcf0</guid>
            <dc:creator><![CDATA[Soumya Ranjan Sethy]]></dc:creator>
            <pubDate>Sat, 27 Nov 2021 07:11:50 GMT</pubDate>
            <atom:updated>2021-11-27T07:11:50.726Z</atom:updated>
            <content:encoded><![CDATA[<p>Privacy Policy of #hashtag Pro</p><h3>Privacy Policy</h3><p>Effective date: July 19, 2018</p><p>news.ly (“us”, “we”, or “our”) operates the website and the news.ly mobile application (the “Service”).</p><p>This page informs you of our policies regarding the collection, use, and disclosure of personal data when you use our Service and the choices you have associated with that data. This Privacy Policy for #hashtag Pro is powered by <a href="https://www.freeprivacypolicy.com/free-privacy-policy-generator.php">FreePrivacyPolicy.com</a>.</p><p>We use your data to provide and improve the Service. By using the Service, you agree to the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, the terms used in this Privacy Policy have the same meanings as in our Terms and Conditions.</p><h3>Information Collection And Use</h3><p>We collect several different types of information for various purposes to provide and improve our Service to you.</p><h3>Types of Data Collected</h3><h3>Personal Data</h3><p>While using our Service, we may ask you to provide us with certain personally identifiable information that can be used to contact or identify you (“Personal Data”). Personally, identifiable information may include, but is not limited to:</p><ul><li>Address, State, Province, ZIP/Postal code, City</li><li>Cookies and Usage Data</li></ul><h3>Usage Data</h3><p>We may also collect information that your browser sends whenever you visit our Service or when you access the Service by or through a mobile device (“Usage Data”).</p><p>This Usage Data may include information such as your computer’s Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that you visit, the time and date of your visit, the time spent on those pages, unique device identifiers and other diagnostic data.</p><p>When you access the Service by or through a mobile device, this Usage Data may include information such as the type of mobile device you use, your mobile device unique ID, the IP address of your mobile device, your mobile operating system, the type of mobile Internet browser you use, unique device identifiers and other diagnostic data.</p><h3>Tracking &amp; Cookies Data</h3><p>We use cookies and similar tracking technologies to track the activity on our Service and hold certain information.</p><p>Cookies are files with a small amount of data that may include an anonymous unique identifier. Cookies are sent to your browser from a website and stored on your device. Tracking technologies also used are beacons, tags, and scripts to collect and track information and to improve and analyze our Service.</p><p>You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent. However, if you do not accept cookies, you may not be able to use some portions of our Service.</p><p>Examples of Cookies we use:</p><ul><li><strong>Session Cookies.</strong> We use Session Cookies to operate our Service.</li><li><strong>Preference Cookies.</strong> We use Preference Cookies to remember your preferences and various settings.</li><li><strong>Security Cookies.</strong> We use Security Cookies for security purposes.</li></ul><h3>Use of Data</h3><p>news.ly uses the collected data for various purposes:</p><ul><li>To provide and maintain the Service</li><li>To notify you about changes to our Service</li><li>To allow you to participate in interactive features of our Service when you choose to do so</li><li>To provide customer care and support</li><li>To provide analysis or valuable information so that we can improve the Service</li><li>To monitor the usage of the Service</li><li>To detect, prevent and address technical issues</li></ul><h3>Transfer Of Data</h3><p>Your information, including Personal Data, may be transferred to — and maintained on — computers located outside of your state, province, country, or other governmental jurisdiction where the data protection laws may differ from those from your jurisdiction.</p><p>If you are located outside India and choose to provide information to us, please note that we transfer the data, including Personal Data, to India and process it there.</p><p>Your consent to this Privacy Policy followed by your submission of such information represents your agreement to that transfer.</p><p>news.ly will take all steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of your data and other personal information.</p><h3>Disclosure Of Data</h3><h3>Legal Requirements</h3><p>news.ly may disclose your Personal Data in the good faith belief that such action is necessary to:</p><ul><li>To comply with a legal obligation</li><li>To protect and defend the rights or property of news.ly</li><li>To prevent or investigate possible wrongdoing in connection with the Service</li><li>To protect the personal safety of users of the Service or the public</li><li>To protect against legal liability</li></ul><h3>Security Of Data</h3><p>The security of your data is important to us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While we strive to use commercially acceptable means to protect your Personal Data, we cannot guarantee its absolute security.</p><h3>Service Providers</h3><p>We may employ third-party companies and individuals to facilitate our Service (“Service Providers”), to provide the Service on our behalf, to perform Service-related services, or to assist us in analyzing how our Service is used.</p><p>These third parties have access to your Personal Data only to perform these tasks on our behalf and are obligated not to disclose or use it for any other purpose.</p><h3>Analytics</h3><p>We may use third-party Service Providers to monitor and analyze the use of our Service.</p><ul><li><strong>Google Analytics</strong></li><li>Google Analytics is a web analytics service offered by Google that tracks and reports website traffic. Google uses the data collected to track and monitor the use of our Service. This data is shared with other Google services. Google may use the collected data to contextualize and personalize the ads of its own advertising network.</li><li>For more information on the privacy practices of Google, please visit the Google Privacy &amp; Terms web page: <a href="https://policies.google.com/privacy?hl=en">https://policies.google.com/privacy?hl=en</a></li></ul><h3>Links To Other Sites</h3><p>Our Service may contain links to other sites that are not operated by us. If you click on a third-party link, you will be directed to that third party’s site. We strongly advise you to review the Privacy Policy of every site you visit.</p><p>We have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.</p><h3>Children’s Privacy</h3><p>Our Service does not address anyone under the age of 18 (“Children”).</p><p>We do not knowingly collect personally identifiable information from anyone under the age of 18. If you are a parent or guardian and you are aware that your Children have provided us with Personal Data, please contact us. If we become aware that we have collected Personal Data from children without verification of parental consent, we take steps to remove that information from our servers.</p><h3>Changes To This Privacy Policy</h3><p>We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page.</p><p>We will let you know via email and/or a prominent notice on our Service, prior to the change becoming effective and update the “effective date” at the top of this Privacy Policy.</p><p>You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.</p><h3>Contact Us</h3><p>If you have any questions about this Privacy Policy, please contact us:</p><ul><li>By email: sethy.soumyaranjan@gmail.com</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=783f5684fcf0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native Over-the-Air(OTA) Updates using Firebase]]></title>
            <link>https://medium.com/@soumyasethy/react-native-over-the-air-ota-updates-using-firebase-34fe13614101?source=rss-3741046cf8b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/34fe13614101</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[product-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Soumya Ranjan Sethy]]></dc:creator>
            <pubDate>Mon, 01 Jun 2020 15:54:55 GMT</pubDate>
            <atom:updated>2020-06-02T01:06:38.679Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*EMopClOU-9g_n1gvd8qJHA.png" /></figure><h3>React Native Over-the-Air(OTA) Updates with Firebase</h3><h4>The biggest benefit to choosing React Native to build your mobile apps.</h4><p>I will be using my previous article’s code to continue setup for OTA update as well which is simply created using Android Studio and later React Native added manually. This is also same for existing React Native App as well.</p><h4>Key Features ,</h4><ol><li>Feature Release Over the Air without going through legacy deployment process( No Apk update, only download new JS Bundle at runtime once and cache it for next time use)</li><li>Quickly resolve bugs and deploy quick updates.</li><li>On Demand Download JS Bundle.</li><li>Support multiple bundles in same App.</li><li>Can build Serverless App directly and use Backend to only simply dump data. For example, Your app’s Feedback/FAQ Screens many more. Change data and UI anytime on the go.</li><li>If you are a B2B or B2C product based company dealing with many business logic then definitely this architecture can save your lot of effort of changing business logic on the go.</li><li>Can easily switch between development environment (loading local bundle) to Remote Bundle.</li></ol><blockquote>Note : Any Native side update which will impact on React Native Bundle will have to go for legacy deployment process.</blockquote><h3>* 1. Create Firebase Project</h3><ol><li>go to <a href="https://www.firebase.com/">https://www.firebase.com</a> and Click on <strong>Go to console</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQU60j-1KlzGhGZTQzR_yw.png" /></figure><p>2. Tap on <strong>Add project</strong> to Create a new project on Firebase</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ky2s6G3bHoJcW4oR_8HPyg.png" /></figure><p>3. I have named this Firebase Project name as <strong>RemoteBundleUpdate</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3L17VLQw8tF-Tnf80vrbCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CnAy2qrMpk0d-SL6WjZvGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJvIFeoWL4dhffZUbRn-9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*siiruF_MIaLiHlhsxg3VWw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VYW3m-kIQWIntYiFZzeIQ.png" /></figure><h3>* 2. Firebase Remote Config via Android Studio</h3><p>Set up Remote Config to change the behavior and appearance of your app without publishing an app update</p><h4>1. Choose Android Studio -&gt; Tools -&gt; Firebase</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2_QMnJcN-Fxe-rS1Tuvkng.png" /></figure><h4>2. In right side Firebase setup module will popup. Then choose Remote Config.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e84_NFUeNliWzSwfONy4CA.png" /></figure><h4>3. Select <strong>Set up Firebase Remote Config</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xjbOX5mCoVhOx0wGnsm0dg.png" /></figure><h4><strong>4. This should open up Firebase Remote Config setup module</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fmF8XFyWJSrEgJ3Xo2pv0g.png" /></figure><h4><strong>5. Now select Connect to Firebase</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TVmllcE5Y-m5yi5BTA5PWQ.png" /></figure><h4><strong>6. </strong>Choose you project in Firebase which we created earlier in Web browser.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZAcSskiZfrELOruSYl1VEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mw6g1s3vfwgC4un5u7vOsA.png" /></figure><h4>7. When you see above message in your browser, that means you have successfully connected your app to Firebase console app.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kJicQCZz9wL7EQskhGpSfA.png" /></figure><h4>8. Now tap on Add Remote Config to your app</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkPEIlKY34I9EoZcJjAXPg.png" /></figure><h4>9. Now <strong>Accept Changes</strong>. It will automatically add Firebase Remote Config dependency.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eb52NCrpOxNpukqwo3mNFg.png" /></figure><h3>* 3. Manual Setup Firebase Remote Config or Verify above setup</h3><h4><strong>1. build.gradle(:apps).</strong></h4><p>Add dependency of Firebase Remote Config and google-services plugin</p><pre>dependencies <strong>{<br>    ...</strong></pre><pre><strong>    </strong><em>//firebase<br>    </em>implementation <strong>&#39;com.google.firebase:firebase-config:19.1.4&#39;</strong></pre><pre><strong>    <em>...</em></strong><br><strong>}</strong></pre><pre><em>...</em><br>apply <strong>plugin</strong>: <strong>&#39;com.google.gms.google-services&#39;</strong>;</pre><pre>//before this line<br>applyNativeModulesAppBuildGradle(project)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cpqIaZv_miFjvvRXAAlcTg.png" /></figure><h4><strong>2. build.gradle(project root level)</strong></h4><pre>dependencies <strong>{<br>    ...</strong></pre><pre><strong>    </strong>classpath <strong>&#39;com.google.gms:google-services:4.3.3&#39;<br><br>    </strong><em>...<br></em><strong>}</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rh_Zg1yhJ9vqSBFhRAhnKA.png" /></figure><h4>3. Add <em>google-service.json</em> from Firebase</h4><blockquote>Add google-service.json under “ReactNativeSetupAndroid(root directory)-&gt;android -&gt; app -&gt; google-services.json”.</blockquote><blockquote><strong>Refer below structure</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*3Z9vgGZ_YLd3TvqjrFDr9g.png" /></figure><h3>* 4. Dependency Setup in Android</h3><p>I have used <strong>PR Downloader</strong>, A file downloader library for Android with pause and resume support</p><p>You can read more about about <a href="https://github.com/MindorksOpenSource/PRDownloader">here</a></p><h4>Add PR Downloader to dependencies of build.gradle(:app)</h4><pre>dependencies <strong>{<br>    ...</strong></pre><pre><strong>    </strong><em>//PR Downloader<br>    </em>implementation <strong>&#39;com.mindorks.android:prdownloader:0.6.0&#39;<br><br>    ...</strong><br><strong>}</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60Z4Rjbgtlav-IWw6wFMHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*LzqlRycEqQi7AkUMxXsuLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NoxuSuy0-6EFJYZd0VwMEw.png" /></figure><h3>* 5. Native Android Configuration</h3><h4><strong>1. Designing Layout Screen “<em>activity_main.xml”</em></strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*SimlkIAB4fpB6avSu8O3Ww.png" /></figure><p><strong>code for above design </strong><em>main_activity.xml</em></p><pre><em>&lt;?</em><strong>xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;</strong><em>?&gt;<br></em>&lt;<strong>androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    android:background=&quot;@android:color/white&quot;<br>    tools:context=&quot;.MainActivity&quot;</strong>&gt;<br><br>    &lt;<strong>TextView<br>        android:id=&quot;@+id/textView&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;0dp&quot;<br>        android:layout_marginTop=&quot;16dp&quot;<br>        android:text=&quot;Please Wait...&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/progressBar&quot; </strong>/&gt;<br><br>    &lt;<strong>ProgressBar<br>        android:id=&quot;@+id/progressBar&quot;<br>        style=&quot;?android:attr/progressBarStyleHorizontal&quot;<br>        android:layout_width=&quot;200dp&quot;<br>        android:layout_height=&quot;16dp&quot;<br>        android:layout_marginTop=&quot;24dp&quot;<br>        android:progress=&quot;0&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/imageView2&quot; </strong>/&gt;<br><br>    &lt;<strong>TextView<br>        android:id=&quot;@+id/textView2&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:text=&quot;Slow Internet Connection?&quot;<br>        app:layout_constraintBottom_toTopOf=&quot;@+id/skipButton&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot; </strong>/&gt;<br><br>    &lt;<strong>Button<br>        android:id=&quot;@+id/skipButton&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginBottom=&quot;32dp&quot;<br>        android:background=&quot;@android:color/transparent&quot;<br>        android:text=&quot;Skip&quot;<br>        android:textColor=&quot;@android:color/holo_blue_dark&quot;<br>        android:textStyle=&quot;bold&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot; </strong>/&gt;<br><br>    &lt;<strong>ImageView<br>        android:id=&quot;@+id/imageView2&quot;<br>        android:layout_width=&quot;100dp&quot;<br>        android:layout_height=&quot;100dp&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintHorizontal_bias=&quot;0.498&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot;<br>        app:srcCompat=&quot;@mipmap/ic_launcher_round&quot; </strong>/&gt;<br><br>&lt;/<strong>androidx.constraintlayout.widget.ConstraintLayout</strong>&gt;</pre><h4>2. Adding Functionality for above design in MainActivity.java</h4><p>Modify your MainActivity.java.</p><ul><li>Add Progressbar to see Download Status.</li><li>Add Skip Button to Skip Downloading Bundle if slow internet or user don’t want to wait.</li><li>Add TextView to log all message like Connecting, Downloading started, paused, Cancelled or Percentage.</li></ul><pre><strong>package </strong>com.soumya.sethy.reactnativesetupandroid;<br><br><strong>import </strong>android.content.Intent;<br><strong>import </strong>android.os.Bundle;<br><strong>import </strong>android.view.View;<br><strong>import </strong>android.widget.Button;<br><strong>import </strong>android.widget.ProgressBar;<br><strong>import </strong>android.widget.TextView;<br><strong>import </strong>androidx.appcompat.app.AppCompatActivity;<br><br><em>/**<br> * Created by Soumya Ranjan Sethy &lt;sethy.soumyaranjan@gmail.com&gt;<br> */<br></em><strong>public class </strong>MainActivity <strong>extends </strong>AppCompatActivity {<br>    <strong>private static </strong>MainActivity <em>mainActivity</em>;<br>    <strong>public static </strong>MainActivity getActivity() {<br>        <strong>return </strong><em>mainActivity</em>;<br>    }<br><br>    ProgressBar <strong>progressBar</strong>;<br>    Utils <strong>utils</strong>;<br>    Button <strong>skipButton</strong>;<br>    TextView <strong>textView</strong>;<br><br>    @Override<br>    <strong>protected void </strong>onCreate(Bundle savedInstanceState) {<br>        <strong>super</strong>.onCreate(savedInstanceState);<br>        setContentView(R.layout.<strong><em>activity_main</em></strong>);<br>        <em>mainActivity </em>= <strong>this</strong>;<br><br>        <strong>progressBar </strong>= findViewById(R.id.<strong><em>progressBar</em></strong>);<br>        <strong>skipButton </strong>= findViewById(R.id.<strong><em>skipButton</em></strong>);<br>        <strong>textView </strong>= findViewById(R.id.<strong><em>textView</em></strong>);<br><br>        <em>//initialize Utils Class<br>        </em><strong>utils </strong>= <strong>new </strong>Utils();<br>        <em>//sync with Server<br>        </em><strong>utils</strong>.syncWithServer();<br><br>        <em>//skip update manually<br>        </em><strong>skipButton</strong>.setOnClickListener(<strong>new </strong>View.OnClickListener() {<br>            @Override<br>            <strong>public void </strong>onClick(View v) {<br>                startRNPage();<br>            }<br>        });<br>    }<br><br><br>    <strong>public void </strong>startRNPage() {<br>        Intent intent = <strong>new </strong>Intent(<strong>this</strong>, ReactNativeActivity.<strong>class</strong>);<br>        startActivity(intent);<br>        finish();<br>    }<br>}</pre><h4>3. Setup Shared Preference Class</h4><p>Create <strong>SharedPref.java</strong> and add below code</p><p>This class will help to access Shared Preference of Android which will help to store all the details regarding React Native Bundle Name, Url &amp; Path locally.</p><pre><strong>package </strong>com.soumya.sethy.reactnativesetupandroid;<br><br><strong>import </strong>android.content.Context;<br><strong>import </strong>android.content.SharedPreferences;<br><strong>import </strong>android.preference.PreferenceManager;<br><br><em>/**<br> * Created by Soumya Ranjan Sethy &lt;sethy.soumyaranjan@gmail.com&gt;<br> */<br></em><strong>public class </strong>SharedPref {<br><br>    <strong>private </strong>SharedPreferences <strong>preferences</strong>;<br><br>    <strong>public </strong>SharedPref(Context appContext) {<br>        <strong>preferences </strong>= PreferenceManager.<em>getDefaultSharedPreferences</em>(appContext);<br>    }<br><br>    <strong>public </strong>String getString(String key) {<br>        <strong>return preferences</strong>.getString(key, <strong>&quot;&quot;</strong>);<br>    }<br><br>    <strong>public void </strong>putString(String key, String value) {<br>        checkForNull(key);<br>        checkForNull(value);<br>        <strong>preferences</strong>.edit().putString(key, value).apply();<br>    }<br><br>    <strong>public void </strong>clear() {<br>        <strong>preferences</strong>.edit().clear().apply();<br>    }<br><br>    <strong>public void </strong>checkForNull(String string) {<br>        <strong>if </strong>(string == <strong>null</strong>) {<br>            <strong>throw new </strong>NullPointerException();<br>        }<br>    }<br><br>}</pre><h4>4. Setup Constants Class</h4><p>This class will hold all Shared Preference keys, Setter/Getter Methods using SharedPref class, Firebase Remote Config keys, File Downloadable directory path and Bundle File name.</p><p>Create <strong>Constants.java</strong> and add below code</p><pre><strong>package </strong>com.soumya.sethy.reactnativesetupandroid;<br><br><strong>import </strong>android.os.Environment;<br><strong>import </strong>androidx.core.content.ContextCompat;<br><strong>import </strong>java.io.File;<br><br><em>/**<br> * Created by Soumya Ranjan Sethy &lt;sethy.soumyaranjan@gmail.com&gt;<br> */<br></em><strong>public final class </strong>Constants {<br><br>    <strong>public static final </strong>String <strong><em>DEFAULT_APP_NAME </em></strong>= <strong>&quot;MyReactNativeApp&quot;</strong>;<br>    <strong>public static final </strong>String <strong><em>DEFAULT_BUNDLE_PATH </em></strong>= <strong>&quot;assets://index.android.bundle&quot;</strong>;<br><br>    <strong>public static final </strong>String <strong><em>FIREBASE_ACTIVE_APP_NAME </em></strong>= <strong>&quot;active_app_name&quot;</strong>;<br>    <strong>public static final </strong>String <strong><em>FIREBASE_ACTIVE_BUNDLE_NAME </em></strong>= <strong>&quot;active_bundle_name&quot;</strong>;<br><br>    <strong>public static final </strong>String <strong><em>BUNDLE_NAME </em></strong>= <strong>&quot;BUNDLE_NAME&quot;</strong>;<br>    <strong>public static final </strong>String <strong><em>BUNDLE_URL </em></strong>= <strong>&quot;BUNDLE_URL&quot;</strong>;<br>    <strong>public static final </strong>String <strong><em>BUNDLE_PATH </em></strong>= <strong>&quot;BUNDLE_PATH&quot;</strong>;<br><br>    <strong>public static final </strong>String <strong><em>GET_BUNDLE_NAME </em></strong>= MainApplication.<em>getMainApplication</em>().getSharedPref().getString(Constants.<strong><em>BUNDLE_NAME</em></strong>);<br>    <strong>public static final </strong>String <strong><em>GET_BUNDLE_URL </em></strong>= MainApplication.<em>getMainApplication</em>().getSharedPref().getString(Constants.<strong><em>BUNDLE_URL</em></strong>);<br>    <strong>public static final </strong>String <strong><em>GET_BUNDLE_PATH </em></strong>= MainApplication.<em>getMainApplication</em>().getSharedPref().getString(Constants.<strong><em>BUNDLE_PATH</em></strong>);<br><br>    <strong>public static final void </strong>SET_BUNDLE_NAME(String bundleName) {<br>        MainApplication.<em>getMainApplication</em>().getSharedPref().putString(Constants.<strong><em>BUNDLE_NAME</em></strong>, bundleName);<br>    }<br>    <strong>public static final void </strong>SET_BUNDLE_URL(String bundleURL) {<br>        MainApplication.<em>getMainApplication</em>().getSharedPref().putString(Constants.<strong><em>BUNDLE_URL</em></strong>, bundleURL);<br>    }<br>    <strong>public static final void </strong>SET_BUNDLE_PATH(String bundlePath) {<br>        MainApplication.<em>getMainApplication</em>().getSharedPref().putString(Constants.<strong><em>BUNDLE_PATH</em></strong>, bundlePath);<br>    }<br><br>    <strong>public static final </strong>String <strong><em>INDEX_ANDROID_BUNDLE </em></strong>= <strong>&quot;index.android.bundle&quot;</strong>;<br>    <strong>public static </strong>String GET_ROOT_DIR_PATH() {<br>        <strong>if </strong>(Environment.<strong><em>MEDIA_MOUNTED</em></strong>.equals(Environment.<em>getExternalStorageState</em>())) {<br>            File file = ContextCompat.<em>getExternalFilesDirs</em>(MainApplication.<em>getMainApplication</em>(), <strong>null</strong>)[0];<br>            <strong>return </strong>file.getAbsolutePath();<br>        } <strong>else </strong>{<br>            <strong>return </strong>MainApplication.<em>getMainApplication</em>().getFilesDir().getAbsolutePath();<br>        }<br>    }<br>}</pre><h4>5. Setup <strong>MainApplication</strong> Class</h4><p>This class will hold ReactNativeHost custom configuration for packages which are not supporting auto linking yet, dynamic path for react-native bundle file loading from SharedPref class using Constant class methods.</p><p>Modify your <strong>MainApplication.java</strong> and add below code</p><pre><strong>package </strong>com.soumya.sethy.reactnativesetupandroid;<br><br><strong>import </strong>android.app.Application;<br><strong>import </strong>com.facebook.react.PackageList;<br><strong>import </strong>com.facebook.react.ReactApplication;<br><strong>import </strong>com.facebook.react.ReactNativeHost;<br><strong>import </strong>com.facebook.react.ReactPackage;<br><strong>import </strong>com.facebook.soloader.SoLoader;<br><strong>import </strong>java.util.List;<br><br><em>/**<br> * Created by Soumya Ranjan Sethy &lt;sethy.soumyaranjan@gmail.com&gt;<br> */<br></em><strong>public class </strong>MainApplication <strong>extends </strong>Application <strong>implements </strong>ReactApplication {<br>    SharedPref <strong>sharedPref</strong>;<br>    <strong>public static </strong>MainApplication <em>mainApplication</em>;<br><br>    <strong>public static </strong>MainApplication getMainApplication() {<br>        <strong>return </strong><em>mainApplication</em>;<br>    }<br><br>    <strong>public </strong>SharedPref getSharedPref() {<br>        <strong>return sharedPref</strong>;<br>    }<br><br><br>    <strong>private final </strong>ReactNativeHost <strong>mReactNativeHost </strong>=<br>            <strong>new </strong>ReactNativeHost(<strong>this</strong>) {<br>                @Override<br>                <strong>public boolean </strong>getUseDeveloperSupport() {<br>                    <strong>return </strong>BuildConfig.<strong><em>DEBUG</em></strong>;<br>                }<br><br>                @Override<br>                <strong>protected </strong>List&lt;ReactPackage&gt; getPackages() {<br>                    @SuppressWarnings(<strong>&quot;UnnecessaryLocalVariable&quot;</strong>)<br>                    List&lt;ReactPackage&gt; packages = <strong>new </strong>PackageList(<strong>this</strong>).getPackages();<br>                    <em>// Packages that cannot be autolinked yet can be added manually here, for example:<br>                    // packages.add(new MyReactNativePackage());<br>                    </em><strong>return </strong>packages;<br>                }<br><br>                @Override<br>                <strong>protected </strong>String getJSMainModuleName() {<br>                    <strong>return &quot;index&quot;</strong>;<br>                }<br><br>                @Override<br>                <strong>protected </strong>String getJSBundleFile() {<br>                    String bundlePath = getLastUpdatedBundlePath();<br>                    <strong>return </strong>bundlePath;<br>                }<br>            };<br><br>    @Override<br>    <strong>public </strong>ReactNativeHost getReactNativeHost() {<br>        <strong>return mReactNativeHost</strong>;<br>    }<br><br>    @Override<br>    <strong>public void </strong>onCreate() {<br>        <strong>super</strong>.onCreate();<br>        <strong>this</strong>.<em>mainApplication </em>= <strong>this</strong>;<br>        SoLoader.<em>init</em>(<strong>this</strong>, <strong>false</strong>);<br>        <strong>sharedPref </strong>= <strong>new </strong>SharedPref(getApplicationContext());<br>    }<br><br>    <strong>private </strong>String getLastUpdatedBundlePath() {<br>        <strong>try </strong>{<br>            <strong>return </strong>Constants.<strong><em>GET_BUNDLE_PATH</em></strong>;<br>        } <strong>catch </strong>(Error error) {<br>            <strong>return </strong>Constants.<strong><em>DEFAULT_BUNDLE_PATH</em></strong>;<br>        }<br>    }<br>}</pre><h4>6. Setup Utils Class</h4><p>This class is responsible to fetch latest activated appname and activated bundle name and downloadable url from Firebase everytime you start the app. This class is being initiated and used in MainActivity.java</p><p>It uses MainActivity’s Progressbar and TextView to update process status continuously.</p><p>Before downloading bundle, it compares with locally stored bundle url and Firebase’s activated bundle url. If any diff found then only it will trigger downloading new bundle and continues to save the new url, path and name of bundle in SharedPref locally for next time check.</p><p>Add Utils.java and paste below code</p><pre><strong>package </strong>com.soumya.sethy.reactnativesetupandroid;<br><br><strong>import </strong>android.content.Context;<br><strong>import </strong>android.widget.ProgressBar;<br><strong>import </strong>android.widget.TextView;<br><strong>import </strong>androidx.annotation.NonNull;<br><strong>import </strong>com.downloader.Error;<br><strong>import </strong>com.downloader.OnCancelListener;<br><strong>import </strong>com.downloader.OnDownloadListener;<br><strong>import </strong>com.downloader.OnPauseListener;<br><strong>import </strong>com.downloader.OnProgressListener;<br><strong>import </strong>com.downloader.OnStartOrResumeListener;<br><strong>import </strong>com.downloader.PRDownloader;<br><strong>import </strong>com.downloader.PRDownloaderConfig;<br><strong>import </strong>com.downloader.Progress;<br><strong>import </strong>com.google.android.gms.tasks.OnCompleteListener;<br><strong>import </strong>com.google.android.gms.tasks.Task;<br><strong>import </strong>com.google.firebase.remoteconfig.FirebaseRemoteConfig;<br><br><em>/**<br> * Created by Soumya Ranjan Sethy &lt;sethy.soumyaranjan@gmail.com&gt;<br> */<br><br></em><strong>public class </strong>Utils {<br>    <strong>private </strong>FirebaseRemoteConfig <strong>firebaseRemoteConfig</strong>;<br>    <strong>private </strong>Context <strong>ctx</strong>;<br>    <strong>private </strong>ProgressBar <strong>progressBar</strong>;<br>    <strong>private </strong>TextView <strong>textView</strong>;<br>    <strong>private </strong>String <strong>firebaseActiveBundle</strong>, <strong>firebaseAppName</strong>, <strong>downloadUrl</strong>;<br><br>    Utils() {<br>        <strong>this</strong>.<strong>ctx </strong>= MainActivity.<em>getActivity</em>();<br>        <strong>this</strong>.<strong>progressBar </strong>= MainActivity.<em>getActivity</em>().<strong>progressBar</strong>;<br>        <strong>this</strong>.<strong>textView </strong>= MainActivity.<em>getActivity</em>().<strong>textView</strong>;<br>        setupConstants();<br>    }<br><br>    <strong>private void </strong>setupConstants() {<br>        <strong>firebaseRemoteConfig </strong>= FirebaseRemoteConfig.<em>getInstance</em>();<br>        <strong>firebaseAppName </strong>= <strong>firebaseRemoteConfig</strong>.getString(Constants.<strong><em>FIREBASE_ACTIVE_APP_NAME</em></strong>);<br>        <strong>firebaseActiveBundle </strong>= <strong>firebaseRemoteConfig</strong>.getString(Constants.<strong><em>FIREBASE_ACTIVE_BUNDLE_NAME</em></strong>);<br>        <em>//fetch activeBundle and it&#39;s url from firebase at runtime<br>        </em><strong>downloadUrl </strong>= <strong>firebaseRemoteConfig</strong>.getString(<strong>firebaseActiveBundle</strong>);<br>        <strong>downloadUrl </strong>= <strong>downloadUrl</strong>.replaceAll(<strong>&quot;\&quot;&quot;</strong>, <strong>&quot;&quot;</strong>);<br>    }<br><br>    <strong>public void </strong>syncWithServer() {<br>        <strong>firebaseRemoteConfig</strong>.fetch(0)<br>                .addOnCompleteListener(MainActivity.<em>getActivity</em>(), <strong>new </strong>OnCompleteListener&lt;Void&gt;() {<br>                    @Override<br>                    <strong>public void </strong>onComplete(@NonNull Task&lt;Void&gt; task) {<br>                        <strong>if </strong>(task.isSuccessful()) {<br>                            <strong>firebaseRemoteConfig</strong>.activateFetched();<br>                            <strong>if </strong>(isUpdateRequired()) {<br>                                triggerDownloadBundle();<br>                            } <strong>else </strong>{<br>                                MainActivity.<em>getActivity</em>().startRNPage();<br>                            }<br>                        }<br>                    }<br>                });<br>    }<br><br>    <strong>private boolean </strong>isUpdateRequired() {<br>        <strong>return </strong>!<strong>downloadUrl</strong>.equalsIgnoreCase(Constants.<strong><em>GET_BUNDLE_URL</em></strong>);<br>    }<br><br>    <strong>private void </strong>triggerDownloadBundle() {<br>        PRDownloaderConfig config = PRDownloaderConfig.<em>newBuilder</em>()<br>                .setDatabaseEnabled(<strong>true</strong>) <em>// Enabling database for resume support even after the application is killed:<br>                </em>.build();<br>        PRDownloader.<em>initialize</em>(<strong>ctx</strong>, config);<br><br>        PRDownloader.<em>download</em>(<strong>downloadUrl</strong>, Constants.<em>GET_ROOT_DIR_PATH</em>(), Constants.<strong><em>INDEX_ANDROID_BUNDLE</em></strong>)<br>                .build()<br>                .setOnStartOrResumeListener(<strong>new </strong>OnStartOrResumeListener() {<br>                    @Override<br>                    <strong>public void </strong>onStartOrResume() {<br>                        <strong>textView</strong>.setText(<strong>&quot;Downloading...&quot;</strong>);<br>                    }<br>                })<br>                .setOnPauseListener(<strong>new </strong>OnPauseListener() {<br>                    @Override<br>                    <strong>public void </strong>onPause() {<br>                        <strong>textView</strong>.setText(<strong>&quot;Downloading paused&quot;</strong>);<br>                    }<br>                })<br>                .setOnCancelListener(<strong>new </strong>OnCancelListener() {<br>                    @Override<br>                    <strong>public void </strong>onCancel() {<br>                        <strong>textView</strong>.setText(<strong>&quot;Downloading cancelled&quot;</strong>);<br>                    }<br>                })<br>                .setOnProgressListener(<strong>new </strong>OnProgressListener() {<br>                    @Override<br>                    <strong>public void </strong>onProgress(Progress progress) {<br>                        <strong>long </strong>progressPercent = progress.<strong>currentBytes </strong>* 100 / progress.<strong>totalBytes</strong>;<br>                        <strong>progressBar</strong>.setProgress((<strong>int</strong>) progressPercent);<br>                        <strong>textView</strong>.setText(<strong>&quot;Downloading &quot; </strong>+ (<strong>int</strong>) progressPercent + <strong>&quot;%&quot;</strong>);<br>                    }<br>                })<br>                .start(<strong>new </strong>OnDownloadListener() {<br>                    @Override<br>                    <strong>public void </strong>onDownloadComplete() {<br>                        <strong>textView</strong>.setText(<strong>&quot;Starting...&quot;</strong>);<br>                        updateBundleDetails(<strong>firebaseAppName</strong>, Constants.<em>GET_ROOT_DIR_PATH</em>() + <strong>&quot;/&quot; </strong>+ Constants.<strong><em>INDEX_ANDROID_BUNDLE</em></strong>, <strong>downloadUrl</strong>);<br>                        MainActivity.<em>getActivity</em>().startRNPage();<br>                    }<br><br>                    @Override<br>                    <strong>public void </strong>onError(Error error) {<br>                        <strong>textView</strong>.setText(<strong>&quot;Downloading Failed&quot;</strong>);<br>                        MainActivity.<em>getActivity</em>().startRNPage();<br>                    }<br>                });<br>    }<br><br>    <strong>private void </strong>updateBundleDetails(String newBundleName, String newBundlePath, String newBundleUrl) {<br>        <em>// Storing data into SharedPreferences<br>        </em>Constants.<em>SET_BUNDLE_NAME</em>(newBundleName);<br>        Constants.<em>SET_BUNDLE_PATH</em>(newBundlePath);<br>        Constants.<em>SET_BUNDLE_URL</em>(newBundleUrl);<br>    }<br>}</pre><h4>7. Setup ReactNativeActivity Class</h4><p>This Activity class will be entry point to trigger the React Native and make sure to provide correct Main Component Name. You can check the component name in index.js or Package.json name of the bundle.</p><p>Modify ReactNativeActivity.java like below</p><pre><strong>package </strong>com.soumya.sethy.reactnativesetupandroid;<br><br><strong>import </strong>com.facebook.react.ReactActivity;<br><br><em>/*<br> * Created by Soumya Ranjan Sethy &lt;sethy.soumyaranjan@gmail.com&gt;<br> */<br></em><strong>public class </strong>ReactNativeActivity <strong>extends </strong>ReactActivity {<br>    @Override<br>    <strong>protected </strong>String getMainComponentName() {<br>        <strong>try </strong>{<br>            <strong>return </strong>Constants.<strong><em>GET_BUNDLE_NAME</em></strong>;<br>        } <strong>catch </strong>(Error error) {<br>            <strong>return </strong>Constants.<strong><em>DEFAULT_APP_NAME</em></strong>;<br>        }<br>    }<br>}</pre><h3>*6. React Native Configuration</h3><h4>1. Update Package.json</h4><pre>{<br>  &quot;name&quot;: &quot;<strong>MyReactNativeApp</strong>&quot;,<br>  &quot;version&quot;: &quot;0.0.1&quot;,<br>  &quot;private&quot;: true,<br>  &quot;scripts&quot;: {<br>    &quot;<strong>start</strong>&quot;: &quot;yarn react-native start&quot;,<br>    &quot;<strong>android-run</strong>&quot;: &quot;yarn react-native run-android&quot;,<br>    &quot;<strong>android-reverse-tcp</strong>&quot;: &quot;adb reverse tcp:8081 tcp:8081&quot;,<br>    &quot;<strong>android-build-bundle</strong>&quot;: &quot;react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res&quot;,<br>    &quot;<strong>android-export-bundle</strong>&quot;: &quot;mkdir -p android/output &amp;&amp; react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/output/index.android.bundle --assets-dest android/app/src/main/res&quot;<br>  },<br>  &quot;dependencies&quot;: {<br>    &quot;react&quot;: &quot;^16.13.1&quot;,<br>    &quot;react-native&quot;: &quot;^0.62.2&quot;<br>  }<br>}</pre><h4>2. Running Package.json Scripts</h4><blockquote>Note: Run all the cmd in root directory of your project.</blockquote><ol><li>To start Metro Bundler for local development.</li></ol><pre>$yarn start</pre><p>2. To run Android App run</p><pre>$yarn android-run</pre><p>3. If you are getting <strong>Could not connect to development server</strong> even after start metro bundler.</p><pre>$yarn android-reverse-tcp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*y7qgXfEAby9AGfRFXf-K3A.png" /></figure><p>4. Creating a release build.</p><pre>$yarn android-build-bundle</pre><p>This will check and create <strong>android/app/src/main/assets </strong>folder if not exists and copy the default <strong>index.android.bundle</strong> file to it. This file will be the default bundle for Build (release apk file) If app runs offline or no bundle found on firebase.</p><p>5. Export <strong>index.android.bundle</strong> file to android/output so that it will be easy to copy and upload to Firebase directly.</p><pre>$yarn android-export-bundle</pre><h3>* 7. Testing OTA</h3><h4>1. Default Development</h4><ol><li>Add Text in index.js “Hello, world from React Native”. This will be Starting page of React Native.</li></ol><pre><strong>import <em>React </em>from &quot;react&quot;</strong>;<br><strong>import </strong>{ <strong>AppRegistry</strong>, <strong>StyleSheet</strong>, <strong>Text</strong>, <strong>View </strong>} <strong>from &quot;react-native&quot;</strong>;<br><br><strong>class </strong>HelloWorld <strong>extends </strong>React.Component {<br>  render() {<br>    <strong>return </strong>(<br>      &lt;<strong>View style=</strong>{styles.<strong>container</strong>}&gt;<br>        &lt;<strong>Text style=</strong>{styles.<strong>hello</strong>}&gt;Hello, World from React Native&lt;/<strong>Text</strong>&gt;<br>      &lt;/<strong>View</strong>&gt;<br>    );<br>  }<br>}<br><strong>var </strong>styles = <strong>StyleSheet</strong>.create({<br>  <strong>container</strong>: {<br>    <strong>flex</strong>: 1,<br>    <strong>justifyContent</strong>: <strong>&quot;center&quot;<br>  </strong>},<br>  <strong>hello</strong>: {<br>    <strong>fontSize</strong>: 20,<br>    <strong>textAlign</strong>: <strong>&quot;center&quot;</strong>,<br>    <strong>margin</strong>: 10<br>  }<br>});<br><br><strong>AppRegistry</strong>.registerComponent(<strong>&quot;MyReactNativeApp&quot;</strong>, () =&gt; HelloWorld);</pre><p>2. Run the Metro builder and check the current code how it looks</p><blockquote>Note: Run all the cmd in root directory of your project.</blockquote><pre>$yarn start</pre><p>3. Create release-bundle (<strong>android/app/src/main/assets</strong>)</p><pre>$yarn <strong>android-build-bundle</strong></pre><p>4. You can also the run the app</p><pre>$yarn android-run</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*eYsXqcdq1R6CF_Xs5ogJqA.gif" /></figure><h4>2. Create two more dummy JS Bundle for Firebase</h4><ol><li>Add new Text to index.js for Testing purposes</li></ol><pre>&lt;<strong>Text style=</strong>{styles.<strong>hello</strong>}&gt;This is coming from Firebase RN Bundle 1 &lt;/<strong>Text</strong>&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HM11mTzYxGMfF9Zar4MX1w.png" /></figure><p>2. Create only react-native bundle (<strong>index.android.bundl</strong>e) to upload to Firebase (<strong>android/output</strong>)</p><pre>$yarn <strong>android-export-bundle</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VMyN96LzFEwZr9PZ_wGA1Q.gif" /></figure><p>3. Rename file <strong>index.android.bundl</strong>e to <strong>index.android1.bundl</strong>e inside ReactNativeSetupAndroid(*project root dir)/android/out/.</p><p>3. Modify again index.js to create one more JS Bundle.</p><pre>&lt;<strong>Text style=</strong>{styles.<strong>hello</strong>}&gt;This is coming from Firebase RN Bundle 2 &lt;/<strong>Text</strong>&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1tw50uVexc2zd4He4mWR6w.png" /></figure><p>4. Simply create again one more new react-native bundle (<strong>index.android.bundl</strong>e) to android/output</p><pre>$yarn <strong>android-export-bundle</strong></pre><p>5. This time rename file <strong>index.android.bundl</strong>e to <strong>index.android2.bundl</strong>e inside “ReactNativeSetupAndroid(*project root dir)/android/out/”.</p><p>6. Upto this we have successfully created two react-native bundle and ready to upload to <strong>Firebase storage</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3dfqpcCDXv_W-Gu3j19hg.png" /></figure><h4>3. Upload JS Bundles to Firebase Storage</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rs_176hRZ2L4SSuczG3-xg.png" /></figure><h4>4. Copy Link Address of both uploaded bundle files from Firebase Storage</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80if1iE3bxL73FmZwXZaFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X_3RHqITGfyDBawhCHyDlg.png" /></figure><h4>5. Adding Parameter Keys in Firebase Remote Config</h4><ol><li><strong>active_app_name</strong></li><li><strong>active_bundle_name</strong>.</li><li>any <strong>parameter key name</strong> with bundle downloadable link in <strong>value</strong>. Here I have used <strong>rn_bundle_v1</strong> and <strong>rn_bundle_v2. </strong>This key and download link will be fetched on runtime from the <strong>active_bundle_name </strong>parameter key.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IywXPXl8yM4f2H_a1MkSzw.png" /></figure><h4>6. Updating Parameter Keys values in Firebase Remote Config</h4><ol><li>Add “MyReactNativeApp” to <strong>active_app_name</strong> parameter key</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvXpz1Ck74ZXH746IXPkCQ.png" /></figure><blockquote>Note : active_app_name should be taken from <strong>Package.json</strong> and <strong>AppRegistry</strong>.registerComponent App name(index.js).</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*rlrYUI0MJeAxumdlf9mCoQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TGQSvP6hRLcYk6_gx4OKbg.png" /></figure><p>2. Add <strong>index.android1.bundle </strong>file link copied from <strong>Firebase Storage</strong> to <strong>ru_bundle_v1</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pp9Fu2LGR1hFugMgI5hXZg.png" /></figure><p>3. Add <strong>index.android2.bundle </strong>file link copied from <strong>Firebase Storage</strong> to <strong>rn_bundle_v2</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5SSpnAw7T_OtiRmPYY5gJg.png" /></figure><h4>7. Activating a Bundle for Production</h4><p>Add bundle name which you want to activate to download and load in the App at run time. here currently activating <strong>rn_bundle_v1.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vUW31rLYn6-pyffFicL42w.png" /></figure><h4>8. Publish Changes</h4><p>Now it should look like below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9h-JGnoAUM5VZmLjYTbyzg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VGBmiPljJt5WI-9YyyR4yw.png" /></figure><h4>9. Open App to see downloading in runtime.</h4><blockquote>Note: Make sure your local metro builder is not running or else It will always override the downloaded bundle with the local bundle from your system incase if your are in debug build. For better testing always use release build instead.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*osl3_pYPdpjUSbZ67ZWfcQ.gif" /></figure><h4>10. Now let’s check with switching to rn_bundle_v2 and publish.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cRUhBOxER9c4yp8_y2ItQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*1ZxcuDJJ0y-mt11KBy6nHg.gif" /></figure><blockquote>I have a sample Android host project <a href="https://github.com/soumyasethy/react-native-setup-android/tree/react-native-ota">here</a>, that you can use to test the above steps.</blockquote><blockquote>You can also check this <a href="https://github.com/soumyasethy/react-native-setup-android/pull/2/commits/eb2eebb6224381240cc6d85d463e2223c48dbe1c">Pull Request</a> on Github.</blockquote><blockquote>Thanks for reading!</blockquote><blockquote>Let me know what you think in the comments. I’m not the first or last person to write on this topic, but it’s something I’ve looked for, and thought it may be useful for you.</blockquote><blockquote>Don’t give one clap 👏. Give the full +50. For all of our sakes.</blockquote><blockquote>Feeling super happy? <a href="https://www.paypal.me/soumyasethy">Buy me a coffee.</a> 😋</blockquote><blockquote>You can find me on <a href="https://www.linkedin.com/in/soumyasethy/">Linkedin</a></blockquote><blockquote>Have a nice reactive day!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34fe13614101" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating React Native with existing Android Apps efficiently]]></title>
            <link>https://medium.com/@soumyasethy/integrating-react-native-with-existing-android-apps-efficiently-3b39f2e061bd?source=rss-3741046cf8b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b39f2e061bd</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Soumya Ranjan Sethy]]></dc:creator>
            <pubDate>Wed, 27 May 2020 11:00:48 GMT</pubDate>
            <atom:updated>2020-06-03T17:23:08.463Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*wJPPT-Bd1PL-gM7mbZSHPg.png" /></figure><p>I have created a simple demo project from Android Studio to show how to integrate React Native with Auto-Linking enabled to support platform-specific (native) code.</p><h4><strong>Features of this setup,</strong></h4><ol><li>This setup is very helpful when you are working with a big mobile team having Native Android Modules, React Native and Flutter all in same App.</li><li>Even you can add multiple React Native Bundle for different different projects support in the same single app.</li><li>In Runtime also we can download the bundle in Native side and load the React Native Bundle from it’s downloaded path.</li></ol><h3>1. Set up directory structure</h3><p>To ensure a smooth experience, create a new folder for your integrated React Native project, then copy your existing Android project to an /android subfolder.</p><blockquote><em>Want to read this story later? Save it in </em><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=blog&amp;utm_campaign=noteworthy&amp;utm_content=eid7"><em>Journal</em></a><em>.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mQ6YjQoo7L2M57MFr-qbTw.png" /></figure><h3>2. Create Package.json</h3><p>Go to the root directory for your project and create a new package.json file with the following contents:</p><pre>{<br>  &quot;name&quot;: &quot;MyReactNativeApp&quot;,<br>  &quot;version&quot;: &quot;0.0.1&quot;,<br>  &quot;private&quot;: true,<br>  &quot;scripts&quot;: {<br>    &quot;start&quot;: &quot;yarn react-native start&quot;<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-nR8Xoy8kzc8qKchiuJ4Bw.png" /></figure><h3>3. Install JavaScript dependencies</h3><p>Install the react and react-native packages. Open a terminal or command prompt, then navigate to the directory with your package.json file and run:</p><p>Run below command</p><pre>$ yarn add react-native</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l4vO5giqDKmHgY3ws9GWoQ.png" /></figure><p>This will print a message similar to the following (scroll up in the yarn output to see it):</p><blockquote><em>warning “react-native@0.52.2” has unmet peer dependency “react@16.2.0”.</em></blockquote><p>This is OK, it means we also need to install React:</p><pre>$ yarn add react@version_printed_above</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rS0NhOceGQ9IoaLHTXfEWQ.png" /></figure><p>Choose a version of react from list and press Enter to install the choose version.</p><p>Yarn has created a new /node_modules folder. This folder stores all the JavaScript dependencies required to build your project.</p><p>It should look like below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*gyxLZ2qalVnV8w3uK_lgsA.png" /></figure><p>Add node_modules/ to your .gitignore file.</p><h3>4. Adding React Native to your app</h3><h4>Configuring maven</h4><p>Add the React Native dependency to your app’s build.gradle file:</p><pre>dependencies <strong>{<br>    ...</strong></pre><pre><strong>    </strong><em>//React Native Dependencies Setup Here...<br>    </em>implementation <strong>&quot;com.facebook.react:react-native:+&quot;<br><br>}</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RkM3lmG-lqFy9SWi8vFtog.png" /></figure><blockquote><em>If you want to ensure that you are always using a specific React Native version in your native build, replace </em><em>+ with an actual React Native version you&#39;ve downloaded from </em><em>npm or yarn.</em></blockquote><p>Add an entry for the local React Native maven directory to project level build.gradle. Be sure to add it to the &quot;allprojects&quot; block, above other maven repositories:</p><pre>allprojects {<br>    repositories {<br>       ...</pre><pre>        maven {<br>            // All of React Native (JS, Android binaries) is installed from npm<br>            url &quot;$rootDir/../node_modules/react-native/android&quot;<br>        }<br>        ...<br>    }<br>    ...<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VrRrDmDBtXMVCGtv3ZVqYw.png" /></figure><h3>5. Configuring Permissions</h3><p>Next, make sure you have the Internet permission in your AndroidManifest.xml:</p><pre>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;</pre><p>If you need to access to the DevSettingsActivity add to your AndroidManifest.xml:</p><pre>&lt;activity android:name=&quot;com.facebook.react.devsupport.DevSettingsActivity&quot; /&gt;</pre><p>This is only used in dev mode when reloading JavaScript from the development server, so you can strip this in release builds if you need to.</p><h3>6. Cleartext Traffic (API level 28+)</h3><blockquote><em>Starting with Android 9 (API level 28), cleartext traffic is disabled by default; this prevents your application from connecting to the Metro bundler. The changes below allow cleartext traffic in debug builds.</em></blockquote><h4>Apply the usesCleartextTraffic option to your Debug AndroidManifest.xml</h4><pre>&lt;!-- ... --&gt;<br>&lt;application<br>  <strong>android:usesCleartextTraffic=&quot;true&quot; tools:targetApi=&quot;28&quot;</strong> &gt;<br>  &lt;!-- ... --&gt;<br>&lt;/application&gt;<br>&lt;!-- ... --&gt;</pre><h3>7. Code integration</h3><p>Now we will actually modify the native Android application to integrate React Native.</p><h4>The React Native component</h4><p>The first bit of code we will write is the actual React Native code for the new “HelloWorld” screen that will be integrated into our application.</p><p>1. Create a index.js file. This file will be the entry point for React Native App.</p><pre>import React from &#39;react&#39;;<br>import {<br>  AppRegistry,<br>  StyleSheet,<br>  Text,<br>  View<br>} from &#39;react-native&#39;;</pre><pre>class HelloWorld extends React.Component {<br>  render() {<br>    return (<br>      &lt;View style={styles.container}&gt;<br>        &lt;Text style={styles.hello}&gt;Hello, World from React Native&lt;/Text&gt;<br>      &lt;/View&gt;<br>    );<br>  }<br>}<br>var styles = StyleSheet.create({<br>  container: {<br>    flex: 1,<br>    justifyContent: &#39;center&#39;<br>  },<br>  hello: {<br>    fontSize: 20,<br>    textAlign: &#39;center&#39;,<br>    margin: 10<br>  }<br>});</pre><pre>AppRegistry.registerComponent(<br>  &#39;MyReactNativeApp&#39;,<br>  () =&gt; HelloWorld<br>);<br></pre><p>2. Now the structure should look like below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QHx6QZpQu5sgZe6Kj-uQ-A.png" /></figure><h3>8. Configuration to start the React Native runtime</h3><p>Let’s add some native code in order to start the React Native runtime and tell it to render your JS component.</p><ol><li>To do this, we’re going to create an Application Class named as <strong>MainApplication</strong></li></ol><pre><strong>package </strong>com.soumya.sethy.reactnativesetupandroid;<br><br><strong>import </strong>android.app.Application;<br><strong>import </strong>com.facebook.react.PackageList;<br><strong>import </strong>com.facebook.react.ReactApplication;<br><strong>import </strong>com.facebook.react.ReactNativeHost;<br><strong>import </strong>com.facebook.react.ReactPackage;<br><strong>import </strong>com.facebook.soloader.SoLoader;<br><strong>import </strong>java.util.List;<br><br><strong>public class </strong>MainApplication <strong>extends </strong>Application <strong>implements </strong>ReactApplication {<br><br>    <strong>private final </strong>ReactNativeHost <strong>mReactNativeHost </strong>=<br>            <strong>new </strong>ReactNativeHost(<strong>this</strong>) {<br>                @Override<br>                <strong>public boolean </strong>getUseDeveloperSupport() {<br>                    <strong>return </strong>BuildConfig.<strong><em>DEBUG</em></strong>;<br>                }<br><br>                @Override<br>                <strong>protected </strong>List&lt;ReactPackage&gt; getPackages() {<br>                    @SuppressWarnings(<strong>&quot;UnnecessaryLocalVariable&quot;</strong>)<br>                    List&lt;ReactPackage&gt; packages = <strong>new </strong>PackageList(<strong>this</strong>).getPackages();<br>                    <em>// Packages that cannot be autolinked yet can be added manually here, for example:<br>                    // packages.add(new MyReactNativePackage());<br>                    </em><strong>return </strong>packages;<br>                }<br><br>                @Override<br>                <strong>protected </strong>String getJSMainModuleName() {<br>                    <strong>return &quot;index&quot;</strong>;<br>                }<br><br>                @Override<br>                <strong>protected </strong>String getJSBundleFile() {<br>                    <strong>return &quot;assets://index.android.bundle&quot;</strong>;<br>                }<br>            };<br><br>    @Override<br>    <strong>public </strong>ReactNativeHost getReactNativeHost() {<br>        <strong>return mReactNativeHost</strong>;<br>    }<br><br>    @Override<br>    <strong>public void </strong>onCreate() {<br>        <strong>super</strong>.onCreate();<br>        SoLoader.<em>init</em>(<strong>this</strong>, <strong>false</strong>);<br>    }<br><br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r0Vc1L9x1OjLFNw_9ABrig.png" /></figure><p>2. To solve <strong>Cannot resolve symbol ‘PackageList’ </strong>add below code to your app’s build.gradle at bottom of the file :</p><pre><em>//(MainApplication) Manual ReactPackage Setup here...<br> </em>apply <strong>from</strong>: file(<strong>&quot;../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle&quot;</strong>);<br> applyNativeModulesAppBuildGradle(project)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*po7IF3g7W7_icG86Bb1sww.png" /></figure><p>3. After adding above code do <strong>sync now. </strong>Now it should solve <strong>‘PackageList’</strong> issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ANgdiE55I-L0g71Nbooa5Q.png" /></figure><p>4. Now, we’re going to create an Activity that starts a React application inside it and sets it as the main content view.</p><p>Let’s name it as <strong>ReactNativeActivity</strong></p><pre><strong>package </strong>com.soumya.sethy.reactnativesetupandroid;<br><br><strong>import </strong>com.facebook.react.ReactActivity;<br><br><strong>public class </strong>ReactNativeActivity <strong>extends </strong>ReactActivity {<br>    @Override<br>    <strong>protected </strong>String getMainComponentName() {<br>        <strong>return &quot;MyReactNativeApp&quot;</strong>;<br>    }<br>}</pre><p>5. Add ReactNativeActivity and MainApplication to your AndroidManifest.</p><p>Now <strong>AndroidManifest</strong> should look like below,</p><pre><em>&lt;?</em>xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;<em>?&gt;<br></em>&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    package=&quot;com.soumya.sethy.reactnativesetupandroid&quot;&gt;<br><br>    &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;<br><br>    &lt;application<br>        <strong>android:name=&quot;.MainApplication&quot;</strong><br>        android:usesCleartextTraffic=&quot;true&quot;<br>        android:allowBackup=&quot;true&quot;<br>        android:icon=&quot;@mipmap/ic_launcher&quot;<br>        android:label=&quot;@string/app_name&quot;<br>        android:roundIcon=&quot;@mipmap/ic_launcher_round&quot;<br>        android:supportsRtl=&quot;true&quot;<br>        android:theme=&quot;@style/AppTheme&quot;&gt;<br>        &lt;activity android:name=&quot;.MainActivity&quot;&gt;<br>            &lt;intent-filter&gt;<br>                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;<br><br>                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;<br>            &lt;/intent-filter&gt;<br>        &lt;/activity&gt;<br>        &lt;activity android:name=&quot;com.facebook.react.devsupport.DevSettingsActivity&quot; /&gt;<br><strong>        &lt;activity<br>            android:name=&quot;.ReactNativeActivity&quot;<br>            android:label=&quot;@string/app_name&quot;<br>            android:theme=&quot;@style/Theme.AppCompat.Light.NoActionBar&quot;<br>            android:configChanges=&quot;keyboard|keyboardHidden|orientation|screenSize&quot;<br>            android:windowSoftInputMode=&quot;adjustResize&quot; /&gt;</strong><br>    &lt;/application&gt;<br><br>&lt;/manifest&gt;</pre><h3>9. Navigating to React Native Activity</h3><h4>1. Add Button in (eg. <strong><em>activity_main.xml file)</em></strong></h4><pre><em>&lt;?</em>xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;<em>?&gt;<br></em>&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    tools:context=&quot;.MainActivity&quot;&gt;<br><br>    &lt;TextView<br>        android:id=&quot;@+id/textView&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:text=&quot;Hello World!&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintLeft_toLeftOf=&quot;parent&quot;<br>        app:layout_constraintRight_toRightOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>    &lt;Button<br>        android:id=&quot;@+id/button&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:text=&quot;Open React Native Page&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/textView&quot; /&gt;<br><br><br>&lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8mSqpFFgP3HHeRPNlC1Bg.png" /></figure><h4>2. Add Button OnClickListener <strong>(eg. MainActivity)</strong></h4><p>let’s create a function which navigates to <strong>ReactNativeActivity</strong> and bind it to onClick event of Button.</p><pre><strong>package </strong>com.soumya.sethy.reactnativesetupandroid;<br><br><strong>import </strong>androidx.appcompat.app.AppCompatActivity;<br><strong>import </strong>android.content.Intent;<br><strong>import </strong>android.os.Bundle;<br><strong>import </strong>android.view.View;<br><strong>import </strong>android.widget.Button;<br><br><strong>public class </strong>MainActivity <strong>extends </strong>AppCompatActivity {<br><br>    Button <strong>button</strong>;<br><br>    @Override<br>    <strong>protected void </strong>onCreate(Bundle savedInstanceState) {<br>        <strong>super</strong>.onCreate(savedInstanceState);<br>        setContentView(R.layout.<strong><em>activity_main</em></strong>);<br>        <strong>button </strong>= (Button) findViewById(R.id.<strong><em>button</em></strong>);<br>        <strong>button</strong>.setOnClickListener(<strong>new </strong>View.OnClickListener() {<br>            @Override<br>            <strong>public void </strong>onClick(View v) {<br>                startRNPage();<br>            }<br>        });<br>    }<br><br><strong>    private void startRNPage() {<br>        Intent intent = new Intent(this, ReactNativeActivity.class);<br>        startActivity(intent);<br>        finish();<br>    }</strong><br>}</pre><h3>10. Hermes / JavaScriptCore(JSC) Setup</h3><p><a href="https://hermesengine.dev/">Hermes</a> is an open-source JavaScript engine optimized for running React Native apps on Android. For many apps, enabling Hermes will result in improved start-up time, decreased memory usage, and smaller app size. At this time Hermes is an opt-in React Native feature, and this guide explains how to enable it.</p><p>React Native team has to rely on an engine to interpret it so that it can run in a native mobile application. In the current architecture, the team chose to use JavaScriptCore (JSC) directly.</p><blockquote><strong>Note: </strong>Here I have enabled Hermes for release build and JSC for debug build<strong>.</strong></blockquote><blockquote>Read more about Hermes <a href="https://reactnative.dev/docs/hermes">here</a> and JSC <a href="https://formidable.com/blog/2019/jsi-jsc-part-2/">here</a></blockquote><blockquote>Alternatively We can use V8 as well. You can do full research on React Native Memory profiling (JSC vs V8 vs Hermes). Read more <a href="https://medium.com/walmartlabs/react-native-memory-profiling-jsc-vs-v8-vs-hermes-1626949a653b">here</a></blockquote><ol><li>add below code to project level build.gradle file:</li></ol><pre><strong>maven {<br>   url(https://medium.com/node_modules/jsc-android/dist&quot;)<br>}</strong></pre><p>Now the project level build.gradle file should be like below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NbX3fZ1qQi1Y55MAbUnBvg.png" /></figure><p>2. Add below code to app level build.gradle file:</p><pre><em>/**************** Hermes Setup ********************/<br></em>project.ext.react = [<br>       <strong>enableHermes</strong>: <strong>false<br></strong>]<br><strong>def </strong>jscFlavor = <strong>&#39;org.webkit:android-jsc:+&#39;<br>def </strong>enableHermes = project.ext.react.get(<strong>&quot;enableHermes&quot;</strong>, <strong>false</strong>);<br><em>/**************** End of Hermes Setup***************/</em></pre><p>and</p><pre>dependencies <strong>{<br>    ...<br><br>    </strong><em>//Hermes Dependencies Setup here...<br>   </em><strong>if </strong>(enableHermes) {<br>       <strong>def </strong>hermesPath = <strong>&quot;../../node_modules/hermes-engine/android/&quot;</strong>;<br>       debugImplementation files(hermesPath + <strong>&quot;hermes-debug.aar&quot;</strong>)<br>       releaseImplementation files(hermesPath + <strong>&quot;hermes-release.aar&quot;</strong>)<br>   } <strong>else </strong>{<br>       implementation jscFlavor<br>   }<br><strong>}</strong></pre><p>Now the app level build.gradle file should be like below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RU_2DP_ZSTbnyuqfyv-YaQ.png" /></figure><h3>11. Support for Auto-Linking</h3><p>React Native libraries often come with platform-specific (native) code.</p><p><strong>Auto-Linking</strong> is a mechanism that allows your project to discover and use this code.</p><pre># install example<br>$ yarn add @react-native-community/async-storage<br><br># run<br>yarn react-native run-android</pre><p>That&#39;s it. No more editing build config files to use native code.</p><blockquote><em>Auto-Linking is a replacement for </em><a href="https://github.com/react-native-community/cli/blob/master/docs/linking.md"><em>react-native link</em></a><em>. If you have been using React Native before version 0.60, please </em><em>unlink native dependencies if you have any from a previous install.</em></blockquote><p>To support Auto-Linking add below code to <em>settings.gradle</em></p><pre><em>//auto-linking after React native 0.60+<br></em>apply <strong>from</strong>: file(<strong>&quot;../node_modules/@react-native-community/cli-platform-android/native_modules.gradle&quot;</strong>);<br>applyNativeModulesSettingsGradle(settings)<br><em>//End of auto-linking after React native 0.60+</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1BSy5msn3-tFBVyKLs9vEg.png" /></figure><h3>12. Test your integration</h3><p>You have now done all the basic steps to integrate React Native with your current application. Now we will start the Metro bundler to build the index.bundle package and the server running on localhost to serve it.</p><p>1. Run the packager</p><p>To run your app, you need to first start the development server. To do this, run the following command in the root directory of your React Native project:</p><pre>//running start script of package.json<br>$ <strong>yarn start</strong></pre><pre>//or else run the full script<br>$ <strong>yarn react-native start</strong></pre><p>Now in terminal metro builder should start running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_dai489DZWeSSga3S9TcQ.png" /></figure><p>2. Now to run Android App, Open new tab in terminal and run the following command in the root directory of your React Native project:</p><pre>$ <strong>npx react-native run-android</strong></pre><p>We can also use Android Studio to run Android App directly too</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T8dg7JR1VUA5Yy9QD25-SA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*sW6spshAARa0D4wWu_zMBw.png" /></figure><p>Now When we click on Open React Native Page, Metro builder should starts bundling like below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7mbEgUOKbkx7EwHE2EOFXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*mkAmlaO5LrPFnAg8KF6m1A.png" /></figure><blockquote>I have a sample Android host project <a href="https://github.com/soumyasethy/react-native-setup-android/tree/react-native-setup">here</a>, that you can use to test the above steps.</blockquote><blockquote>You can also check this <a href="https://github.com/soumyasethy/react-native-setup-android/pull/1/commits/30585578d818d58b7f8551a8e5a5446966798df4">Pull Request</a> on Github.</blockquote><p><a href="https://github.com/soumyasethy/react-native-setup-android">soumyasethy/react-native-setup-android</a></p><blockquote>Thanks for reading!</blockquote><blockquote>Let me know what you think in the comments. I’m not the first or last person to write on this topic, but it’s something I’ve looked for, and thought it may be useful for you.</blockquote><blockquote>Don’t give one clap 👏. Give the full +50. For all of our sakes.</blockquote><blockquote>Feeling super happy? <a href="https://www.paypal.me/soumyasethy">Buy me a coffee.</a> 😋</blockquote><blockquote>You can find me on <a href="https://www.linkedin.com/in/soumyasethy/">Linkedin</a></blockquote><blockquote>Have a nice reactive day!</blockquote><p>📝 Save this story in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b39f2e061bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[news.ly]]></title>
            <link>https://medium.com/@soumyasethy/newsly-privacy-policy-cca92130422b?source=rss-3741046cf8b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/cca92130422b</guid>
            <dc:creator><![CDATA[Soumya Ranjan Sethy]]></dc:creator>
            <pubDate>Thu, 19 Jul 2018 18:03:29 GMT</pubDate>
            <atom:updated>2018-07-19T18:30:22.825Z</atom:updated>
            <content:encoded><![CDATA[<p>Privacy Policy of news.ly</p><h3>Privacy Policy</h3><p>Effective date: July 19, 2018</p><p>news.ly (“us”, “we”, or “our”) operates the website and the news.ly mobile application (the “Service”).</p><p>This page informs you of our policies regarding the collection, use, and disclosure of personal data when you use our Service and the choices you have associated with that data. This Privacy Policy for news.ly is powered by <a href="https://www.freeprivacypolicy.com/free-privacy-policy-generator.php">FreePrivacyPolicy.com</a>.</p><p>We use your data to provide and improve the Service. By using the Service, you agree to the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, terms used in this Privacy Policy have the same meanings as in our Terms and Conditions.</p><h3>Information Collection And Use</h3><p>We collect several different types of information for various purposes to provide and improve our Service to you.</p><h3>Types of Data Collected</h3><h4>Personal Data</h4><p>While using our Service, we may ask you to provide us with certain personally identifiable information that can be used to contact or identify you (“Personal Data”). Personally identifiable information may include, but is not limited to:</p><ul><li>Address, State, Province, ZIP/Postal code, City</li><li>Cookies and Usage Data</li></ul><h4>Usage Data</h4><p>We may also collect information that your browser sends whenever you visit our Service or when you access the Service by or through a mobile device (“Usage Data”).</p><p>This Usage Data may include information such as your computer’s Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that you visit, the time and date of your visit, the time spent on those pages, unique device identifiers and other diagnostic data.</p><p>When you access the Service by or through a mobile device, this Usage Data may include information such as the type of mobile device you use, your mobile device unique ID, the IP address of your mobile device, your mobile operating system, the type of mobile Internet browser you use, unique device identifiers and other diagnostic data.</p><h4>Tracking &amp; Cookies Data</h4><p>We use cookies and similar tracking technologies to track the activity on our Service and hold certain information.</p><p>Cookies are files with small amount of data which may include an anonymous unique identifier. Cookies are sent to your browser from a website and stored on your device. Tracking technologies also used are beacons, tags, and scripts to collect and track information and to improve and analyze our Service.</p><p>You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent. However, if you do not accept cookies, you may not be able to use some portions of our Service.</p><p>Examples of Cookies we use:</p><ul><li><strong>Session Cookies.</strong> We use Session Cookies to operate our Service.</li><li><strong>Preference Cookies.</strong> We use Preference Cookies to remember your preferences and various settings.</li><li><strong>Security Cookies.</strong> We use Security Cookies for security purposes.</li></ul><h3>Use of Data</h3><p>news.ly uses the collected data for various purposes:</p><ul><li>To provide and maintain the Service</li><li>To notify you about changes to our Service</li><li>To allow you to participate in interactive features of our Service when you choose to do so</li><li>To provide customer care and support</li><li>To provide analysis or valuable information so that we can improve the Service</li><li>To monitor the usage of the Service</li><li>To detect, prevent and address technical issues</li></ul><h3>Transfer Of Data</h3><p>Your information, including Personal Data, may be transferred to — and maintained on — computers located outside of your state, province, country or other governmental jurisdiction where the data protection laws may differ than those from your jurisdiction.</p><p>If you are located outside India and choose to provide information to us, please note that we transfer the data, including Personal Data, to India and process it there.</p><p>Your consent to this Privacy Policy followed by your submission of such information represents your agreement to that transfer.</p><p>news.ly will take all steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of your data and other personal information.</p><h3>Disclosure Of Data</h3><h3>Legal Requirements</h3><p>news.ly may disclose your Personal Data in the good faith belief that such action is necessary to:</p><ul><li>To comply with a legal obligation</li><li>To protect and defend the rights or property of news.ly</li><li>To prevent or investigate possible wrongdoing in connection with the Service</li><li>To protect the personal safety of users of the Service or the public</li><li>To protect against legal liability</li></ul><h3>Security Of Data</h3><p>The security of your data is important to us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While we strive to use commercially acceptable means to protect your Personal Data, we cannot guarantee its absolute security.</p><h3>Service Providers</h3><p>We may employ third party companies and individuals to facilitate our Service (“Service Providers”), to provide the Service on our behalf, to perform Service-related services or to assist us in analyzing how our Service is used.</p><p>These third parties have access to your Personal Data only to perform these tasks on our behalf and are obligated not to disclose or use it for any other purpose.</p><h3>Analytics</h3><p>We may use third-party Service Providers to monitor and analyze the use of our Service.</p><ul><li><strong>Google Analytics</strong></li><li>Google Analytics is a web analytics service offered by Google that tracks and reports website traffic. Google uses the data collected to track and monitor the use of our Service. This data is shared with other Google services. Google may use the collected data to contextualize and personalize the ads of its own advertising network.</li><li>For more information on the privacy practices of Google, please visit the Google Privacy &amp; Terms web page: <a href="https://policies.google.com/privacy?hl=en">https://policies.google.com/privacy?hl=en</a></li></ul><h3>Links To Other Sites</h3><p>Our Service may contain links to other sites that are not operated by us. If you click on a third party link, you will be directed to that third party’s site. We strongly advise you to review the Privacy Policy of every site you visit.</p><p>We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.</p><h3>Children’s Privacy</h3><p>Our Service does not address anyone under the age of 18 (“Children”).</p><p>We do not knowingly collect personally identifiable information from anyone under the age of 18. If you are a parent or guardian and you are aware that your Children has provided us with Personal Data, please contact us. If we become aware that we have collected Personal Data from children without verification of parental consent, we take steps to remove that information from our servers.</p><h3>Changes To This Privacy Policy</h3><p>We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page.</p><p>We will let you know via email and/or a prominent notice on our Service, prior to the change becoming effective and update the “effective date” at the top of this Privacy Policy.</p><p>You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.</p><h3>Contact Us</h3><p>If you have any questions about this Privacy Policy, please contact us:</p><ul><li>By email: sethy.soumyaranjan@gmail.com</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cca92130422b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shortest Path or Minimum Cash Flow-Algorithm using Java.]]></title>
            <link>https://medium.com/@soumyasethy/shortest-path-or-minimum-cash-flow-algorithm-using-java-5848d4148a76?source=rss-3741046cf8b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5848d4148a76</guid>
            <category><![CDATA[shortest-path]]></category>
            <category><![CDATA[minimum-cash-flow]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Soumya Ranjan Sethy]]></dc:creator>
            <pubDate>Mon, 24 Jul 2017 16:40:11 GMT</pubDate>
            <atom:updated>2017-07-24T16:40:11.357Z</atom:updated>
            <content:encoded><![CDATA[<h4>Finding the cheapest possible way of sending a certain amount of flow through a flow network.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*KOpghKGr6EMZNf_JtQSsUg.png" /></figure><p><a href="https://github.com/soumyasethy/ShortestPath-CashFlow-Algorithm-Splitwise/blob/master/README.md">soumyasethy/ShortestPath-CashFlow-Algorithm-Splitwise</a></p><p>For example, if the following weighted directed graph represents some people and the arrows represent debts between them (Alice owes Bob $20 and Charlie $5, Bob owes Charlie $10, etc.):</p><p>How to pick the first person? To pick the first person, calculate the net amount for every person where net amount is obtained by subtracting all debts (amounts to pay) from all credits (amounts to be paid). Once net amount for every person is evaluated, find two persons with maximum and minimum net amounts. These two persons are the most creditors and debtors. The person with minimum of two is our first person to be settled and removed from list. Let the minimum of two amounts be x. We pay ‘x’ amount from the maximum debtor to maximum creditor and settle one person. If x is equal to the maximum debit, then maximum debtor is settled, else maximum creditor is settled.</p><p>There’s no sense in $10 making its way from Alice to Bob and then from Bob to Charlie if Alice could just give it to Charlie directly.</p><p>The goal, then, in the general case is to take a debt graph and simplify it (i.e. produce a new graph with the same nodes but different edges).</p><h3>How to Use?</h3><p>I have created a method which just do it.<br>“findPath(parm)”</p><p>Create a HashMap Variable<br>“static HashMap parm = new HashMap()”</p><p>Add the Expense in below formate</p><p>“parm.put(“Name”, Amoun)”</p><p>For Example,</p><pre>parm.put(&quot;A&quot;, -5.0);  <br>    parm.put(&quot;B&quot;, 25.0);  <br>    parm.put(&quot;C&quot;, -20.0);  <br>    parm.put(&quot;D&quot;, 25.0);  <br>    parm.put(&quot;E&quot;, -20.0);  <br>    parm.put(&quot;F&quot;, -5.0);</pre><p>Passing values to find the Net Amount to be Paid with Person Name -Cash Flow / Shortest Path</p><pre>findPath(parm);</pre><p>Out Put<br>C needs to pay B:20.0<br>E needs to pay D:20.0<br>A needs to pay B:5.0<br>F needs to pay D:5.0</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5848d4148a76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Confusion Matrix]]></title>
            <link>https://medium.com/@soumyasethy/understanding-confusion-matrix-50701df65564?source=rss-3741046cf8b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/50701df65564</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[confusion-matrix]]></category>
            <dc:creator><![CDATA[Soumya Ranjan Sethy]]></dc:creator>
            <pubDate>Sat, 22 Jul 2017 19:04:40 GMT</pubDate>
            <atom:updated>2017-07-22T19:04:40.641Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Confusion Matrix (CM) describe the performance of a classification model</strong></p><p>Let’s start with an <strong>example confusion matrix for a binary classifier</strong></p><p>Suppose, We have 100 Apples and 50 Oranges. So total 150 items we have originally.</p><p>Let’s now define the most basic terms,</p><ul><li><strong>true positives (TP):</strong> These are cases in which we predicted as Apple, and they are actual Apple.</li><li><strong>true negatives (TN):</strong> We predicted as Orange, and they are not Apple.</li><li><strong>false positives (FP):</strong> We predicted Orange, but they are Apple. (Also known as a “Type I error.”)</li><li><strong>false negatives (FN):</strong> We predicted Apple, but they are Orange. (Also known as a “Type II error.”)</li></ul><p>Case : 1</p><p>1.In this scenario out of 100 Apples ,</p><p>Number of Apple selected : 100</p><p>Number of Orange selected : 0</p><p>2. Similarly for Orange,</p><p>Number of Orange selected : 50</p><p>Number of Apple selected :0</p><p>So Confusion Diagram will be below printed format,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iy9uEEb2ACHnLBw0XPu7Yw.png" /></figure><p>Case : 2</p><p>1.In this scenario out of 100 Apples ,</p><p>Number of Actually Apple selected : 75</p><p>Number of mistakenly Orange selected : 25</p><p>2. Similarly for Orange,</p><p>Number of Actually Orange selected : 49</p><p>Number of mistakenly Apple selected : 1</p><p>So Confusion Diagram will be below printed format,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*o1BSlWbk1fenYrDZrrxyEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*FvkoLSAdzc0egbyun51afg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50701df65564" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Big Data, The Big Picture.]]></title>
            <link>https://medium.com/@soumyasethy/big-data-the-big-picture-6092765c801e?source=rss-3741046cf8b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6092765c801e</guid>
            <category><![CDATA[lifecycle]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Soumya Ranjan Sethy]]></dc:creator>
            <pubDate>Wed, 12 Jul 2017 14:04:25 GMT</pubDate>
            <atom:updated>2017-07-12T14:31:26.998Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s Meet Big Data Family.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bTgnq5N_IoW7g9llY8Sj-Q.png" /><figcaption>Big Data, The Big Picture</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_vMazBqMgjRW6B0KY3_XMg.png" /><figcaption>Data Ingestion</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vPbCUNEBhAONIO0xeHYyOw.png" /><figcaption>Data Processing</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mx8-sn_ok3kkdiWWOKkOCw.png" /><figcaption>Data Storage</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3YwTKkXyJYEKFnQ8p_dxlA.png" /><figcaption>Job Scheduling</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zZZuGeg4XLYDk2qKJRvwbQ.png" /><figcaption>Deployment Tool / Build</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DBkhesiG3qhNc6HenZI9-w.png" /><figcaption>Web Services</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jbLm9O9ObIyQmaUqSQZhjg.png" /><figcaption>Programming Language</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6092765c801e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started]]></title>
            <link>https://medium.com/@soumyasethy/getting-started-2ec1bd1bf1fd?source=rss-3741046cf8b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ec1bd1bf1fd</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[simple-linear-regression]]></category>
            <dc:creator><![CDATA[Soumya Ranjan Sethy]]></dc:creator>
            <pubDate>Wed, 12 Jul 2017 11:29:26 GMT</pubDate>
            <atom:updated>2017-07-12T11:29:26.682Z</atom:updated>
            <content:encoded><![CDATA[<p>Simple Linear Regression Model (SLR) using R Language. Which is also known as Linear Model (LM) or Linear Regression.</p><p>In statistical modeling, regression analysis is a statistical process for estimating the relationships among variables. It includes many techniques for modeling and analyzing several variables, when the focus is on the relationship between a dependent variable and one or more independent variables (or ‘predictors’).</p><p>Tools : <a href="https://www.rstudio.com/products/rstudio/download/">Rstudio</a>.</p><p>Language : R</p><p>Basic Formula : Y = α + β(x)</p><p>Where ,</p><p>Y -&gt; Dependent Variable</p><p>α -&gt; Constant</p><p>β -&gt; Coefficient</p><p>x -&gt; Independent Variable</p><p>For Simple Linear Regression Model (SLR),</p><ul><li>Data Type must be <em>Numeric</em> or <em>Continuous</em>.</li></ul><p>There should be <em>One dependent variable and One independent variable</em></p><p><em>Note:</em></p><ul><li><em>In SLR the model can have only one dependent variable and one independent variable.</em></li><li>The Linear relation between two variables which is a relation between dependent and independent variable.</li></ul><h3>Simple Linear Regression Model using R,</h3><p>We create a relationship model using the lm() functions in R,</p><p>fit &lt;- lm(formula=speed~dist,data=cars)</p><p>Where,</p><p>fit &lt;- Variable</p><p>speed -&gt; Dependent Variable</p><p>Dist -&gt; Independent Variable.</p><p>Basically we are looking for R-squared measure just to see how close the data are to the fitted regression line. It is also known as the coefficient of determination.</p><p>That defines the accuracy of developed Model.</p><p>It is defined as, R-squared = Explained variation / Total variation</p><p>Total variation = Explained variation + Unexplained variation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OfRxmx79jPF_UEqzWmLdfw.png" /><figcaption>Output</figcaption></figure><p>Complete Code &amp; Data Source link : <a href="https://github.com/soumyasethy/Linear-Regression">https://github.com/soumyasethy/Linear-Regression</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ec1bd1bf1fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>