Skip to content

glp-92/React-Native-Apps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building a React Native APP First Time

  1. NodeJs must be installed
  2. Run npm install -g expo-cli to install Expo platform. Is not official platform but simplifies some steps.
  3. expo init projectname
  4. cd projectname
  5. To launch, expo start. Will ask you for ways to open the project. w to open web browser. It will suggest to instal react-native-web and react-dom packages.
    • By scanning QR code on phone with expo go app on Android, app can be launched directly on phone.
  6. Main code is placed on App.js

About React Native

  • React-native, like React, is based on components to promote reusability.
    • Props can be passed to componentes like <Component text = "test"/> and accesed by {props.text}
  • Components and apis
  • Styles are created by using Stylesheet and must be imported from react-native too

Packages

  • To use icons included when an Expo project is started
    1. Search icon
    2. Click on the icon and get import and use codes
  • Async storage to small key value storage npm install @react-native-async-storage/async-storage
    • Storage is accesed by Key, and path on device is defined by the library itself.

Deployment with Expo

  1. npm install -g eas-cli
  2. Is needed an Expo account. Then eas login with username and password
  3. eas build:configure and choose platform.
  4. For Android APK deploy, change on eas.json that was generated by the build:configure command:
    "preview": {
        "android": {
            "buildType": "apk"
        }
    }
    
  5. To run the build eas build -p android --profile preview where profile gets changes made to buildType APK. This command is using the tier account you're using on Expo
  6. On Linux, it's possible to build locally the app eas build --local -p android --profile preview

Android Studio Emulate

  1. Disable HyperV on Windows => Windows Features => Search HyperV and uncheck it
  2. Install Android Studio
  3. Run the simulator on Android Studio => Tools => Device Manager and run the simulator
  4. expo start -c to delete cached data and choose Android
  5. First time of launch, expo will be installed on simulator
    • If it doesn't work, when expo start -c command, type ? and shift+a to select device or emulator and choose the emulator.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published