-[Install Java Development Kit](#install-java-development-kit)
-[Install Java Development Kit](#install-java-development-kit)
-[Android development environment (for a virtual device) - skip next if you are using a physical device](#android-development-environment-for-a-virtual-device---skip-next-if-you-are-using-a-physical-device)
-[Android development environment](#android-development-environment)
-[Clone project into your local directory](#clone-project-into-your-local-directory)
-[Clone project into your local directory](#clone-project-into-your-local-directory)
-[Install and start the app](#install-and-start-the-app)
-[Install and start the app](#install-and-start-the-app)
-[Run the app on a device/emulator](#run-the-app-on-a-deviceemulator)
-[Run the app on a device/emulator](#run-the-app-on-a-deviceemulator)
-[Virtual device testing - on Emulator with Android studio](#virtual-device-testing---on-emulator-with-android-studio)
-[Virtual device testing - on Emulator with Android studio](#virtual-device-testing---on-emulator-with-android-studio)
Some of the information is duplicated from the [React native developer docs.](https://reactnative.dev/docs/getting-started)
## Get logins
## Get logins
In order to test you will need an account on a Mahara instance. In order to generate an authentication token please see [this documentation](https://manual.mahara.org/en/19.10/account/apps.html?highlight=authentication%20token).
In order to test you will need an account on a Mahara instance. In order to generate an authentication token please see [this documentation](https://manual.mahara.org/en/19.10/account/apps.html?highlight=authentication%20token).
## Installing dependencies
## Installing dependencies
...
@@ -73,7 +79,9 @@ java -version
...
@@ -73,7 +79,9 @@ java -version
# OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
# OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
```
```
### Android development environment (for a virtual device) - [skip next](#clone-project-into-local-directory) if you are using a physical device
### Android development environment
>(for a virtual device) - [skip next](#clone-project-into-local-directory) if you are using a physical device
Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to follow the next few steps carefully.
Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to follow the next few steps carefully.
...
@@ -105,17 +113,17 @@ Setting up your development environment can be somewhat tedious if you're new to
...
@@ -105,17 +113,17 @@ Setting up your development environment can be somewhat tedious if you're new to
The React Native tools require some environment variables to be set up to build apps with native code.
The React Native tools require some environment variables to be set up to build apps with native code.
```bash
```bash
# Check which bash file you are using with
# Check which bash file you are using with
cat$HOME/.bash_profile
cat$HOME/.bash_profile
# If there is a file with this name open it up with
# If there is a file with this name open it up with
gedit $HOME/.bash_profile
gedit $HOME/.bash_profile
# If it says No such file or directory, check another bash file
# If it says No such file or directory, check another bash file
cat$HOME/.bashrc
cat$HOME/.bashrc
# If there is a file with this name open it up with
# If there is a file with this name open it up with
gedit $HOME/.bashrc
gedit $HOME/.bashrc
```
```
Add the following lines to your `$HOME/.bash_profile` or `$HOME/.bashrc` config file:
Add the following lines to your `$HOME/.bash_profile` or `$HOME/.bashrc` config file:
...
@@ -154,6 +162,7 @@ gedit $HOME/.bashrc
...
@@ -154,6 +162,7 @@ gedit $HOME/.bashrc
```
```
2. Follow through steps in [README](https://gitlab.wgtn.cat-it.co.nz/elearning/mahara-mobile-react-native/blob/master/README.md)
2. Follow through steps in [README](https://gitlab.wgtn.cat-it.co.nz/elearning/mahara-mobile-react-native/blob/master/README.md)
3. Alternatively, the same actions: to start the server running the app.
3. Alternatively, the same actions: to start the server running the app.
```bash
```bash
...
@@ -197,45 +206,45 @@ gedit $HOME/.bashrc
...
@@ -197,45 +206,45 @@ gedit $HOME/.bashrc
### Physical device testing
### Physical device testing
1. Open developer mode on your Android device. [Check here for tips](https://www.digitaltrends.com/mobile/how-to-get-developer-options-on-android/)
1. Open developer mode on your Android device. [Check here for tips](https://www.digitaltrends.com/mobile/how-to-get-developer-options-on-android/)
1. Inside of the developer options: Allow USB debugging.
1. Inside of the developer options: Allow USB debugging.
2. Connect your device to your pc via USB connection.
2. Connect your device to your pc via USB connection.
3. Your device will get a request for permissions:
3. Your device will get a request for permissions:
1. Allow access to files/Transfer files.
1. Allow access to files/Transfer files.
2. Allow USB Debugging. OK
2. Allow USB Debugging. OK
4. On your terminal, execute the command:
4. On your terminal, execute the command:
```bash
```bash
adb devices
adb devices
```
```
This will list the devices connected to the pc.
This will list the devices connected to the pc.
```bash
```bash
List of devices attached
List of devices attached
01234SDGESG567890 device
01234SDGESG567890 device
# If you have not allowed USB debugging it will show
# If you have not allowed USB debugging it will show
# 01234SDGESG567890 unknown
# 01234SDGESG567890 unknown
```
```
5. Run the app on the connected device with command:
5. Run the app on the connected device with command:
```bash
```bash
# Insert the appropriate number shown in your terminal.
# Insert the appropriate number shown in your terminal.
npm run android -d 01234SDGESG567890
npm run android -d 01234SDGESG567890
```
```
# React native
## React native
Follow official docs: <https://facebook.github.io/react-native/docs/getting-started.html>.
Follow official docs: <https://facebook.github.io/react-native/docs/getting-started.html>.
This is because the installation process changes a lot, and we can't keep these docs up to date.
This is because the installation process changes a lot, and we can't keep these docs up to date.
# Contributing!
# Contributing
Now that we have gotten Mahara mobile installed and ready to run, let's start contributing!
Now that we have gotten Mahara mobile installed and ready to run, let's start contributing!