How to access resource with dynamic name in my case?

int id = getResources().getIdentifier(imageName, type, package); This will get you the ID of the resource you are looking for. With it, you can then access the resource from the R class. Using only the name parameter: You can also include all the 3 info in the “name” parameter using the following format: “package:type/image_name”, something like: … Read more

How to compile ffmpeg-2.2.2 on windows with cygwin and android ndk r9c

Start with Roman’s tutorial. Following changes apply to Windows: you should use the NDK make.exe, not the one from cygwin. So, I simply wrote d:/dev/Android/ndk/prebuilt/windows-x86_64/bin/make.exe in my build_android.sh. For some weird reason, I could not run make clean – but I simply chose to ignore this problem for now. Following the tutorial, don’t forget to … Read more

Get function names from call stack

You should have a copy of arm-eabi-addr2line available in the NDK bin directory. You can use this with a command like: arm-eabi-addr2line -f -e /path/to/lib/with/symbols.so 0x001fb18a That will crawl through the debug symbols in the shared lib to get file and line number information. For best results hand it a library that hasn’t had the … Read more

Using Android Studio with Vuforia [closed]

Read our Getting Started Guide for instructions on setting up the Java SDK, Android SDK and NDK: https://developer.vuforia.com/resources/dev-guide/getting-started-android-native-sdk Make sure you have installed the latest version available of Android Studio from: http://developer.android.com/sdk/index.html Use the Android SDK Manager (from within Android Studio) to get the latest Android SDK and Android Platform and Build tools Launch Android … Read more

OpenCv with Android studio 1.3+ using new gradle – undefined reference

After few weeks of pain, I succed. Here is my correct code for Android studio 1.3.1, OpenCv 2.4.11. First you should do this OpenCV in Android Studio (don’t use paths which contains white space, both for project and opencv extraction folder) then, for opencv to be native: gradle-wrapper.properties: distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip build.gradle(application): classpath ‘com.android.tools.build:gradle-experimental:0.2.0’ build.gradle(module): apply plugin: … Read more

Write file to location other than SDcard using Android NDK?

You can always access the directory in which your app is placed. This directory is usually : data/data/<Your_package_name_usually com.android.appName>/files/<your_filename> but better use getFilesDir() to ensure valid filepath with future version changes of android. If you wanna use external storage instead, make sure you place this line of code in your app manifest to gain permission. … Read more

tech