Skip to content

Instantly share code, notes, and snippets.

@thedanielforum
Created July 30, 2018 05:15
Show Gist options
  • Save thedanielforum/31288f514900bd71edde114c9939dbd1 to your computer and use it in GitHub Desktop.
Save thedanielforum/31288f514900bd71edde114c9939dbd1 to your computer and use it in GitHub Desktop.
ReactNative with RNN and Image picker
package com.sakana;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.imagepicker.ImagePickerPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.reactnativenavigation.NavigationApplication;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Nullable;
public class MainApplication extends NavigationApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ImagePickerPackage(),
new VectorIconsPackage()
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
@Override
public boolean isDebug() {
return BuildConfig.DEBUG;
}
@Nullable
@Override
public List<ReactPackage> createAdditionalReactPackages() {
return Arrays.<ReactPackage>asList(
// Needs to be imported here as well.
new ImagePickerPackage()
);
}
@Override
public String getJSMainModuleName() {
return "index";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment