Tag: android-ndk

Android NDK: How to override onBackPressed in NativeActivity without java?

My app is written entirely in C/C++ using NativeActivity, it has no Java code (based on “native-activity” NDK example). Pressing “back” button closes it (destroys activity), but I need other behaivor of this button because I have my own UI and menus which are displayed via OpenGL. As I read, In order to change behaivor […]

LocalSocket communication with Unix Domain in Android NDK

I have Android application, which needs to establish unix domain socket connection with our C++ library (using Android NDK) public static String SOCKET_ADDRESS = “your.local.socket.address”; // STRING There is LocalSocket in java which accepts “string” (your.local.socket.address) #define ADDRESS “/tmp/unix.str” /* ABSOLUTE PATH */ struct sockaddr_un saun, fsaun; if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) […]

Android NDK plugin installation in eclipse SDK

When I am trying to install Android NDK plugin from Android Developer Tools Update Site – https://dl.google.com/android/eclipse/ in my Eclipse, it is showing the the following error message – I am using Android Developer Tools from Google, Build: v22.6.2-1085508. And I have downloaded android-ndk-r9d-windows-x86_64. ‘Installing Software’ has encountered a problem. An error occurred while collecting […]

android ndk multitouch?

im writing an application that uses only native code. So is it possible to get multitouch events in ndk? I feel like ive serched the whole web, but without finding anything! Does anyone know how to do this?

Setting up C++11 (std::thread) for NDK with ADT/Eclipse

I have been trying to use C++11. I am developing an android project and i want to use std::mutex. Along with OpenCV But no matter what I do, I just cant seem to fix the Type ‘mutex’ could not be resolved error. I have tried following the tutorials i found on SO and other places. […]

No JNI_OnLoad found in … skipping init

I’ve been getting this message for the past day or so, and up until now it hasn’t caused a problem. I got my code to run with my native library earlier but today I added a few new functions and again it will not work. There are no errors displayed in LogCat, but my program […]

100% Native C Application on Android?

Is there anyway I could write 100% native C code for Android? I know there are ways to write some C code inside Java code, but I don’t know any Java and I hate Java anyway. Is there anyway I could write pure C code that will run under Android?

LOCAL_LDLIBS vs. LOCAL_LDFLAGS

The Android NDK guide explains the two variables in the Adnroid.mk as follows: LOCAL_LDLIBS – The list of additional linker flags to be used when building your shared library or executable. … LOCAL_LDFLAGS – The list of other linker flags to be used when building your shared library or executable. … So what is the […]

CLI on DalvikVM fails on JNI lib

I need to run a command line version of java application on Android(Yeah I know it’s not trivial). I’m trying to start it using Dalvikvm, it actually starts but somewhere later my code fails because it starts using android.util.log and throws this exception. java.lang.UnsatisfiedLinkError: println_native at android.util.Log.println_native(Native Method) at android.util.Log.i(Log.java:159) at org.slf4j.impl.AndroidLogger.info(AndroidLogger.java:151) at org.gihon.client.TunnelingClient.<init>(TunnelingClient.java:62) at […]

How to detect which native shared libraries are loaded by Android application

My application uses native shared library (.so), I am loading it by calling System.loadLibrary(“xxx”). It loads fine and I can call the native methods. I wonder if there is any possibility to detect which shared libraries application uses. I tried to list loaded libraries by PackageManager: PackageManager pm = getPackageManager(); String applicationPackage = this.getApplicationInfo().packageName; ApplicationInfo […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.