본문 바로가기
IT/ETC

React Native로 Android 앱을 개발하려면

by eplus 2025. 5. 10.

React NativeAndroid 앱을 개발하려면 아래와 같이 개발 환경을 준비하고 프로젝트를 시작하면 됩니다:


1. 개발 환경 구성

📦 필수 설치

도구설치 방법
Node.js https://nodejs.org 에서 LTS 버전 설치
npm or yarn Node 설치 기본 포함됨
Java JDK 11+ https://adoptium.net 또는 OpenJDK
Android Studio SDK + Emulator 설치를 위해 필수
React Native CLI npm install -g react-native-cli
 

Expo CLI간단한 방식이지만, 네이티브 기능(카메라, 저장 등)쓴다면 React Native CLI 권장


2. Android 설정

Android Studio 설정 시:

  1. SDK Manager → Android SDK → ✅ "SDK Tools" 탭에서 다음 체크:
    • Android SDK Build-Tools
    • Android SDK Command-line Tools
    • Android Emulator
    • Android Platform-Tools
  2. AVD Manager에서 가상 장치 생성 (또는 실제 기기 연결)

3. 프로젝트 생성

bash
복사편집
npx react-native init MyApp cd MyApp

4. Android 에뮬레이터 또는 기기 실행

bash
복사편집
npx react-native run-android

기기가 연결되어 있지 않으면 에뮬레이터가 자동 실행됨


5. 코드 작성 (App.js)

jsx
복사편집
import React from 'react'; import {View, Text, Button, Alert} from 'react-native'; const App = () => { return ( <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> <Text>Hello React Native!</Text> <Button title="눌러보기" onPress={() => Alert.alert('반응 있어요!')} /> </View> ); }; export default App;

주요 네이티브 기능 사용할

기능패키지
카메라 react-native-camera, react-native-vision-camera
저장소 접근 react-native-fs, react-native-permissions
위치 @react-native-community/geolocation, react-native-geolocation-service
728x90
반응형