Skip to content

Commit

Permalink
Update android example project
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuxiang committed Aug 29, 2022
1 parent dff9c10 commit cbbd4ec
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 107 deletions.
83 changes: 0 additions & 83 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import com.android.build.OutputFile
*/

project.ext.react = [
enableHermes: true, // clean and rebuild if changing
enableHermes: false, // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"
Expand Down Expand Up @@ -134,7 +134,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
applicationId "com.rnamapgeolocation"
applicationId "com.example"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
Expand All @@ -157,7 +157,7 @@ android {
cppFlags "-std=c++17"
// Make sure this target name is the same you specify inside the
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
targets "rnamapgeolocation_appmodules"
targets "example_appmodules"
}
}
if (!enableSeparateBuildPerCPUArchitecture) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.rnamapgeolocation;
package com.example;

import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rnamapgeolocation">
package="com.example">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.rnamapgeolocation;
package com.example;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.rnamapgeolocation;
package com.example;

import android.app.Application;
import android.content.Context;
Expand All @@ -9,7 +9,7 @@
import com.facebook.react.ReactPackage;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.soloader.SoLoader;
import com.rnamapgeolocation.newarchitecture.MainApplicationReactNativeHost;
import com.example.newarchitecture.MainApplicationReactNativeHost;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

Expand Down Expand Up @@ -73,7 +73,7 @@ private static void initializeFlipper(
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.rnamapgeolocation.ReactNativeFlipper");
Class<?> aClass = Class.forName("com.example.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.rnamapgeolocation.newarchitecture;
package com.example.newarchitecture;

import android.app.Application;
import androidx.annotation.NonNull;
Expand All @@ -19,9 +19,9 @@
import com.facebook.react.fabric.FabricJSIModuleProvider;
import com.facebook.react.fabric.ReactNativeConfig;
import com.facebook.react.uimanager.ViewManagerRegistry;
import com.rnamapgeolocation.BuildConfig;
import com.rnamapgeolocation.newarchitecture.components.MainComponentsRegistry;
import com.rnamapgeolocation.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
import com.example.BuildConfig;
import com.example.newarchitecture.components.MainComponentsRegistry;
import com.example.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
import java.util.ArrayList;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.rnamapgeolocation.newarchitecture.components;
package com.example.newarchitecture.components;

import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.rnamapgeolocation.newarchitecture.modules;
package com.example.newarchitecture.modules;

import com.facebook.jni.HybridData;
import com.facebook.react.ReactPackage;
Expand Down Expand Up @@ -41,7 +41,7 @@ protected synchronized void maybeLoadOtherSoLibraries() {
if (!sIsSoLibraryLoaded) {
// If you change the name of your application .so file in the Android.mk file,
// make sure you update the name here as well.
SoLoader.loadLibrary("rnamapgeolocation_appmodules");
SoLoader.loadLibrary("example_appmodules");
sIsSoLibraryLoaded = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include $(CLEAR_VARS)
LOCAL_PATH := $(THIS_DIR)

# You can customize the name of your application .so file here.
LOCAL_MODULE := rnamapgeolocation_appmodules
LOCAL_MODULE := example_appmodules

LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MainApplicationTurboModuleManagerDelegate
public:
// Adapt it to the package you used for your Java class.
static constexpr auto kJavaDescriptor =
"Lcom/rnamapgeolocation/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";
"Lcom/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";

static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>);

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/jni/MainComponentsRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MainComponentsRegistry
public:
// Adapt it to the package you used for your Java class.
constexpr static auto kJavaDescriptor =
"Lcom/rnamapgeolocation/newarchitecture/components/MainComponentsRegistry;";
"Lcom/example/newarchitecture/components/MainComponentsRegistry;";

static void registerNatives();

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">RNAMapGeolocation</string>
<string name="app_name">example</string>
</resources>
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx512m -XX:MaxMetaspaceSize=512m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = 'RNAMapGeolocation'
rootProject.name = 'example'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class App extends React.Component {
}
await init({
ios: "9bd6c82e77583020a73ef1af59d0c759",
android: "043b24fe18785f33c491705ffe5b6935",
android: "c52c7169e6df23490e3114330098aaac",
});
}

Expand Down

0 comments on commit cbbd4ec

Please sign in to comment.