Permalink
Browse files

android update to 0.31.0

  • Loading branch information...
1 parent da676a4 commit 32aa56ff2e79425cd0bec163181bdb5cc8b911f1 @soliury committed Aug 20, 2016
@@ -1,25 +1,26 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.lingyong.me.noder">
+ package="com.lingyong.me.noder">
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
- <application
- android:allowBackup="true"
- android:label="@string/app_name"
- android:icon="@mipmap/ic_launcher"
- android:theme="@style/AppTheme">
- <activity
- android:name=".MainActivity"
- android:label="@string/app_name"
- android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
- </application>
+ <application
+ android:name=".MainApplication"
+ android:allowBackup="true"
+ android:label="@string/app_name"
+ android:icon="@mipmap/ic_launcher"
+ android:theme="@style/AppTheme">
+ <activity
+ android:name=".MainActivity"
+ android:label="@string/app_name"
+ android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ <activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
+ </application>
</manifest>
@@ -1,15 +1,6 @@
package com.lingyong.me.noder;
import com.facebook.react.ReactActivity;
-import com.microsoft.codepush.react.CodePush;
-import com.oblador.vectoricons.VectorIconsPackage;
-import com.lwansbrough.RCTCamera.RCTCameraPackage;
-import com.eguma.barcodescanner.BarcodeScannerPackage;
-import com.facebook.react.ReactPackage;
-import com.facebook.react.shell.MainReactPackage;
-
-import java.util.Arrays;
-import java.util.List;
public class MainActivity extends ReactActivity {
@@ -21,37 +12,4 @@
protected String getMainComponentName() {
return "noder";
}
-
- /**
- * Returns whether dev mode should be enabled.
- * This enables e.g. the dev menu.
- */
- @Override
- protected boolean getUseDeveloperSupport() {
- return BuildConfig.DEBUG;
- }
-
- // 2. Override the getJSBundleFile method in order to let
- // the CodePush runtime determine where to get the JS
- // bundle location from on each app start
- @Override
- protected String getJSBundleFile() {
- return CodePush.getBundleUrl();
- }
-
-
- /**
- * 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(),
- new CodePush("Q2A8khx6JV4mXXcS0usR0LipDz0Y410YoZxlZ", this, BuildConfig.DEBUG),
- new VectorIconsPackage(),
- new RCTCameraPackage(),
- new BarcodeScannerPackage()
- );
- }
}
@@ -0,0 +1,44 @@
+package com.lingyong.me.noder;
+
+import android.app.Application;
+import android.util.Log;
+
+import com.facebook.react.ReactApplication;
+import com.facebook.react.ReactInstanceManager;
+import com.facebook.react.ReactNativeHost;
+import com.facebook.react.ReactPackage;
+import com.facebook.react.shell.MainReactPackage;
+
+import com.microsoft.codepush.react.CodePush;
+import com.oblador.vectoricons.VectorIconsPackage;
+import com.lwansbrough.RCTCamera.RCTCameraPackage;
+import com.eguma.barcodescanner.BarcodeScannerPackage;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class MainApplication extends Application implements ReactApplication {
+
+ private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
+ @Override
+ protected boolean getUseDeveloperSupport() {
+ return BuildConfig.DEBUG;
+ }
+
+ @Override
+ protected List<ReactPackage> getPackages() {
+ return Arrays.<ReactPackage>asList(
+ new MainReactPackage(),
+ new CodePush("Q2A8khx6JV4mXXcS0usR0LipDz0Y410YoZxlZ", this, BuildConfig.DEBUG),
+ new VectorIconsPackage(),
+ new RCTCameraPackage(),
+ new BarcodeScannerPackage()
+ );
+ }
+ };
+
+ @Override
+ public ReactNativeHost getReactNativeHost() {
+ return mReactNativeHost;
+ }
+}

0 comments on commit 32aa56f

Please sign in to comment.