project and android config and build

Former-commit-id: 7a1e2e32eb
This commit is contained in:
michaelr 2016-03-23 17:02:53 +02:00
parent 61706099c2
commit 7817b72bc9
9 changed files with 89 additions and 7 deletions

View File

@ -2,7 +2,14 @@
"name": "SyngIm",
"interface": "reagent",
"androidHost": "localhost",
"modules": [],
"modules": [
"react-native-contacts",
"react-native-invertible-scroll-view",
"awesome-phonenumber",
"realm",
"react-native-loading-spinner-overlay",
"react-native-i18n"
],
"imageDirs": [
"images"
]

View File

@ -121,5 +121,12 @@ android {
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:0.20.+"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-contacts')
compile project(':react-native-i18n')
// compile(name:'geth', ext:'aar')
compile(group: 'syng-im', name: 'android-geth', version: '1.4.0-201603131817-92d65cf', ext: 'aar')
compile project(":realm")
compile fileTree(dir: "node_modules/realm/android/libs", include: ["*.jar"])
}

View File

@ -2,6 +2,8 @@
package="com.syngim">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<application
android:allowBackup="true"

View File

@ -3,12 +3,48 @@ package com.syngim;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.rt2zz.reactnativecontacts.ReactNativeContacts;
import android.os.Bundle;
import android.os.Environment;
import com.github.ethereum.go_ethereum.cmd.Geth;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import java.io.File;
import com.i18n.reactnativei18n.ReactNativeI18n;
import io.realm.react.RealmReactPackage;
public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Required for android-16 (???)
System.loadLibrary("gethraw");
System.loadLibrary("geth");
// Required because of crazy APN settings redirecting localhost
Properties properties = System.getProperties();
properties.setProperty("http.nonProxyHosts", "localhost|127.0.0.1");
properties.setProperty("https.nonProxyHosts", "localhost|127.0.0.1");
File extStore = Environment.getExternalStorageDirectory();
final String dataFolder = extStore.exists() ?
extStore.getAbsolutePath() :
getApplicationInfo().dataDir;
// Launch!
new Thread(new Runnable() {
public void run() {
Geth.run("--bootnodes enode://e2f28126720452aa82f7d3083e49e6b3945502cb94d9750a15e27ee310eed6991618199f878e5fbc7dfa0e20f0af9554b41f491dc8f1dbae8f0f2d37a3a613aa@139.162.13.89:30303 --shh --ipcdisable --nodiscover --rpc --rpcapi db,eth,net,web3,shh --fast --datadir=" + dataFolder);
}
}).start();
}
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
@ -33,8 +69,11 @@ public class MainActivity extends ReactActivity {
*/
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
);
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ReactNativeContacts(),
new ReactNativeI18n(),
new RealmReactPackage()
);
}
}

View File

@ -16,5 +16,16 @@ allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$projectDir/../../node_modules/react-native/android"
}
// for geth
flatDir {
dirs 'libs'
}
maven {
url "http://85.90.244.96:8081/artifactory/libs-release-local"
}
}
}

View File

@ -1,3 +1,12 @@
rootProject.name = 'SyngIm'
include ':app'
include ':react-native-contacts'
project(':react-native-contacts').projectDir = new File(settingsDir, '../node_modules/react-native-contacts/android')
include ':react-native-i18n'
project(':react-native-i18n').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-i18n/android')
// realm dependency
include ':realm'
project(':realm').projectDir = new File(rootProject.projectDir, '../node_modules/realm/android')

View File

@ -6,6 +6,12 @@
"start": "node_modules/react-native/packager/packager.sh"
},
"dependencies": {
"react-native": "0.20.0"
"awesome-phonenumber": "^1.0.12",
"react-native": "^0.22.0",
"react-native-contacts": "^0.2.1",
"react-native-i18n": "0.0.8",
"react-native-invertible-scroll-view": "^0.2.0",
"react-native-loading-spinner-overlay": "0.0.6",
"realm": "^0.10.0"
}
}

View File

@ -7,7 +7,8 @@
[org.clojure/clojurescript "1.7.170"]
[reagent "0.5.1" :exclusions [cljsjs/react]]
[re-frame "0.6.0"]
[prismatic/schema "1.0.4"]]
[prismatic/schema "1.0.4"]
[syng-im/protocol "0.1.1"]]
:plugins [[lein-cljsbuild "1.1.1"]
[lein-figwheel "0.5.0-2"]]
:clean-targets ["target/" "index.ios.js" "index.android.js"]