From c239a76a5022aa3c0c49161571b21d301b790430 Mon Sep 17 00:00:00 2001 From: Alexey Pelykh Date: Tue, 26 Feb 2013 09:00:00 +0200 Subject: [PATCH] Native libraries loading --- OsmAnd/jni/Android.mk | 1 + .../plus/render/NativeOsmandLibrary.java | 26 +++++++------------ 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/OsmAnd/jni/Android.mk b/OsmAnd/jni/Android.mk index 7377ff8169..972b6956d8 100755 --- a/OsmAnd/jni/Android.mk +++ b/OsmAnd/jni/Android.mk @@ -1,5 +1,6 @@ OSMAND_MAKEFILES := \ $(all-subdir-makefiles) \ + $(call my-dir)/../../../jni/Android.mk \ $(call my-dir)/../../../core/Android.mk \ $(call all-makefiles-under,$(call my-dir)/../../../core/externals) diff --git a/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java b/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java index 65adf4f5ba..c985c58141 100644 --- a/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java +++ b/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java @@ -41,23 +41,15 @@ public class NativeOsmandLibrary extends NativeLibrary { log.debug("Loading jnigraphics, since Android >= 2.2 ..."); //$NON-NLS-1$ System.loadLibrary("jnigraphics"); } - if(!cpuHasNeonSupport()) { - log.debug("Loading native osmand..."); //$NON-NLS-1$ - System.loadLibrary("Qt5Core"); - System.loadLibrary("Qt5Network"); - System.loadLibrary("Qt5Concurrent"); - System.loadLibrary("Qt5Sql"); - System.loadLibrary("Qt5Xml"); - System.loadLibrary("osmand"); - } else { - log.debug("Loading native osmand with NEON..."); //$NON-NLS-1$ - System.loadLibrary("Qt5Core_neon"); - System.loadLibrary("Qt5Network_neon"); - System.loadLibrary("Qt5Concurrent_neon"); - System.loadLibrary("Qt5Sql_neon"); - System.loadLibrary("Qt5Xml_neon"); - System.loadLibrary("osmand_neon"); - } + final String libCpuSuffix = cpuHasNeonSupport() ? "_neon" : ""; + log.debug("Loading native libraries..."); //$NON-NLS-1$ + System.loadLibrary("Qt5Core" + libCpuSuffix); + System.loadLibrary("Qt5Network" + libCpuSuffix); + System.loadLibrary("Qt5Concurrent" + libCpuSuffix); + System.loadLibrary("Qt5Sql" + libCpuSuffix); + System.loadLibrary("Qt5Xml" + libCpuSuffix); + System.loadLibrary("OsmAndCore" + libCpuSuffix); + System.loadLibrary("OsmAndJNI" + libCpuSuffix); log.debug("Creating NativeOsmandLibrary instance..."); //$NON-NLS-1$ library = new NativeOsmandLibrary(); log.debug("Initializing rendering rules storage..."); //$NON-NLS-1$