There are a couple features of Android to be concerned.
By default Android devices detect orientation change. Doing this android destroys previous layout and redraws the new one with another orientation. So while browsing through JuceDemo one can experience unexpected things when orientation is changed. The Activity is completely recreated from scratch and all its state is cleared and the very first page is rendered to user. Basically you should save the state of activity in onPause method and restore it in onResume but it is some kind of a challenge
Audio Demo falls in exception ERROR/AndroidRuntime(7287): java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.
And it seems that Android Canvas Render option is not yet working. In “software render” mode it takes about 80% of CPU (800Mhz arm 6tj) to render “linear gradient” with “animate position” and “higher quality interpolation” that seems too much. I guess google suggests OpenGL ES as low-level API to Android’s graphic layer
Jules, I wish you all the very best of LUCK with Android The challenge is great!
I actually spent almost a week writing the canvas renderer, before finding out that it doesn’t provide anti-aliased clipping to paths, or clipping to image alpha channels, so it essentially useless… (It was also slow, not much better than the software renderer in my tests). I’ve put the software renderer in place for now, but I think the only workable long-term solution is to write an openGL ES renderer instead. As mentioned on another thread, if any experienced openGL devs want to volunteer for that job, I’d be happy to pay for it.
I finally managed to run the Android demo app on Windows, though I had to manually import the ComponentPeerView and JuceAppActivity classes in my project, as the “voodoo” (it’s still some kind of magic for me;-) link wouldn’t work.
I just have an additional question. With the current version can we build a Juce Android app for a 2.1 (version 7) target? When I try changing the version on my app, it just shuts down immediately and I can see the following log:
From the stack trace, my guess is that the google build tools must be linking something into the DLL that isn’t available on 2.1, and that’s why the DLL won’t load. Not sure what could be done about that - it’s not possible to build using an older version of the Android SDK, because only the latest one actually supports c++!
I’m new to Juce and I’m working on a new Android project that needs to use Juce (the iPhone version uses Juce). I’m trying to follow the instructions (in juce/docs/readme.html) for building Juce for Android, but I’m getting nowhere. According to the instructions I should create a new project with IntroJucer, which I could open with Eclipse. I create a new project (Console Application type, not sure). I expected to see an Android subdirectory in my-proj/Builds, but nothing was created.
Could someone pointed me the quick steps to create an Android project in Juce? Thanks in advance.
It’d need to be a “GUI app”, not a console app - and then you’d need to create an Android exporter target (use the button at the bottom of the introjucer’s project info page)
I was able to get the Android JuceDemo running on a Nexus 7. Cool. I did have to change
-I "../../JuceLibraryCode"
to
-I "../../../JuceLibraryCode"
in Android.mk to get it to compile. I was bummed to find out keyboard entry wasn’t working. But I have to give my praise to everything Jules has done with Juce. I think it’s awesome. Thanks Jules.
Glad you like it! What you say about needing to change the path is really odd, because nobody else has had any problems with it, and if your current directory is the Builds/Android directory, then everything should be correct… You weren’t trying to build from inside Builds/Android/jni, were you?