This is a React Native project, scaffolded with Expo.
On your computer:
-
Install npm packages from the native app project root:
cd play-media-native npm install
-
Start the Expo development server:
npm start
On your phone:
- Install and open the "Expo GO" app.
- Android:
- Click the "Scan QR code" button.
- If asked, allow the application to use your phone camera.
- Point your phone to the QR code in your computer's terminal.
- iOS
- Open your camera application.
- Point your phone to the QR code in your computer's terminal.
- On the phone screen, click the "Open in Expo Go" button that appears near the QR code.
- Wait for the bundle to compile, and download to your mobile device via tunneling.
- On your computer, download and install Android Studio from https://developer.android.com/studio
- Validate the
adb
executable is in your PATH:- Close all PowerShell terminals.
- Open an elevated PowerShell terminal.
- Type
adb
and hit Enter. - If you are getting documentation for "Android Debug Bridge", continue to creating an Android virtual device.
- If you are getting an error:
- Add
C:\Users<your_username>\AppData\Local\Android\Sdk\platform-tools
to yourPATH
environment variable. - Close all PowerShell terminals.
- Retry the
adb
command. - If you are still getting an error, try rebooting your computer.
- Add
- Create an Android virtual device:
-
Open Android Studio.
-
In the middle section of the Android Studio application, click the "More Actions" link.
-
Choose "Virtual Device Manager".
-
In the Device Manager, click on the top-left "Create device" button.
-
In the "Select Hardware" screen, select a predefined phone (e.g.: Pixel 6) and click the Next button.
Note: The PLAY! Media application is not compatible with non-phone devices. It has not been tested on tablets, watches, desktops, TVs, and cars.
-
In the "System Image" screen:
- Select the latest production operating system version (e.g.: Tiramisu).
- Click the small download icon button next to the operating system release name.
- In the "License Agreement" screen, select the "Accept" radio button, and click the Next button.
- In the "SDK Component Installer" screen, wait for the download and install to finish, then click the Finish button.
- Back in the "System Image" screen, click the Next button.
-
In the "Android Virtual Device (AVD)" screen:
- Click the bottom-left "Show Advanced Settings" button.
- Scroll down to the "Camera" section.
- For both the front and back cameras, select the "Webcam0" or "Device" option for the emulator to use your computer webcam as the phone cameras.
- Click the "Finish" button.
-
- In the Android Studio device manager:
- Start your virtual device using the "play" triangle icon button next to it in the device list.
- On your computer, in an elevated PowerShell terminal:
- Start the Expo development server for Android:
npm run android
- Type the "a" keyboard key to tell Expo to start the application on your Android emulator.
- The Expo development server will install Expo Go on your Android emulator, compile the application, send it to your Android emulator, and your Android emulator will open the application.
- Start the Expo development server for Android:
-
Follow the instructions listed here https://docs.expo.dev/build/setup/.
-
Run this npm script
npm run build:android
-
Wait for the build to finish, it is going to take a while.
-
Once your build is completed, the CLI will prompt you to automatically download and install it on the Android Emulator. See more here https://docs.expo.dev/build-reference/apk/#emulator-virtual-device.
- Follow the instructions listed here https://docs.expo.dev/build-reference/apk/#physical-device in order to download the APK you generated to your Android phone.
- Alternatively, download a prebuilt PLAY! Media APK file to your phone from the releases section on GitHub https://github.com/Sitecore/Sitecore.Demo.CHONE/releases.
- Enable installing apps from unknown sources in your phone's settings.
- Find the APK file in your downloads folder.
- Click on it and when prompted click install.
- In case you get a warning by Google Play Protect click install anyway.
- Click on PLAY! Media to open the app. Enjoy!