October 16, 2013
Would you mind posting your example code? I'm supposed to be exploring using D on android myself next week and a little kick to help get started would be cool; I've never actually done any android stuff.

As I understand it though, you aren't supposed to use native code for the bulk of the app which sucks. But still some D is better than no D.
October 16, 2013
On Wednesday, 16 October 2013 at 13:31:50 UTC, Adam D. Ruppe wrote:
> Would you mind posting your example code? I'm supposed to be exploring using D on android myself next week and a little kick to help get started would be cool; I've never actually done any android stuff.
>
> As I understand it though, you aren't supposed to use native code for the bulk of the app which sucks. But still some D is better than no D.

I don't mind, but the code is currently Java + D without any Android. I can post it in such state, the only thing that keeps me from moving it to Android is absence of D compiler with ARM back-end (though I'm sure it exists and I have even seen some articles about building D for ARM and Android).

Concluding, I can post the could if you like, or I can first try compiling it for ARM :-)

You're not supposed to use native code in Android, right, but many companies do. The company I work for uses C++ in order to make project cross-platform between iOS and Android.
October 16, 2013
On Wednesday, 16 October 2013 at 10:11:32 UTC, Andrew wrote:
> Hello there!
> I've decided to learn a bit of D, as I am currently Android Developer (mostly C++ <- JNI -> Java), I'm trying to create a D shared library which exports function (with extern (C)) for invocation from Java.
> My .d file contains only a single function returning an int, .java calls this function several times.
> This approach only works if d-function is trivial, e.g. it's not using any D functionality (I believe that it is related to GC and memory allocation).
> For example, if my d-function just returns some constant integer, java side receives it. core.stdc.stdio also works and allows console output, but it's not the case with std.stdio.writeln and similar functions.
> If I use any d-specific functions my program crashes while calling native code with some weird message like following:
> "Invalid memory access of location 0x0 rip=addr".
>
> It seems like D is not initialized at all, maybe there is some internal function like dinit() which I can call in order to activate everything?
>
> Thanks.


I just came here to ask same question :D

October 17, 2013
> Concluding, I can post the could if you like, or I can first try compiling it for ARM :-)
>

This might help :-

http://forum.dlang.org/post/dpzvxpncqabzxebgdmuq@forum.dlang.org
October 25, 2013
On Wednesday, 16 October 2013 at 14:39:23 UTC, Andrew wrote:
> Concluding, I can post the could if you like, or I can first try compiling it for ARM :-)

whatever's easiest for you. I have an arm cross compiler targeting the raspberry pi, not sure if that will work for the android device or not, I'll try it later (the device arrived yesterday, but I haven't had much of a chance to play with it yet). But I've never done JNI before either, so I'm starting more or less from scratch here.
1 2
Next ›   Last »