Files: e7a281942d7ba07122d3b8d738ef13d3b128ea0e / android / app / src / main / java / com / datreactnative / MainApplication.java
1215 bytesRaw
1 | package com.datreactnative; |
2 | |
3 | import android.app.Application; |
4 | |
5 | import com.facebook.react.ReactApplication; |
6 | import com.rnfs.RNFSPackage; |
7 | import com.janeasystems.rn_nodejs_mobile.RNNodeJsMobilePackage; |
8 | import com.facebook.react.ReactNativeHost; |
9 | import com.facebook.react.ReactPackage; |
10 | import com.facebook.react.shell.MainReactPackage; |
11 | import com.facebook.soloader.SoLoader; |
12 | |
13 | import java.util.Arrays; |
14 | import java.util.List; |
15 | |
16 | public class MainApplication extends Application implements ReactApplication { |
17 | |
18 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { |
19 | |
20 | public boolean getUseDeveloperSupport() { |
21 | return BuildConfig.DEBUG; |
22 | } |
23 | |
24 | |
25 | protected List<ReactPackage> getPackages() { |
26 | return Arrays.<ReactPackage>asList( |
27 | new MainReactPackage(), |
28 | new RNFSPackage(), |
29 | new RNNodeJsMobilePackage() |
30 | ); |
31 | } |
32 | |
33 | |
34 | protected String getJSMainModuleName() { |
35 | return "index"; |
36 | } |
37 | }; |
38 | |
39 | |
40 | public ReactNativeHost getReactNativeHost() { |
41 | return mReactNativeHost; |
42 | } |
43 | |
44 | |
45 | public void onCreate() { |
46 | super.onCreate(); |
47 | SoLoader.init(this, /* native exopackage */ false); |
48 | } |
49 | } |
50 |
Built with git-ssb-web