Skip to content

Commit

Permalink
Add a note about Android Studio to docs, fix formatting
Browse files Browse the repository at this point in the history
Summary:
We should use 4 spaces of indentation in the MainActivity template as this
is the most common setting outside fb.

public

Reviewed By: bestander

Differential Revision: D2911952

fb-gh-sync-id: 3b5285945f0033d7342348b7a7cbafa32809f7dc
shipit-source-id: 3b5285945f0033d7342348b7a7cbafa32809f7dc
  • Loading branch information
Martin Konicek authored and facebook-github-bot-7 committed Feb 8, 2016
1 parent 843b556 commit abdca04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 6 additions & 2 deletions docs/DevelopmentSetupAndroid.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permalink: docs/android-setup.html
next: linux-windows-support
---

This guide describes basic steps of the Android development environment setup that are required to run React Native android apps on an android emulator. We don't discuss developer tool configuration such as IDEs here.
This guide describes basic steps of the Android development environment setup that are required to run React Native android apps on an android emulator.

### Install Git

Expand All @@ -19,7 +19,7 @@ This guide describes basic steps of the Android development environment setup th

- **On Windows**, download and install [Git for Windows](https://git-for-windows.github.io/). During the setup process, choose "Run Git from Windows Command Prompt", which will add Git to your `PATH` environment variable.

### Install the Android SDK (unless you have it)
### Install the Android SDK (unless you already have it)

1. [Install the latest JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
2. Install the Android SDK:
Expand Down Expand Up @@ -95,3 +95,7 @@ To use it with react-native you just have to add a key and value to your registr
You will also need to run the command `adb reverse tcp:8081 tcp:8081` with this emulator.

Then restart the emulator and when it runs you can just do `react-native run-android` as usual.

### Editing your app's Java code in Android Studio

You can use any editor to edit JavaScript. If you want to use Android Studio to work on native code, from the Welcome screen of Android Studio choose "Import project" and select the `android` folder of your app.
14 changes: 7 additions & 7 deletions local-cli/generator-android/templates/package/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
);
return Arrays.<ReactPackage>asList(
new MainReactPackage()
);
}
}

0 comments on commit abdca04

Please sign in to comment.