comp.lang.ada
 help / color / mirror / Atom feed
From: Anatoly Chernyshev <achernyshev@gmail.com>
Subject: Re: Ada 'hello world' for Android; success!
Date: Sun, 30 Oct 2011 00:20:41 -0700 (PDT)
Date: 2011-10-30T00:20:41-07:00	[thread overview]
Message-ID: <cca9f3b3-f0fa-46ef-9901-550f52f1497f@t38g2000prg.googlegroups.com> (raw)
In-Reply-To: 9R3rq.3052$pt2.2275@newsfe18.iad

Thanks Brad for such detailed answer. I rooted my phone first thing I
got it from the store. Now it will be good to try some Ada programs on
it.

On Oct 30, 7:51 am, Brad Moore <brad.mo...@shaw.ca> wrote:
> On 29/10/2011 3:59 PM, Anatoly Chernyshev wrote:
>
> > I see. So, it's all about making a nice GUI for "Hello world"? Then
> > I'm relieved, as I commonly don't do the interface.
> > For that simple example below, should I just compile it for jvm, and
> > then it can be run on Android?
>
> Yes, Stephen Leake's example shows how to integrate a GUI into an app
> written in Ada on Android. The GUI libraries are written in Java, so Ada
> has to interface with Java to use those.
>
> To build the native Ada console executable however, the jvm isn't
> in the picture at all, as I understand it.
>
> I found the following post helpful in getting Ada code to compile on
> Android.
>
> http://www.rhinocerus.net/forum/lang-ada/684457-gnatdroid-ada-cross-c...
>
> Basically, what I did was create a virtual machine that runs FreeBSD,
> on my desktop,
> Next I followed the instructions in the above post to install the
> compiler into the virtual machine.
>
> Then I used the gnatmake executable (arm-android-eabi-gnatmake) on the
> virtual machine to cross-compile my source code for Android.
>
> This built the executable, which I then transferred to my smartphone's
> sdcard. (I used AndFTP to do the transfer, though in theory one should
> also be able to use one of the ssh apps (eg SSHDroid) to transfer from
> the virtual machine to the android. I didn't have any luck getting
> SSHDroid to work, but AndFTP did work fine.
>
> Since you can't execute files from the sdcard, I had to root the phone,
> so that I could then copy the executable to /data/data.
>
> To root my phone, I followed the procedure for SuperOneClick, which
> you can find with google.
>
> One rooted, I installed an app called "Terminal Emulator" on my Android,
> which allowed me to enter commands in a linux like environment. I also
> installed BusyBox to give me linux commands I am familiar with.
>
> Within the terminal emulator, I issued
>
>     su
>     mv /sdcard/executable_name /data/data
>     cd /data/data
>     chmod 755 ./executable_name
>
>     then ./executable_name  to run the Ada executable natively.
>
> Brad Moore
>
>
>
> > On Oct 30, 12:47 am, Brad Moore<brad.mo...@shaw.ca>  wrote:
> >> On 29/10/2011 8:46 AM, Anatoly Chernyshev wrote:
>
> >>> Well, I have HTC too, and might be willing to do some programming on
> >>> it (to have some use of GPS data for instance). But your example above
> >>> just scares me away.
> >>> And I'm happy to have no employer to force me digging into this. I
> >>> will not approach any Android programming in Ada until it gets back to
> >>> the simplicity of e.g.
>
> >> Note if you just interested in writing "Hello World" to a console for
> >> Android, you can still use the traditional Hello world program for Ada.
>
> >> namely;
>
> >> with Text_IO; use Text_IO;
> >> procedure Hello is
> >> begin
> >>       Put_Line("Hello, world!");
> >> end Hello;
>
> >> You may have to root your phone to get this to execute, but it will run
> >> and produce the desired output in a terminal console. It wont show up
> >> as an app however.
>
> >> Brad Moore
>
>




  reply	other threads:[~2011-10-30  7:20 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27  1:18 Ada 'hello world' for Android; success! Stephen Leake
2011-10-27  7:12 ` Alex R.  Mosteo
2011-10-28 12:51   ` Stephen Leake
2011-10-27 10:50 ` Jeffrey Creem
2011-10-28 13:01   ` Stephen Leake
2011-10-27 10:58 ` Brian Drummond
2011-10-28  1:37 ` Shark8
2011-10-28 12:22 ` Anatoly Chernyshev
2011-10-29 13:37   ` Stephen Leake
2011-10-29 14:46     ` Anatoly Chernyshev
2011-10-29 20:47       ` Brad Moore
2011-10-29 21:59         ` Anatoly Chernyshev
2011-10-30  3:51           ` Brad Moore
2011-10-30  7:20             ` Anatoly Chernyshev [this message]
2011-10-30 10:56       ` Stephen Leake
2011-10-30 17:32         ` Brad Moore
2011-10-29 15:32     ` Georg Bauhaus
2011-10-29 16:09       ` Simon Wright
2011-10-29 17:32         ` tmoran
2011-10-30 11:38           ` Stephen Leake
2011-10-29 20:51         ` Brad Moore
2011-10-30 11:32       ` Stephen Leake
2011-10-31 22:34         ` Randy Brukardt
2011-11-01  8:41           ` Stephen Leake
2011-11-01  9:30         ` Georg Bauhaus
2011-11-02 15:55           ` Stephen Leake
2011-11-02 17:37             ` Robert A Duff
2011-11-08  3:56               ` Randy Brukardt
2011-11-03  0:37             ` Georg Bauhaus
2011-11-03 11:36               ` Stephen Leake
2011-11-03 15:24                 ` Robert A Duff
2011-11-03 18:43                   ` Pascal Obry
2011-11-03 22:14                 ` Georg Bauhaus
2011-11-04  8:48                   ` Dmitry A. Kazakov
2011-11-04 12:18                   ` Stephen Leake
2011-11-04 15:03                     ` Georg Bauhaus
2011-11-05 16:56                       ` Stephen Leake
2011-11-01  9:52         ` Dmitry A. Kazakov
2011-11-02 15:59           ` Stephen Leake
2011-11-02 16:27             ` Dmitry A. Kazakov
2011-11-02 17:38               ` Simon Wright
2011-11-10 17:25 ` Stephen Leake
2011-11-27 15:18 ` mockturtle
2011-11-28 22:35   ` Ada 'hello world' for Android; success! (but music player failure) Stephen Leake
2011-11-29 11:23     ` Georg Bauhaus
2011-11-30  3:33       ` Stephen Leake
2011-11-30 18:57         ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox