Hot answers tagged jni
When I worked with the NDK a year ago, I build the .so file with the NDK make. Then I copied the .so from the NDK to the /lib folder of my project. It worked without a problem. Do the method names in your NDK-Project match the fully qualified class-/methodnames of the classes where you want to call the JNI functions? If you have a class: package com.example;...
It's a bit inconvenient: You have to create each array manually, along each dimension: Create an object array with size sizeX, with element type [[I (a 2D int array) At each entry of this array: Create an object array, with size sizeY, with element type [I (a 1D int array) At each entry of this array: Create an int array, with size sizeZ Here is an ...
Your package name doesn't need to match the package where you put your classes. When you write your AndroidManifest.xml you specify both the package for the game and the path to your activity. So use something like com.company.engine for your activity and your C++ and just create a new package name for the game.
Since Unity 4.2 there is a class called Androidjavaproxy which can do exactly what you are looking for. This class can implements any Java interface in Unity.
Main Unity selling point is that it is cross platform. What this means for your question is that I would strongly suggest not calling SDK functions directly, but doing as much as possible through Unity provided API's. In short do the authentication using Unity API. This way, you will write connectivity code once, and it will work on all platforms. Unity will ...
The problem was in the Android manifest. My main class inheriting from Application was not added as the main application class in the description. Once added, the app called a new object and the OnCreate method where I could initialize OpenFeint. As OpenFeint is open you can now statically call the OpenFeint functions to open the different views.
Only top voted, non community-wiki answers of a minimum length are eligible