Commit 1cf55d89 authored by Marek Kotewicz's avatar Marek Kotewicz
Browse files

app compiling on android

parent b4725c90
......@@ -126,7 +126,6 @@ android {
}
dependencies {
compile project(':react-native-randombytes')
compile project(':react-native-camera')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
......
package com.nativesigner;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Callback;
/**
* Created by marek on 20/02/2017.
*/
public class EthkeyBridge extends ReactContextBaseJavaModule {
@Override
public String getName() {
return "EthkeyBridge";
}
public EthkeyBridge(ReactApplicationContext reactContext) {
super(reactContext);
}
@ReactMethod
public void brainWalletAddress(String seed, Callback callback) {
callback.invoke("hello from java");
}
@ReactMethod
public void brainWalletSecret(String seed, Callback callback) {
callback.invoke("hello from java");
}
}
package com.nativesigner;
import java.util.Collections;
import java.util.List;
import java.util.ArrayList;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
/**
* Created by marek on 20/02/2017.
*/
public class EthkeyBridgePackage implements ReactPackage {
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new EthkeyBridge(reactContext));
return modules;
}
}
......@@ -4,7 +4,6 @@ import android.app.Application;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.bitgo.randombytes.RandomBytesPackage;
import com.lwansbrough.RCTCamera.RCTCameraPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
......@@ -26,9 +25,9 @@ public class MainApplication extends Application implements ReactApplication {
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RandomBytesPackage(),
new RCTCameraPackage()
new MainReactPackage(),
new RCTCameraPackage(),
new EthkeyBridgePackage()
);
}
};
......
rootProject.name = 'NativeSigner'
include ':react-native-randombytes'
project(':react-native-randombytes').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-randombytes/android')
include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment