fixing Android example

This commit is contained in:
Nabil Hachicha 2016-11-12 10:20:16 +00:00
parent 695d6f9efb
commit f764032ef5
7 changed files with 80 additions and 50 deletions

View File

@ -7,7 +7,8 @@
android:allowBackup="true" android:allowBackup="true"
android:label="@string/app_name" android:label="@string/app_name"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme"
android:name=".MainApplication">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:label="@string/app_name" android:label="@string/app_name"

View File

@ -1,13 +1,6 @@
package io.realm.react.example; package io.realm.react.example;
import com.facebook.react.ReactActivity; import com.facebook.react.ReactActivity;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import java.util.Arrays;
import java.util.List;
import io.realm.react.RealmReactPackage;
public class MainActivity extends ReactActivity { public class MainActivity extends ReactActivity {
@ -28,16 +21,4 @@ public class MainActivity extends ReactActivity {
protected boolean getUseDeveloperSupport() { protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG; return BuildConfig.DEBUG;
} }
/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RealmReactPackage()
);
}
} }

View File

@ -0,0 +1,41 @@
package io.realm.react.example;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import java.util.Arrays;
import java.util.List;
import io.realm.react.RealmReactPackage;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RealmReactPackage()
);
}
};
/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}

View File

@ -5,7 +5,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:1.3.1' classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

View File

@ -1,5 +1,6 @@
#Fri Nov 11 18:15:12 GMT 2016
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

View File

@ -65,6 +65,7 @@ task downloadJSCHeaders(type: Download) {
task downloadRealmCore(type: Download) { task downloadRealmCore(type: Download) {
src "https://static.realm.io/downloads/core/realm-core-android-${project.coreVersion}.tar.gz" src "https://static.realm.io/downloads/core/realm-core-android-${project.coreVersion}.tar.gz"
// src "https://static.realm.io/downloads/sync/realm-sync-android-${project.coreVersion}.tar.gz"
onlyIfNewer true onlyIfNewer true
overwrite false overwrite false
dest new File(downloadsDir, "realm-core-android-${project.coreVersion}.tar.gz") dest new File(downloadsDir, "realm-core-android-${project.coreVersion}.tar.gz")

View File

@ -14,40 +14,45 @@ include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := librealmreact LOCAL_MODULE := librealmreact
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := $(wildcard vendor/*.cpp) $(wildcard src/*.cpp) $(wildcard src/jsc/*.cpp) $(wildcard src/android/*.cpp) $(wildcard src/object-store/src/*.cpp) $(wildcard src/object-store/src/impl/*.cpp) $(wildcard src/object-store/src/parser/*.cpp) $(wildcard src/object-store/src/util/*.cpp)
src/js_realm.cpp \ # $(info >>>>>>>> LIBS>: [${OBJ_STORE}])
src/rpc.cpp \
src/jsc/jsc_init.cpp \ # LOCAL_SRC_FILES := \
src/android/platform.cpp \ # src/js_realm.cpp \
src/android/io_realm_react_RealmReactModule.cpp \ # src/rpc.cpp \
src/android/jsc_override.cpp \ # src/jsc/jsc_init.cpp \
src/object-store/src/collection_notifications.cpp \ # src/android/platform.cpp \
src/object-store/src/index_set.cpp \ # src/android/io_realm_react_RealmReactModule.cpp \
src/object-store/src/list.cpp \ # src/android/jsc_override.cpp \
src/object-store/src/object_schema.cpp \ # src/object-store/src/collection_notifications.cpp \
src/object-store/src/object_store.cpp \ # src/object-store/src/index_set.cpp \
src/object-store/src/results.cpp \ # src/object-store/src/list.cpp \
src/object-store/src/schema.cpp \ # src/object-store/src/object_schema.cpp \
src/object-store/src/shared_realm.cpp \ # src/object-store/src/object_store.cpp \
src/object-store/src/parser/parser.cpp \ # src/object-store/src/results.cpp \
src/object-store/src/parser/query_builder.cpp \ # src/object-store/src/schema.cpp \
src/object-store/src/impl/collection_change_builder.cpp \ # src/object-store/src/shared_realm.cpp \
src/object-store/src/impl/collection_notifier.cpp \ # src/object-store/src/parser/parser.cpp \
src/object-store/src/impl/list_notifier.cpp \ # src/object-store/src/parser/query_builder.cpp \
src/object-store/src/impl/realm_coordinator.cpp \ # src/object-store/src/impl/collection_change_builder.cpp \
src/object-store/src/impl/results_notifier.cpp \ # src/object-store/src/impl/collection_notifier.cpp \
src/object-store/src/impl/transact_log_handler.cpp \ # src/object-store/src/impl/list_notifier.cpp \
src/object-store/src/impl/android/external_commit_helper.cpp \ # src/object-store/src/impl/realm_coordinator.cpp \
src/object-store/src/impl/android/weak_realm_notifier.cpp \ # src/object-store/src/impl/results_notifier.cpp \
src/object-store/src/util/format.cpp \ # src/object-store/src/impl/transact_log_handler.cpp \
src/object-store/src/util/thread_id.cpp \ # src/object-store/src/impl/android/external_commit_helper.cpp \
vendor/base64.cpp # src/object-store/src/impl/weak_realm_notifier.cpp \
# src/object-store/src/util/format.cpp \
# src/object-store/src/util/thread_id.cpp \
# src/object-store/src/thread_confined.hpp \
# vendor/base64.cpp
LOCAL_C_INCLUDES := src LOCAL_C_INCLUDES := src
LOCAL_C_INCLUDES += src/jsc LOCAL_C_INCLUDES += src/jsc
LOCAL_C_INCLUDES += src/object-store/src LOCAL_C_INCLUDES += src/object-store/src
LOCAL_C_INCLUDES += src/object-store/src/impl LOCAL_C_INCLUDES += src/object-store/src/impl
LOCAL_C_INCLUDES += src/object-store/src/parser LOCAL_C_INCLUDES += src/object-store/src/parser
# LOCAL_C_INCLUDES += src/object-store/src/sync
LOCAL_C_INCLUDES += src/object-store/external/pegtl LOCAL_C_INCLUDES += src/object-store/external/pegtl
LOCAL_C_INCLUDES += vendor LOCAL_C_INCLUDES += vendor
LOCAL_C_INCLUDES += $(JAVA_HOME)/include LOCAL_C_INCLUDES += $(JAVA_HOME)/include