android-ndk

stack traces stop at the leaf register (lr)

白昼怎懂夜的黑 提交于 2020-01-14 05:14:25
问题 Often I see ARM stack traces (read: Android NDK stack traces) that terminate with an lr pointer, like so: #00 pc 001c6c20 /data/data/com.audia.dev.qt/lib/libQtGui.so #01 lr 80a356cc /data/data/com.audia.dev.rta/lib/librta.so I know that lr stands for link register on ARM and other architectures, and that it's a quick way to store a return address, but I don't understand why it always seems to store a useless address. In this example, 80a356cc cannot be mapped to any code using addr2line or

Android: WebView onClick not work?

余生颓废 提交于 2020-01-14 04:46:46
问题 I going to hide and show the Layout onclick of the webview. I have code like below: @Override public void onClick(View v) { switch(v.getId()){ case R.id.backButton: finish(); break; case R.id.webView: if(bottomShow){ bottomLayout.setVisibility(View.GONE); bottomShow = false; } else{ bottomLayout.setVisibility(View.VISIBLE); bottomShow = true; } break; } } I have also set the clickListener as like webView.setOnClickListener(this); but even after doing that i am not getting any effect. Why i am

Android: WebView onClick not work?

南楼画角 提交于 2020-01-14 04:46:09
问题 I going to hide and show the Layout onclick of the webview. I have code like below: @Override public void onClick(View v) { switch(v.getId()){ case R.id.backButton: finish(); break; case R.id.webView: if(bottomShow){ bottomLayout.setVisibility(View.GONE); bottomShow = false; } else{ bottomLayout.setVisibility(View.VISIBLE); bottomShow = true; } break; } } I have also set the clickListener as like webView.setOnClickListener(this); but even after doing that i am not getting any effect. Why i am

Visual Studio 2015, Android NDK with libc++ and cmath issues

£可爱£侵袭症+ 提交于 2020-01-14 02:58:08
问题 When creating a native Android NDK project with the new Visual Studio 2015 Preview and changing the STL to "LLVM libc++ static library (c++_static)", simply including <cmath> in the default "main.cpp" file and compiling with the default Clang 3.4 causes the following issues: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Apps\android-ndk-r10\sources\cxx-stl\llvm-libc++\libcxx\include\cmath(652,8): error : no member named 'float_t' in the global namespace 1> using ::float_t; 1> ~~^ 1>C:

Why vector allocation take so much time even with optimization level 3?

痴心易碎 提交于 2020-01-13 19:31:12
问题 Previously I asked this similar question here Android NDK: vector.resize() is too slow, related to allocation? Issue was that this code #include <chrono> #include <android/log.h> #include <vector> while (true) { const int sz = 2048*2048*3; std::vector<unsigned char> v; { auto startTime = std::chrono::system_clock::now(); v.resize(sz); auto duration = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - startTime); __android_log_print(ANDROID_LOG_ERROR,

Why vector allocation take so much time even with optimization level 3?

China☆狼群 提交于 2020-01-13 19:31:07
问题 Previously I asked this similar question here Android NDK: vector.resize() is too slow, related to allocation? Issue was that this code #include <chrono> #include <android/log.h> #include <vector> while (true) { const int sz = 2048*2048*3; std::vector<unsigned char> v; { auto startTime = std::chrono::system_clock::now(); v.resize(sz); auto duration = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - startTime); __android_log_print(ANDROID_LOG_ERROR,

How to expose a native enum to Java through JNI?

匆匆过客 提交于 2020-01-13 13:01:58
问题 I am importing headers from an existing project for a port to Android-NDK. In a few cases, there are enums defined in the native headers which I would like to use from the Java layer. How can one go about doing that? Ideally, I'd like to just expose the constants to the Java layer somehow, but I don't see a way to do that. The most obvious possibility is to doubly-define the enums in both Java and C++. However, the existing headers a) have no explicit numbering, b) have elements which are

How to expose a native enum to Java through JNI?

試著忘記壹切 提交于 2020-01-13 13:01:17
问题 I am importing headers from an existing project for a port to Android-NDK. In a few cases, there are enums defined in the native headers which I would like to use from the Java layer. How can one go about doing that? Ideally, I'd like to just expose the constants to the Java layer somehow, but I don't see a way to do that. The most obvious possibility is to doubly-define the enums in both Java and C++. However, the existing headers a) have no explicit numbering, b) have elements which are

How to optimize a native code with android-ndk (Speed Optimization)

拈花ヽ惹草 提交于 2020-01-13 09:28:14
问题 I'm compiling a native code using cygwin and Windows7. I got many optimization tips on Internet. APP_OPTIM := release ndk-build NDK_DEBUG=0 -DNDEBUG LOCAL_CFLAGS += -O2 But I can't understand exactly how to set these on Application.mk and Android.mk. I tried many cases by applying the above tips. but, I don't think that the optimization is applied in my native code. Application.mk APP_PROJECT_PATH := $(shell pwd) APP_MODULES := native_lib APP_OPTIM := release APP_BUILD_SCRIPT := Android.mk

Crashlytics Android NDK: missing all symbols in crash reports

笑着哭i 提交于 2020-01-13 09:10:53
问题 Our native Crashlytics crash reports are missing all symbol information as of late. I had hoped that the latest Crashlytics NDK would resolve the issue, but it does not. I see that there is a similar query out there, but in this case I am not using Firebase, just Crashlytics, and had been doing so successfully for quite some time. Our build.gradle (using CMake and the Gradle 3.0.0 or 3.1.0 Android plugin -- same issue either way) contains: buildscript { ... dependencies { ... classpath 'io