android-ndk

How to build host static library with Android NDK?

旧城冷巷雨未停 提交于 2021-02-11 06:34:37
问题 I'm trying to build android adb tool from the sources. Since file Android.mk is presented i'm running ndk-build tool to build it. But unfortunately i'm having following errors: /Users/user/Documents/dev/tmp/adb/jni/Android.mk:95: /softdev/android-ndk-r10c/build/core/build-host-static-library.mk: No such file or directory /Users/user/Documents/dev/tmp/adb/jni/Android.mk:183: /softdev/android-ndk-r10c/build/core/build-host-executable.mk: No such file or directory Android NDK: Trying to define

Acess External SD card with NDK

╄→尐↘猪︶ㄣ 提交于 2021-02-10 15:19:40
问题 I'm developing a native apk for android with NDK 5. My question is, how do I access to write and read from external SD card from native code? PS: Testing under Galaxy Tab. 回答1: Have you tried: fopen("/sdcard/filename.ext", "r+") ? 回答2: Please read this answer, things are little bit complicated for Galaxy Tab 来源: https://stackoverflow.com/questions/4661664/acess-external-sd-card-with-ndk

How to call JNI Function from a method in C library

牧云@^-^@ 提交于 2021-02-10 12:54:09
问题 I'm currently developping an android app with android studio, for this project i need to use a custom library written in c/c++ . So i in order to do that i needed to use NDK. The library contain methods that i need to implements in order to have access to specifics fonctions in android My question is : how can I call my jni method inside the method existing in c which will call a java method to store session key in the android system So for a pratical exemple since it's maybe not clear: In a

File hierarchy with Android native AAssetManager

99封情书 提交于 2021-02-10 06:26:32
问题 Issue I wonder how to make file hierarchy of assets folder in Android from native code. I'm using AAssetManager_openDir but AAssetDir_getNextFileName doesn't return any directory names so basically I have no way to dive deeper into hierarchy because I can't obtain names of subfolders. Is there any way to resolve this issue with AAssetManager or should I implement this in Java? Example Assets looks like a/ file1 file2 b/ file3 c/ file4 C++ code AAssetDir* assetDir = AAssetManager_openDir(env,

How to restrict usage of an API key with Hash comparison

断了今生、忘了曾经 提交于 2021-02-10 06:22:07
问题 I'm currently using Spotify in my Android app, but I am required to use a Secret in order to refresh tokens and such. I would like to transmit the secret from my Backend to the app, so the secret does not reside in the APK and cannot be found when decompiling. I've read a lot only about securing secrets in your app, via various ways like proxies, just using your own backend, putting the code into native C++ code (NDK) in the app or using the Hash of the app to determine whether the app is

Using AssetManager class from Android NDK in a Flutter app

♀尐吖头ヾ 提交于 2021-02-10 03:04:43
问题 I've been trying to use the Android NDK's AssetManager class in my Flutter app, that works with Google Oboe, to access to audio files. Following this example in the Oboe repository, I learned that they obtain the AssetManager from Java like this: JNIEXPORT void JNICALL Java_com_google_oboe_sample_rhythmgame_MainActivity_native_1onStart(JNIEnv *env, jobject instance, jobject jAssetManager) { AAssetManager *assetManager = AAssetManager_fromJava(env, jAssetManager); if (assetManager == nullptr)

Using AssetManager class from Android NDK in a Flutter app

女生的网名这么多〃 提交于 2021-02-10 03:03:28
问题 I've been trying to use the Android NDK's AssetManager class in my Flutter app, that works with Google Oboe, to access to audio files. Following this example in the Oboe repository, I learned that they obtain the AssetManager from Java like this: JNIEXPORT void JNICALL Java_com_google_oboe_sample_rhythmgame_MainActivity_native_1onStart(JNIEnv *env, jobject instance, jobject jAssetManager) { AAssetManager *assetManager = AAssetManager_fromJava(env, jAssetManager); if (assetManager == nullptr)

Using AssetManager class from Android NDK in a Flutter app

不羁的心 提交于 2021-02-10 03:00:09
问题 I've been trying to use the Android NDK's AssetManager class in my Flutter app, that works with Google Oboe, to access to audio files. Following this example in the Oboe repository, I learned that they obtain the AssetManager from Java like this: JNIEXPORT void JNICALL Java_com_google_oboe_sample_rhythmgame_MainActivity_native_1onStart(JNIEnv *env, jobject instance, jobject jAssetManager) { AAssetManager *assetManager = AAssetManager_fromJava(env, jAssetManager); if (assetManager == nullptr)

Where to put c++ .so library needed for my android application

那年仲夏 提交于 2021-02-08 10:39:12
问题 I made an ndk based android app, and when I run it by clicking the run button in Android Studio, I found the app been installed, and running on my connected android device. But it complains that it could not load some .so files like libc++_shared.so and libomp.so , I did some research, and created a jniLibs in my app\src\main folder, and copied those two .so files into that, now everything works fine. However, it is still unclear to me what happened exactly: when I click the run button, where

Where to put c++ .so library needed for my android application

吃可爱长大的小学妹 提交于 2021-02-08 10:37:25
问题 I made an ndk based android app, and when I run it by clicking the run button in Android Studio, I found the app been installed, and running on my connected android device. But it complains that it could not load some .so files like libc++_shared.so and libomp.so , I did some research, and created a jniLibs in my app\src\main folder, and copied those two .so files into that, now everything works fine. However, it is still unclear to me what happened exactly: when I click the run button, where