Clone the repo:
git clone [email protected]:Gert25/ReactNative.git
before using brew make sure that brew is updated by running the following command in the terminal
brew update
brew install node
brew install watchman
via node
npm install -g react-native-cli
via curl
curl -0 -L https://npmjs.org/install.sh | sudo sh
brew update
brew cask install java
Testing if java is running in your environment run the following in your terminal
javac -version which should display something like javac 1.8.0_131
Run the custom setup when prompted, Insure the folling modules are installed
- Android SDK
- Android SDK Platform
- Performance (INtel HAXM)
- Android Virtual Device
Open the Android Studio IDE and go to: Apperance & Behavior -> System Settings -> Android SDK
Under the SDK Platforms Select the followng:
- Google APIs
- Android SDK Platform 23
- Intel x86 Atom_64 System Image
- Google APIs Intel x86 Atom_64 System Image
add the following to your .bash_profile
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
Type source $HOME/.bash_profile to load the config into your current shell.Verify that ANDROID_HOME has been added to your path by running echo $PATH
Emulators are useful cause they allow you to target multiple devices on yuor machine to run and these your application. You can download emulators via Android SDK.
What version of Emulator to choose? It is important to take the android version/platform into account. You need to know which platform is mostly used and target that platform for your development instead of focusing on multiple platforms. This link provides some valid information about those type of metrics Dashboard
root into the application folder.
react-native run-android
In react native there are two main ways off organizing your code when it comes to targeting platform specific functions:
- Using the Platform module
- Using platform-specific file extensions
Platform.OS
When the platform (Operating system) is IOS, the Platform.OS will then be equal to ios. When the platform in which the app is running on is android Platform.ios will be equal to android
Platform.select
The Platform.select allows you to create specific stylesheets for specific Mobile platforms by passing in the Platfrom.OS specific key to the the class. See the following example
const styles = StyleSheet.create({
container: {
flex: 1,
...Platform.select({
ios: {
backgroundColor: 'red',
},
android: {
backgroundColor: 'blue',
},
}),
},
});
'Platform.VersionIn order to determine the version of the platform you can call the Platform.Version`. This will will bring back a string value stating the value.
React Native can determine which platform to target based on their file extension. For example when a file's extension includes the .android. in the file name react native will automatically handel it as android specific code. Likewise, when a file's extension includes .ios. in it the file will be used to target ios platform.
React Navigation provides an easy to use navigation solution, with the ability to present common stack navigation and tabbed navigation patterns on both iOS and Android
NavigatorIOS
Targets the IOS platform to give a native look and feel with minimal configuration regarding the navigation platform for IOS. It is essentialy a wrapper class around UINavigationController
configuration found in the .vscode