www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Android LDC in a Container

reply Andre Pany <andre s-e-a-p.de> writes:
Hi,

on Dockerhub I published a repository which makes it really easy 
to develop Android
applications using LDC and Joakims work. The repository contains 
Android 1.1.0 beta from
https://github.com/joakim-noah/android/releases and also the NDK 
from google.

By using this command, you will have a shell containing all you 
need to compile
the source files:
docker run --rm -it -v c:/D/projects:/projects 
andre2007/ldc-android sh

This command will also mount C:\D\projects from your host OS to 
the container path /projects. On linux / mac you will have to 
adapt the mount  source path.

You need the Google Android SDK on your host system installed to 
build the APK and test the application.

More information on building the demo applications you can find 
here:
https://wiki.dlang.org/Build_LDC_for_Android

A Wiki update will follow with detailed information.

Kind regards
André
Jan 15 2017
next sibling parent Dsby <dushibaiyu yahoo.com> writes:
On Sunday, 15 January 2017 at 17:40:01 UTC, Andre Pany wrote:
 Hi,

 on Dockerhub I published a repository which makes it really 
 easy to develop Android
 applications using LDC and Joakims work. The repository 
 contains Android 1.1.0 beta from
 https://github.com/joakim-noah/android/releases and also the 
 NDK from google.

 [...]
it is Great!
Jan 15 2017
prev sibling next sibling parent Xavier Bigand <flamaros.xavier gmail.com> writes:
Le 15/01/2017 à 18:40, Andre Pany a écrit :
 Hi,

 on Dockerhub I published a repository which makes it really easy to
 develop Android
 applications using LDC and Joakims work. The repository contains Android
 1.1.0 beta from
 https://github.com/joakim-noah/android/releases and also the NDK from
 google.

 By using this command, you will have a shell containing all you need to
 compile
 the source files:
 docker run --rm -it -v c:/D/projects:/projects andre2007/ldc-android sh

 This command will also mount C:\D\projects from your host OS to the
 container path /projects. On linux / mac you will have to adapt the
 mount  source path.

 You need the Google Android SDK on your host system installed to build
 the APK and test the application.

 More information on building the demo applications you can find here:
 https://wiki.dlang.org/Build_LDC_for_Android

 A Wiki update will follow with detailed information.

 Kind regards
 André
It's really nice to see the Android support progress like that. I hope to see the integration of this with dub, to be able to use Visual to target Android with ldc. Thank you.
Jan 16 2017
prev sibling next sibling parent Andre Pany <andre s-e-a-p.de> writes:
On Sunday, 15 January 2017 at 17:40:01 UTC, Andre Pany wrote:
 Hi,

 on Dockerhub I published a repository which makes it really 
 easy to develop Android
 applications using LDC and Joakims work. The repository 
 contains Android 1.1.0 beta from
 https://github.com/joakim-noah/android/releases and also the 
 NDK from google.

 By using this command, you will have a shell containing all you 
 need to compile
 the source files:
 docker run --rm -it -v c:/D/projects:/projects 
 andre2007/ldc-android sh

 This command will also mount C:\D\projects from your host OS to 
 the container path /projects. On linux / mac you will have to 
 adapt the mount  source path.

 You need the Google Android SDK on your host system installed 
 to build the APK and test the application.

 More information on building the demo applications you can find 
 here:
 https://wiki.dlang.org/Build_LDC_for_Android

 A Wiki update will follow with detailed information.

 Kind regards
 André
Hi, I added a WIKI page with all information you need to create your first Android application using LDC in a Docker container. Although the page describes the process on a windows system, it also work on Linux and Mac just by adapting the directory paths. https://wiki.dlang.org/Build_Android_Apps_using_LDC_in_a_Container Kind regards André
Jan 19 2017
prev sibling parent reply "Nick Sabalausky (Abscissa)" <SeeWebsiteToContactMe semitwist.com> writes:
On 01/15/2017 12:40 PM, Andre Pany wrote:
 Hi,

 on Dockerhub I published a repository which makes it really easy to
 develop Android
 applications using LDC and Joakims work. The repository contains Android
 1.1.0 beta from
 https://github.com/joakim-noah/android/releases and also the NDK from
 google.
I haven't actually had a chance to try either this or Joakims's stuff by itself, although I am interested. Can you describe how this repo simplifies things? Also, using this stuff, is there a way for the D application to call into Android's API?
Feb 19 2017
next sibling parent Rory McGuire via Digitalmars-d-announce writes:
On Mon, Feb 20, 2017 at 1:16 AM, Nick Sabalausky (Abscissa) via
Digitalmars-d-announce <digitalmars-d-announce puremagic.com> wrote:
 I haven't actually had a chance to try either this or Joakims's stuff by
 itself, although I am interested. Can you describe how this repo simplifies
 things?
Using the docker image just makes it so that you don't have to do the builds yourself. The docker image works on multiple OS. I've built Joakim's stuff myself and used the docker image and the docker image saves time if you're just wanting to take a quick look.
 Also, using this stuff, is there a way for the D application to call into
 Android's API?
Regarding Android's API there is the NDK. NDK exposes a cut down version of the Linux/posix APIs and JNI for interfacing with the VM, the app still runs in its own sandbox and you can call Java code or have Java call your code. DlangUI has some android code. Check out native-activity [0] for accessing the screen and sensors natively (it seems to be the most popular native example. [0]: https://github.com/googlesamples/android-ndk/tree/master/native-activity
Feb 20 2017
prev sibling parent Andre Pany <andre s-e-a-p.de> writes:
On Sunday, 19 February 2017 at 23:16:20 UTC, Nick Sabalausky 
(Abscissa) wrote:
 On 01/15/2017 12:40 PM, Andre Pany wrote:
 Hi,

 on Dockerhub I published a repository which makes it really 
 easy to
 develop Android
 applications using LDC and Joakims work. The repository 
 contains Android
 1.1.0 beta from
 https://github.com/joakim-noah/android/releases and also the 
 NDK from
 google.
I haven't actually had a chance to try either this or Joakims's stuff by itself, although I am interested. Can you describe how this repo simplifies things? Also, using this stuff, is there a way for the D application to call into Android's API?
I created a docker repo which contains Joakims's work (LDC+modifications). You do not have to install LDC or Android NDK on your host system. It is a fail safe, operation system independent solution. You only have docker installed on your host system (windows/linux/mac) and enter the command from my first post. This will open a shell which is like a virtual system. LDC and Android NDK is available in this shell, ready to run. Kind regards André
Feb 20 2017