# Juce on Android

**URL:** <https://forum.juce.com/t/juce-on-android/3529>\
**Category:** Linux\
**Created:** [January 13, 2009, 10:46pm UTC](https://forum.juce.com/t/juce-on-android/3529 "2009-01-13T22:46:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce\_Wheaton](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@Bruce\_Wheaton](https://forum.juce.com/u/Bruce_Wheaton)\
**Post date:** [January 13, 2009, 10:46pm UTC](https://forum.juce.com/t/juce-on-android/3529/1 "2009-01-13T22:46:53Z")

</div>

so, apart from juce might make it to iPhone, what about Android?

Sadly, it doesn’t seem to be straight forward Linux, but a pretty thick layer on top.

Bruce

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 14, 2009, 10:13am UTC](https://forum.juce.com/t/juce-on-android/3529/2 "2009-01-14T10:13:04Z")

</div>

Well, it’d be nice, but I don’t know anything about the architecture it uses. Isn’t it all done is Java?

---

<div class="post-metadata">

**Author:** ![kunitoki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kunitoki/32/15_2.png) [@kunitoki](https://forum.juce.com/u/kunitoki)\
**Post date:** [January 14, 2009, 12:17pm UTC](https://forum.juce.com/t/juce-on-android/3529/3 "2009-01-14T12:17:04Z")

</div>

well yes and no.  
it uses Dalvik as interpreter for bytecode, which (bytecode) in turn is generated by a java compiler. But Dalvik bytecode and java bytecode are different from what i know.

---

<div class="post-metadata">

**Author:** ![Bruce\_Wheaton](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@Bruce\_Wheaton](https://forum.juce.com/u/Bruce_Wheaton)\
**Post date:** [January 14, 2009, 1:04pm UTC](https://forum.juce.com/t/juce-on-android/3529/4 "2009-01-14T13:04:26Z")

</div>

But no, ☹ it doesn’t seem easy to use C++. Sorry, never mind.

Bruce

---

<div class="post-metadata">

**Author:** ![kunitoki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kunitoki/32/15_2.png) [@kunitoki](https://forum.juce.com/u/kunitoki)\
**Post date:** [January 16, 2009, 5:56pm UTC](https://forum.juce.com/t/juce-on-android/3529/5 "2009-01-16T17:56:11Z")

</div>

At least it could be run in OpenMoko. We only need to make juce run on the ARM platform.

---

<div class="post-metadata">

**Author:** ![mickey](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mickey](https://forum.juce.com/u/mickey)\
**Post date:** [February 16, 2009, 2:12am UTC](https://forum.juce.com/t/juce-on-android/3529/6 "2009-02-16T02:12:23Z")

</div>

Indeed, I have asked a couple of times for removing the x86isms that prevented me to cross-compile Juce. If that was done, it could have a nice future on x11-based smartphone platforms.

Mickey ([freesmartphone.org](http://freesmartphone.org); funded by Openmoko, Inc.)

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 16, 2009, 10:07am UTC](https://forum.juce.com/t/juce-on-android/3529/7 "2009-02-16T10:07:16Z")

</div>

[quote=“mickey”]Indeed, I have asked a couple of times for removing the x86isms that prevented me to cross-compile Juce. If that was done, it could have a nice future on x11-based smartphone platforms.

Mickey ([freesmartphone.org](http://freesmartphone.org); funded by Openmoko, Inc.)[/quote]

Have you? Can you remind me which x86isms you mean…?

---

<div class="post-metadata">

**Author:** ![mickey](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mickey](https://forum.juce.com/u/mickey)\
**Post date:** [February 17, 2009, 7:39pm UTC](https://forum.juce.com/t/juce-on-android/3529/8 "2009-02-17T19:39:38Z")

</div>

Oh well, as you can see at my join date, it’s been over 3 years since I last tried 🙂 Let me try to cross-compile the latest version for armv4t and then I’ll give you an update.

---

<div class="post-metadata">

**Author:** ![mickey](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mickey](https://forum.juce.com/u/mickey)\
**Post date:** [February 17, 2009, 7:59pm UTC](https://forum.juce.com/t/juce-on-android/3529/9 "2009-02-17T19:59:21Z")

</div>

Ok, here we go. First itch was hardcoded includes to /usr/include, these are interfering when cross-compiling. After patching these out, it bails out like that:

```auto
ERROR: function do_compile failed
ERROR: log data follows (/local/pkg/oe/fic-gta02/tmp/work/armv4t-angstrom-linux-gnueabi/juce-1.46-r0/temp/log.do_compile.10609)
| NOTE: make -j5 -e MAKEFLAGS=
| ==== Regenerating Makefiles ====
| Generating GNU makefiles:
| ...JUCE
| ==== Building JUCE ====
| juce_Random.cpp
| juce_RelativeTime.cpp
| juce_Logger.cpp
| juce_Time.cpp
| juce_SystemStats.cpp
| ../../src/juce_core/basics/juce_Atomic.h: In function 'void juce::initialiseJuce_NonGUI()':
| ../../src/juce_core/basics/juce_Atomic.h:98: error: impossible constraint in 'asm'
| ../../src/juce_core/basics/juce_Atomic.h:137: error: impossible constraint in 'asm'
| ../../src/juce_core/basics/juce_DataConversions.h:52: error: impossible constraint in 'asm'
| make[1]: *** [../../bin/intermediate_linux/Debug/juce_SystemStats.o] Error 1
| make: *** [JUCE] Error 2
| FATAL: oe_runmake failed
```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 18, 2009, 1:55pm UTC](https://forum.juce.com/t/juce-on-android/3529/10 "2009-02-18T13:55:34Z")

</div>

Well, if you have a look where it’s failing, you’ll see there’s a JUCE\_USE\_GCC\_ATOMIC\_INTRINSICS flag that will probably avoid that problem.

There might be a few places like that where the build system needs a tweak to cope with new platforms.

---

<div class="post-metadata">

**Author:** ![mucoder](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mucoder/32/595_2.png) [@mucoder](https://forum.juce.com/u/mucoder)\
**Post date:** [September 20, 2010, 1:04pm UTC](https://forum.juce.com/t/juce-on-android/3529/11 "2010-09-20T13:04:19Z")

</div>

well, given the new batch of android tablets that are just coming out, having Juce on Android would be fantastic.  
I’m thinking midi touch screen controllers, audio apps on the road, …

and btw, you _can_ develop in C++ for Android, with the native SDK:  
[http://developer.android.com/sdk/ndk/index.html](http://developer.android.com/sdk/ndk/index.html)

I’m sure Juce could become one the hottest frameworks on the planet if it covers both IPhone/Pad and Android  
😉

---

<div class="post-metadata">

**Author:** ![cpr2323](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/cpr2323/32/18682_2.png) [@cpr2323](https://forum.juce.com/u/cpr2323)\
**Post date:** [September 20, 2010, 4:33pm UTC](https://forum.juce.com/t/juce-on-android/3529/12 "2010-09-20T16:33:31Z")

</div>

The Native SDK is NOT for application development. It is only for library development. There are a limited number of API’s available.

[http://developer.android.com/sdk/ndk/index.html#overview](http://developer.android.com/sdk/ndk/index.html#overview)

---

<div class="post-metadata">

**Author:** ![mucoder](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mucoder/32/595_2.png) [@mucoder](https://forum.juce.com/u/mucoder)\
**Post date:** [September 21, 2010, 12:00am UTC](https://forum.juce.com/t/juce-on-android/3529/13 "2010-09-21T00:00:00Z")

</div>

I am aware of the fact that the NDK is not the mainstream way of developing for Android and there very probably will be a need for some java code to make things work

but then again, if a native version of Quake can be ported with support for audio, keyboard input, touchscreen, trackball and 3D graphics… [http://code.google.com/p/kwaak3/](http://code.google.com/p/kwaak3/)

---

<div class="post-metadata">

**Author:** ![cpr2323](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/cpr2323/32/18682_2.png) [@cpr2323](https://forum.juce.com/u/cpr2323)\
**Post date:** [September 21, 2010, 5:35am UTC](https://forum.juce.com/t/juce-on-android/3529/14 "2010-09-21T05:35:29Z")

</div>

point taken… some java glue will be needed… especially as there is no native access to the audio api’s…

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [September 21, 2010, 8:35am UTC](https://forum.juce.com/t/juce-on-android/3529/15 "2010-09-21T08:35:46Z")

</div>

Wrapping a game like quake is pretty easy, TBH - all it needs to do is give it a buffer to draw into and forward the mouse events to it. Doing a full port of juce would involve vastly more interaction with the OS, and should ideally use the standard java classes for rendering graphics, as that’s the only way to get hardware acceleration. Plus, the native SDK is a PITA to build as it’s all processor-specific… So my feeling is that although compiling a c++ app into java bytecode is a bit of a strange thing to do, it’s probably the only way that’ll work well and be portable to any device.

There’s already a compiler called LLJVM which produces bytecode from c++, I need to experiment with it and try to figure out if it’s feasible to build such a big project that way.

---

<div class="post-metadata">

**Author:** ![mucoder](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mucoder/32/595_2.png) [@mucoder](https://forum.juce.com/u/mucoder)\
**Post date:** [September 21, 2010, 12:54pm UTC](https://forum.juce.com/t/juce-on-android/3529/16 "2010-09-21T12:54:27Z")

</div>

Hi Jules, the LLJVM route sounds very intriguing indeed… If real-world C++ can run on a JVM while keeping reasonable performance, that would be amazing. Love to hear what you find out

---

<div class="post-metadata">

**Author:** ![mucoder](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mucoder/32/595_2.png) [@mucoder](https://forum.juce.com/u/mucoder)\
**Post date:** [September 28, 2010, 10:21pm UTC](https://forum.juce.com/t/juce-on-android/3529/17 "2010-09-28T22:21:58Z")

</div>

since we’re on the topic of cross-compiling C++ to unusual environments: how about this for inspiration?

[http://createdigitalmusic.com/2010/09/28/a-powerful-music-tracker-in-your-browser-completely-free/?utm\_source=feedburner&utm\_medium=feed&utm\_campaign=Feed%3A+createdigitalmusic+%28createdigitalmusic.com%29](http://createdigitalmusic.com/2010/09/28/a-powerful-music-tracker-in-your-browser-completely-free/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+createdigitalmusic+%28createdigitalmusic.com%29)

If I understand right, this thingie is an existing C++ code base recompiled to run as flash in your browser…  
Don’t know how much effort it was to port the graphics/audio access to the flash api’s though… And no right-clicks! But still quite impressive

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [September 29, 2010, 8:53am UTC](https://forum.juce.com/t/juce-on-android/3529/18 "2010-09-29T08:53:27Z")

</div>

Cool. The flash compiler stuff is pretty neat too (except that I think flash is probably doomed in the long-run). Cross-compiling Juce to javascript/HTML5 is also something I want to investigate.

---

<div class="post-metadata">

**Author:** ![OBO](https://avatars.discourse-cdn.com/v4/letter/o/ba8739/32.png) [@OBO](https://forum.juce.com/u/OBO)\
**Post date:** [September 29, 2010, 10:59am UTC](https://forum.juce.com/t/juce-on-android/3529/19 "2010-09-29T10:59:11Z")

</div>

Googles Native Client (NaCl) might be the solution to both Android and to next generation browser plugins.  
It’s c++ and has a crossplatform Multimedia API called Pepper.  
Next month the Google App Store will eventually launch, which is also very interesting!

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [September 29, 2010, 11:47am UTC](https://forum.juce.com/t/juce-on-android/3529/20 "2010-09-29T11:47:01Z")

</div>

I don’t think I’d want to rely on NaCl - it’s not cross-browser, and they could just ditch it at any time if it’s not a huge success. Better to concentrate on targets like java or HTML5 which have a safer long-term future.

[Next page](https://forum.juce.com/t/juce-on-android/3529.md?page=2)
