Updated docs for next

This commit is contained in:
Website Deployment Script
2016-10-20 16:43:04 +00:00
parent 06dda20c30
commit 3e4ea4e2bc
@@ -291,7 +291,7 @@ AppRegistry<span class="token punctuation">.</span><span class="token function">
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token punctuation">}</span></div><blockquote><p>Make sure that the path is correct! You shouldnt run into any “Failed to resolve: com.facebook.react:react-native:0.x.x&quot; errors after running Gradle sync in Android Studio.</p></blockquote><p>Next, make sure you have the Internet permission in your <code>AndroidManifest.xml</code>:</p><div class="prism language-javascript">&lt;uses<span class="token operator">-</span>permission android<span class="token punctuation">:</span>name<span class="token operator">=</span><span class="token string">&quot;android.permission.INTERNET&quot;</span> <span class="token operator">/</span><span class="token operator">&gt;</span></div><p>This is only really used in dev mode when reloading JavaScript from the development server, so you can strip this in release builds if you need to.</p><h2><a class="anchor" name="add-native-code"></a>Add native code <a class="hash-link" href="docs/integration-with-existing-apps.html#add-native-code">#</a></h2><p>You need to add some native code in order to start the React Native runtime and get it to render something. To do this, we&#x27;re going to create an <code>Activity</code> that creates a <code>ReactRootView</code>, starts a React application inside it and sets it as the main content view.</p><blockquote><p>If you are targetting Android version &lt;5, use the <code>AppCompatActivity</code> class from the <code>com.android.support:appcompat</code> package instead of <code>Activity</code>.</p></blockquote><div class="prism language-javascript">public class <span class="token class-name">MyReactActivity</span> extends <span class="token class-name">Activity</span> implements <span class="token class-name">DefaultHardwareBackBtnHandler</span> <span class="token punctuation">{</span>
<span class="token punctuation">}</span></div><blockquote><p>Make sure that the path is correct! You shouldnt run into any “Failed to resolve: com.facebook.react:react-native:0.x.x&quot; errors after running Gradle sync in Android Studio.</p></blockquote><p>Next, make sure you have the Internet permission in your <code>AndroidManifest.xml</code>:</p><div class="prism language-javascript">&lt;uses<span class="token operator">-</span>permission android<span class="token punctuation">:</span>name<span class="token operator">=</span><span class="token string">&quot;android.permission.INTERNET&quot;</span> <span class="token operator">/</span><span class="token operator">&gt;</span></div><p>If you need to access to the <code>DevSettingsActivity</code> add to your <code>AndroidManifest.xml</code>:</p><div class="prism language-javascript">&lt;activity android<span class="token punctuation">:</span>name<span class="token operator">=</span><span class="token string">&quot;com.facebook.react.devsupport.DevSettingsActivity&quot;</span> <span class="token operator">/</span><span class="token operator">&gt;</span></div><p>This is only really used in dev mode when reloading JavaScript from the development server, so you can strip this in release builds if you need to.</p><h2><a class="anchor" name="add-native-code"></a>Add native code <a class="hash-link" href="docs/integration-with-existing-apps.html#add-native-code">#</a></h2><p>You need to add some native code in order to start the React Native runtime and get it to render something. To do this, we&#x27;re going to create an <code>Activity</code> that creates a <code>ReactRootView</code>, starts a React application inside it and sets it as the main content view.</p><blockquote><p>If you are targetting Android version &lt;5, use the <code>AppCompatActivity</code> class from the <code>com.android.support:appcompat</code> package instead of <code>Activity</code>.</p></blockquote><div class="prism language-javascript">public class <span class="token class-name">MyReactActivity</span> extends <span class="token class-name">Activity</span> implements <span class="token class-name">DefaultHardwareBackBtnHandler</span> <span class="token punctuation">{</span>
private ReactRootView mReactRootView<span class="token punctuation">;</span>
private ReactInstanceManager mReactInstanceManager<span class="token punctuation">;</span>