react-native-bpg

0.0.15 • Public • Published

react-native-bpg

Getting started

$ npm install react-native-bpg --save

Mostly automatic installation

$ react-native link react-native-bpg

Manual installation

NDK should be installed. This can be done with SDK manager.

Project should contain ./android/local.properties with correct paths to SDK/NDK (it is possible to set up environment variables).

Windows example:

sdk.dir=D\:\\Development\\_SDK\\AndroidSDK\\AndroidSDK
ndk.dir=D\:\\Development\\_SDK\\AndroidSDK\\ndk-bundle

There will be the warnings during the native libraries build phase.

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.kornell.bpg.RNReactNativeBpgPackage; to the imports at the top of the file
  • Add new RNReactNativeBpgPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-bpg'
    project(':react-native-bpg').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-bpg/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-bpg')
    

iOS

Not implemented for iOS

Windows

Not implemented for Windows

Usage

Example project can be found in links section

Links

Thank to the author of this article

BPG

GIT:react-native-bpg-example

ToDo list

filter getList with .bpg$ pattern

add png support

add gif support

add download from web (check with self-signed ssl and provide option to enable skip-checking)

add methods for *AsPromise

rename current methods to *AsCallback

Troubleshooting

If native libs are not building, try several techniques to clean cache:

npm start -- --reset-cache

remove node_modules and install dependencies again with npm i

On Windows remove %USER_HOME%.gradle\caches\

On Mac or Linux: > rm -rf $HOME/.gradle/caches/

On Both

> cd android

> gradlew cleanBuildCache

then rebuild an application.

Package Sidebar

Install

npm i react-native-bpg

Weekly Downloads

0

Version

0.0.15

License

MIT

Unpacked Size

1.49 MB

Total Files

157

Last publish

Collaborators

  • nosshar