<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ashutosh</title>
    <description>The latest articles on DEV Community by Ashutosh (@knerd1).</description>
    <link>https://dev.to/knerd1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2068168%2F635a5421-5359-4c11-99d4-d6c3e878e548.png</url>
      <title>DEV Community: Ashutosh</title>
      <link>https://dev.to/knerd1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/knerd1"/>
    <language>en</language>
    <item>
      <title>Getting Started with React Native: Installation Guide For Windows &amp; Linux</title>
      <dc:creator>Ashutosh</dc:creator>
      <pubDate>Mon, 30 Sep 2024 19:36:50 +0000</pubDate>
      <link>https://dev.to/knerd1/getting-started-with-react-native-installation-guide-for-windows-linux-2a05</link>
      <guid>https://dev.to/knerd1/getting-started-with-react-native-installation-guide-for-windows-linux-2a05</guid>
      <description>&lt;p&gt;React Native is a popular framework for creating native mobile applications using JavaScript, based on the ReactJS library. While React Native shares similarities with ReactJS, it has distinct differences specific to mobile app development.&lt;/p&gt;

&lt;p&gt;To properly install React Native, you can follow this guide that covers everything you need to get started. The framework supports building apps for devices running iOS 17.6 and Android 15.0 (API level 35) or later&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Install Node.js
&lt;/h2&gt;

&lt;p&gt;Install the latest version of the node.js here.Nodejs LTS Version is recommended.&lt;/p&gt;

&lt;p&gt;Next,you must check whether node.js &amp;gt;= 18.8 or newer is installed on your computer, To check the version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcigvunxnqo0xz64y7g1f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcigvunxnqo0xz64y7g1f.png" alt="Image description" width="800" height="90"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;on the command prompt. The above command is used in both Windows and Linux.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Install JDK(Java Development Kit)
&lt;/h2&gt;

&lt;p&gt;React Native currently recommends version 17 of the Java SE Development Kit (JDK). You may encounter problems using higher JDK versions. You may download and install OpenJDK from AdoptOpenJDK or your system packager.&lt;/p&gt;

&lt;p&gt;Then, Check Java Version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;java -version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frlm2j8eclx4ynatfu5f2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frlm2j8eclx4ynatfu5f2.png" alt="Image description" width="800" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Setup Android development environment
&lt;/h2&gt;

&lt;p&gt;Configuring your development environment can be a bit challenging if you're new to Android development. Even if you have experience, there might still be some settings you'll need to adjust. In both situations, it's important to follow the upcoming steps closely to ensure everything is set up correctly.&lt;/p&gt;

&lt;p&gt;Install Android Studio&lt;/p&gt;

&lt;p&gt;Download and install Android Studio. During the installation process, ensure that all the checkboxes next to the following items are selected.&lt;/p&gt;

&lt;p&gt;Android SDK&lt;/p&gt;

&lt;p&gt;Android SDK Platform&lt;/p&gt;

&lt;p&gt;Android Virtual Device&lt;/p&gt;

&lt;p&gt;React Native requires Android 14. (UpsideDownCake) SDK to be installed. To check the SDK version follow the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Open Android Studio &amp;gt; More Actions &amp;gt; SDK Manager &amp;gt; Android SDK &amp;gt; SDK Platforms &amp;gt; Make sure to select Android 14.0 (UpsideDownCake)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus6415betr2xzau4d8m9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus6415betr2xzau4d8m9.png" alt="Image description" width="800" height="613"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then,Move to next Tab,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SDK Tools &amp;gt; Android SDK Build-Tools 35 &amp;gt; Make sure to select 34.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffovchgzyooydf70cgv3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffovchgzyooydf70cgv3m.png" alt="Image description" width="800" height="613"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note: If you are on Linux, you have to select Android SDK Command Line tools (latest) under SKD Tools&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftcvf3bqjlexbpb2ba6rg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftcvf3bqjlexbpb2ba6rg.png" alt="Image description" width="800" height="613"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure the ANDROID_HOME environment variable
&lt;/h2&gt;

&lt;p&gt;The React Native tools require some environment variables to be set up in order to build apps with native code.&lt;/p&gt;

&lt;p&gt;Open the Windows Control Panel. Click on User Accounts, then click User Accounts again Click on Change my environment variables Click on New... to create a new ANDROID_HOME user variable that points to the path to your Android SDK:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ilbonbp0wdbt3ojkcjf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ilbonbp0wdbt3ojkcjf.png" alt="Image description" width="653" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The SDK is installed, by default, at the following location:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;%LOCALAPPDATA%\Android\Sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can find the actual location of the SDK in the Android Studio "Settings" dialog, under Languages &amp;amp; Frameworks → Android SDK.&lt;/p&gt;

&lt;p&gt;Open a new Command Prompt window to ensure the new environment variable is loaded before proceeding to the next step.&lt;/p&gt;

&lt;p&gt;Open powershell Copy and paste Get-ChildItem -Path Env:\ into powershell Verify ANDROID_HOME has been added&lt;/p&gt;

&lt;h2&gt;
  
  
  Add platform-tools to Path
&lt;/h2&gt;

&lt;p&gt;Open the Windows Control Panel. Click on User Accounts, then click User Accounts again Click on Change my environment variables Select the Path variable. Click Edit. Click New and add the path to platform-tools to the list.&lt;/p&gt;

&lt;p&gt;The default location for this folder is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;%LOCALAPPDATA%\Android\Sdk\platform-tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Note For Linux:
&lt;/h2&gt;

