android-ndk

Autoconf triplet for Android x86_64?

大憨熊 提交于 2019-12-25 04:45:19
问题 I wanted to examine the issue from this question: Android NDK for x86_64 has no reference for bcopy and index. In the question, the poster asked about Android x86_64 and bcopy in relation to the Lame sound library. I set up my cross-compile environment, set the paths for tools and sysroot, and exported the usual suspects like CC , CXX CFLAGS , CXXFLAGS , etc. For example: $ echo $CC x86_64-linux-android-gcc $ which x86_64-linux-android-gcc /opt/android-ndk-r10d/toolchains/x86_64-4.9/prebuilt

Writing to an Android display from ndk

眉间皱痕 提交于 2019-12-25 04:42:37
问题 Writing directly to the framebuffer no longer works. Is there anyway to write to the display in the NDK? I might use ANativeWindow but that requires an existing surface. Is there a better way? Or is the only way to create a surface, natively, and then use ANativeWindow? 回答1: The display is owned by SurfaceFlinger and Hardware Composer, so unless you're planning to halt the Android framework you will need to work through them. (See the graphics architecture doc for more details.) If you're

Runtime linking error with SDL_Mixer and SMPEG2 on Android

风格不统一 提交于 2019-12-25 04:42:32
问题 I managed to fix the previous linking problem I had with NDK which was caused by android api 21, and managed to get SDL_TTF built and working easily, but with SDL_Mixer I bumped into another runtime Unsatisfiedlinkererror where the app somehow can't link smpeg2 lib with SDL2_Mixer. This time I don't see how it could have anything to do with api-level and have tried everything I could come up with, gone through every makefile and triple-checked every version. I am using SDL_Mixer 2.0.0 and

“UnsatisfiedLinkError: Native method not found” but correct naming?

孤者浪人 提交于 2019-12-25 04:27:16
问题 My native method cannot be found and I cannot solve it. java code: package org.cocos2dx.cppemptytest; public class TestJNI { static { System.loadLibrary("cpp_empty_test"); } public native String moveto(); } native code: #include "AppDelegate.h" #include "platform/android/jni/JniHelper.h" #include <jni.h> #include <android/log.h> #include <stdlib.h> #include "cocos2d.h" #define LOG_TAG "main" #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) using namespace cocos2d;

Buffering URI on OpenSL, Android

妖精的绣舞 提交于 2019-12-25 04:19:17
问题 I have been trying the OpenSL for a few weeks now. I'm trying to access to the buffer while playing a file on sdcard via SL_DATALOCATOR_URI as a source. I want to write a few effects of my own and need the buffer. Currently in the code, I'm creating two audio players. One is reading the file to buffer, other is writing the buffer to the output. When I'm testing the code with the microphone (recorder), everything is fine. Sound in-out works as expected. When I switch the recorder with a uri

ERROR: '__NDK_FPABI__' does not name a type. Version 2

早过忘川 提交于 2019-12-25 03:26:56
问题 I have exactly the same problem described here ERROR: '__NDK_FPABI__' does not name a type but I don't understand the answer or I am doing it wrong; I need more details. This is my enviroment: Trying to compile a .so (thridparty) in order to use it in my Android app. This is a standalone lib, not in any Android project (not in project/jni) Host OS: Ubuntu 12.10 x86 Android NDK version r9d What I have done is: Open lib.so's Makefile -> change paths to /usr/include to $NDK_HOME/platform/android

“dlopen: Invalid argument” when loading native activity

最后都变了- 提交于 2019-12-25 02:46:48
问题 I'm using the following bootstrapping code to load my native activity (jngl-test): #include <android/native_activity.h> #include <android/log.h> #include <dlfcn.h> #include <errno.h> #include <stdexcept> const std::string LIB_PATH = "/data/data/com.bixense.jngl_test/lib/"; void* load_lib(const std::string& l) { void* handle = dlopen(l.c_str(), RTLD_NOW | RTLD_GLOBAL); if (!handle) { throw std::runtime_error(std::string("dlopen(") + l + "): " + strerror(errno)); } return handle; } void

how to compile and modify android 4.0.3 source code in eclipse using windows

穿精又带淫゛_ 提交于 2019-12-25 01:33:59
问题 I have downloaded the android source code 4.0.3, installed cygwin with make and gcc, and downloaded ndk and sdk, integrated eclipse with cdt and adt. Using windows 7 64bit. Can you guys tell me how to build this source code in eclipse in order to customize the native settings menu. Thanks in advance. FYI :I have been through google, stackoverflow, but couldn't find any lead which works. 回答1: See these pages in the Developer docs: Initializing a Build Environment. This page seems to indicate

How to transform C code to JNI Code

☆樱花仙子☆ 提交于 2019-12-25 01:18:46
问题 I have C code ( testFile .c) that I want to used in Android App, using JNI. This code contains pure C code and it has many methods inside. Moreover, it also calls some C header files ( file1 .h, file2 .h). For example: testFile .c #include "file1.h" #include "file2.h" void myMethod1() { ... ... } void myMethod2() { ... ... } void myMethod3() { ... ... } Whether I have to transform whole of testFile .c to JNI code, or just transform some methods that will i used later (not all of them)? Should

How to import the cURL built library into Android NDK [duplicate]

∥☆過路亽.° 提交于 2019-12-25 01:08:16
问题 This question already has answers here : Using cURL in Android (7 answers) Android NDK use .so library from c code inside JNI (1 answer) Closed 4 years ago . I'm trying to setup cURL (or libcurl) on the .c side of my android application (in the ndk) and in order to keep this as simple as possible I'm trying to import an already built library into my project, instead of the whole source code. I have found several websites on how to import cURL as source code on Android, but even those