Is compiling for Android/iOS possible?

Joakim via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 8 07:40:02 PDT 2017


On Wednesday, 6 September 2017 at 18:34:28 UTC, Timothy Foster 
wrote:
> I'm just wondering if I made an application for 
> Windows/Mac/Linux if I could get it to also work on mobile 
> devices, or would I have to rewrite the application in another 
> language to get it to work? If it's possible, what should I be 
> looking at to get something like a "Hello World" example to 
> show on my phone using D?

Backend code that does most of the work, ie your business logic, 
should work fine in D on mobile devices.  For the frontend, I 
don't know of a good touch-enabled GUI that you could use in D 
though.  If you're okay with doing your GUI in the native 
language, ie Java on Android, then calling D for the backend, 
that will work.  There has been some preliminary work on getting 
a D GUI library, DlangUI, working on Android, but my 
understanding is that it isn't touch-optimized:

http://forum.dlang.org/thread/cdekkumjynhqoxvmgjze@forum.dlang.org

Ali gave you some good links to check out for simple apps on 
Android.  As for iOS, Dan was working on it, but he doesn't have 
time for it anymore, so it hasn't been kept up to date.

The upcoming ldc 1.4 official release will have easy support for 
Android, you can try it out with the current beta (you will need 
to cross-compile the stdlib for Android/ARM by using 
ldc-build-runtime, with a small tweak to druntime):

http://forum.dlang.org/thread/ojoyytdparflttnnaill@forum.dlang.org

We're refining the build process for Android in the ldc 1.4 
betas, so chip in if you'd like to see that done well.


More information about the Digitalmars-d-learn mailing list