&lt;p&gt;Add the following lines to your $HOME/.bash_profile or $HOME/.bashrc (if you are using zsh then ~/.zprofile or ~/.zshrc) config file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type source $HOME/.bash_profile for bash or source $HOME/.zprofile to load the config into your current shell. Verify that ANDROID_HOME has been set by running echo $ANDROID_HOME and the appropriate directories have been added to your path by running echo $PATH&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Preparing the Android device
&lt;/h2&gt;

&lt;p&gt;You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A) Using a physical device (Click Here To SetUp)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B) Using a virtual device.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create your First React Native Project
&lt;/h2&gt;

&lt;p&gt;If you ever installed react-native-cli globally, I recommend you to uninstall that, because instead of installing and managing react native cli specific version globally on your pc, you can create the project in the latest version at runtime using npx.&lt;/p&gt;

&lt;p&gt;If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues. To uninstall the react-native-cli:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm uninstall -g react-native-cli @react-native-community/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's create a project AwesomeProject:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx react-native@latest init AwesomeProject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your project is created with a default template. Run your project using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run android
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcebyxly0ixtxi969fr1n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcebyxly0ixtxi969fr1n.png" alt="Image description" width="800" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will start the metro development server for your project. Make sure to connect your mobile or start the virtual device.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>reactnative</category>
      <category>javascript</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Mastering React Native Project Structure</title>
      <dc:creator>Ashutosh</dc:creator>
      <pubDate>Fri, 20 Sep 2024 19:21:02 +0000</pubDate>
      <link>https://dev.to/knerd1/mastering-react-native-project-structure-4f07</link>
      <guid>https://dev.to/knerd1/mastering-react-native-project-structure-4f07</guid>
      <description>&lt;p&gt;&lt;code&gt;The organization of a React Native project often depends on personal choices and the specific demands of the application. That said, the structure outlined below is a commonly favored approach:&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  android
&lt;/h1&gt;

&lt;p&gt;This folder contains the Android project files, such as Gradle configurations and native Android code. It is generated when the project is initialized for Android.&lt;/p&gt;

&lt;h1&gt;
  
  
  ios
&lt;/h1&gt;

&lt;p&gt;It contains native iOS code and configurations. It includes the Xcode project, build files, and resources required for iOS-specific functionality.&lt;/p&gt;

&lt;h1&gt;
  
  
  node_modules
&lt;/h1&gt;

&lt;p&gt;This folder stores all the dependencies and libraries installed through npm or yarn.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;tests&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;This folder is commonly used to contain unit tests or integration tests for the application.&lt;/p&gt;

&lt;h1&gt;
  
  
  app.json
&lt;/h1&gt;

&lt;p&gt;This file in a React Native project serves as a configuration file that contains essential metadata and settings for the app.&lt;/p&gt;

&lt;h1&gt;
  
  
  AppPro.tsx
&lt;/h1&gt;

&lt;p&gt;its purpose depends on the specific project or naming convention used by the development team.&lt;/p&gt;

&lt;h1&gt;
  
  
  App.tsx or App.jsx
&lt;/h1&gt;

&lt;p&gt;The main entry point of the app, defining the app's core component structure and setup.&lt;/p&gt;

&lt;h1&gt;
  
  
  babel.config.js
&lt;/h1&gt;

&lt;p&gt;Configures Babel, the JavaScript compiler used to transpile modern JavaScript into a version compatible with older platforms.&lt;/p&gt;

&lt;h1&gt;
  
  
  index.js
&lt;/h1&gt;

&lt;p&gt;The root file that registers the app for rendering, linking the App.js file to the underlying platform.&lt;/p&gt;

&lt;h1&gt;
  
  
  jest.config.js
&lt;/h1&gt;

&lt;p&gt;This file is used to configure Jest, which is a testing framework commonly used for running tests. Jest is widely adopted for unit testing, integration testing, and snapshot testing in JavaScript projects, including React Native applications.&lt;/p&gt;

&lt;h1&gt;
  
  
  metro.config.js
&lt;/h1&gt;

&lt;p&gt;Configuration file for Metro, the JavaScript bundler that React Native uses.&lt;/p&gt;

&lt;h1&gt;
  
  
  package.json
&lt;/h1&gt;

&lt;p&gt;Lists the project dependencies and scripts for building, running, or testing the app.&lt;/p&gt;

&lt;h1&gt;
  
  
  package-lock.json
&lt;/h1&gt;

&lt;p&gt;The package-lock.json file is crucial for managing dependencies in JavaScript projects, including those using React Native.&lt;/p&gt;

&lt;h1&gt;
  
  
  tsconfig.json
&lt;/h1&gt;

&lt;p&gt;The tsconfig.json file is used in TypeScript projects to configure the behavior of the TypeScript compiler (tsc). This file defines various compiler options, file inclusions, and exclusions to control how TypeScript code is compiled to JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AwesomeProject/
│
├── node_modules/
├── ios/
├── android/
├── app/
│   ├── components/
│   ├── screens/
│   ├── navigation/
│   ├── assets/
│   ├── styles/
│   ├── services/
│   ├── utils/
│   └── App.js
├── package.json
├── index.js
├── .gitignore
├── babel.config.js
└── metro.config.js

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Keep in mind that this structure is flexible and can be adjusted according to your project’s unique requirements. What’s most important is to keep your project well-organized and maintain clear boundaries  between different components or layers. This approach will help ensure that your project remains scalable and easy to maintain as it grows.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>mobile</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
