jellybean / nexus 7 notes / develop branch

Hi folks,

I just went through the setup / install process of OF and wanted to share my results / notes. There is a decent chance some of the “issues” I note below could be mitigated, but at this point I felt it would be good to at least simply document them.

Overall experience with setup pretty good. Since the guides didn’t indicate whether the develop branch in git would work I was expecting it not to work at all frankly. Glad it did. I’m going to look into a few of the bugs found below next before I start any app development.

OF: using develop branch from git
Device: Nexus 7 / Jelly Bean 4.1.1
Dev box OS: OS X
Eclipse: Version: 3.6.2.r362_v20110210-9gF78Gs1FrIGnHDHWkEcopoN8AmxeZflGDGKQi
NDK: vr8
SDK: latest from google, have all the android API versions active.

General comments on setup/docs:

  • Eclipse seems to by default auto-build the workspace. This is a waste of time as you import the projects to your workspace as they will fail. Good idea to make sure you disable that setting in Eclipse preferences
  • Considering I had eclipse already installed, the “you will see a popup asking what workspace to use” is not always the case. But just to be safe I cleared the workspace I had setup and started a new one.
    “g) Start Eclipse: You will see a pop up asking you what workspace to use. Just point it to: openFrameworks/examples/android.”

General comments on the code:

  • the suspend / resume for the examples (hopefully it’s not in the core!) seems a bit buggy across all apps. Can elaborate more if you’re interested.
    • All apps seem to have an input/event crashbug consistently related to when I send many touch inputs. See stack trace.**
      /AndroidRuntime(29498): FATAL EXCEPTION: main
      E/AndroidRuntime(29498): java.lang.IllegalArgumentException: pointerIndex out of range
      E/AndroidRuntime(29498): at android.view.MotionEvent.nativeGetAxisValue(Native Method)”

androidAdvanced3DExample - This app doesn’t build

  • make: *** No rule to make target `AndroidInstall’. Stop.
  • make: *** No rule to make target `AndroidRelease’. Stop.

Most apps build/installs/runs OK

** androidCameraExample, androidOpenCVExample - Builds/installs OK, but crashes on launch**

  • both crash immediately on launch, not surprised since the device has no rear camera :slight_smile:
    E/AndroidRuntime(30020): FATAL EXCEPTION: GLThread 771
    E/AndroidRuntime(30020): java.lang.NullPointerException
    E/AndroidRuntime(30020): at cc.openframeworks.OFAndroidVideoGrabber.initGrabber(

androidImageExample - App builds/runs, but doesn’t work properly

  • screen is blank other than title
  • logcat reports “Couldn’t load image from bikers.jpg
    W/OF (30388): ofGLRenderer::draw(): texture is not allocated”

** androidSoundPlayerExample - builds/launches OK, but crashes on launch, but for different reason than camera/video app**

  • E/AndroidRuntime(30976): java.lang.ExceptionInInitializerError
    E/AndroidRuntime(30976): at cc.openframeworks.androidSoundPlayerExample.OFActivity.onCreate(
    E/AndroidRuntime(30976): at
    E/AndroidRuntime(30976): at
    E/AndroidRuntime(30976): at
    E/AndroidRuntime(30976): at
    E/AndroidRuntime(30976): at$600(
    E/AndroidRuntime(30976): at$H.handleMessage(
    E/AndroidRuntime(30976): at android.os.Handler.dispatchMessage(
    E/AndroidRuntime(30976): at android.os.Looper.loop(
    E/AndroidRuntime(30976): at
    E/AndroidRuntime(30976): at java.lang.reflect.Method.invokeNative(Native Method)
    E/AndroidRuntime(30976): at java.lang.reflect.Method.invoke(
    E/AndroidRuntime(30976): at$
    E/AndroidRuntime(30976): at
    E/AndroidRuntime(30976): at dalvik.system.NativeStart.main(Native Method)
    E/AndroidRuntime(30976): Caused by: java.lang.UnsatisfiedLinkError: Couldn’t load OFAndroidApp: findLibrary returned null
    E/AndroidRuntime(30976): at java.lang.Runtime.loadLibrary(
    E/AndroidRuntime(30976): at java.lang.System.loadLibrary(
    E/AndroidRuntime(30976): at cc.openframeworks.OFAndroid.(

androidVBOExample - fails loading neon library. But app runs
I/OF (31238): java.lang.UnsatisfiedLinkError: Couldn’t load neondetection: findLibrary returned null
I/OF (31238): at java.lang.Runtime.loadLibrary(
I/OF (31238): at java.lang.System.loadLibrary(
I/OF (31238): at cc.openframeworks.OFAndroid.(

I’m working on a project that will be 4.1 and higher compatible only.

So far so good, anyway, I can confirm touch input crash. Here’s the issue on GitHub and a fix:

I can’t get the fix to work though.

Also, can I ask how do you restore app state after user pushed the power button? It wipes all the textures, how do I tell the openframeworks c++ code to reload it?

Cool, thanks for pointing out the bugfix. It works for me. I just copied it over the file, cleaned my projects and rebuilt.

I’ve also managed to get it work, but now the build system fails with

make[1]: *** [libs/armeabi/] Error 1
make: *** [AndroidRelease] Error 2

Do you know what may be the cause? Some linking error?

Are you sure that you’ve highlighted your app folder in eclipse before doing the build? I get weird errors in eclipse if my mouse isn’t in the right spot. Also try a clean all for your workspace.

@michels, thanks for the assistance, no, it wasn’t related to this. Highlighting the project sets {project_loc} in Eclipse, and you’ll get an error if no {project_loc} is set. For those who may face the same error as me, I’ll say that after a couple of days fighting with a compiler (sadly I’m not a makefile expert, to say the least) I found that this error was actually caused by my own improper code, even though the compiler output looked just like there was some OF part that doesn’t wants to get compiled. Sometimes, output you see in Eclipse doesn’t point in the right direction. I still don’t know what was the cause exactly, I’ve refactored my app step-by-step from the ground up and now it works fine.

Can you confirm ofSetLineWidth() doesn’t work on 4.1?