how to help with android

Jacob Carlborg doob at me.com
Wed Jul 25 23:21:51 PDT 2012


On 2012-07-25 19:35, Johannes Pfau wrote:

> * Android doesn't officially support native executables. I'm not sure
>    where this statement is hidden, but it is an official statement. For
>    example their linker is broken when accessing a global variable from
>    a native application in a specific way. Just to emphasize how bad
>    this really is: If you want to access stdout (the C global variable)
>    which is used in writeln for example, you have to use hacks and
>    dladdr to load the address of stdout. You can't simply declare it as
>    external. So you can't actually write a hello world native
>    exacutalbe with D for Android. The Android devs don't care about
>    those issues, as native executables are not supported anyway.
>    But you wouldn't want to use native executables anyway. For example
>    native executables have no possibility to draw a GUI. There's just no
>    way to access the required window handle from a native executable.
>    Instead the supported way to write a "Native Application" is to write
>    a Java stub which loads a shared .so library and calls functions of
>    that library. With recent versions of Android/NDK you don't have to
>    write that stub yourself, it's included in the "NativeApplication"
>    but it still works the same way: Java code loads a .so library.
>    Which leads to the next problem:

I just have to say, that is so wrong on so many levels.

-- 
/Jacob Carlborg


More information about the D.gnu mailing list