comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Ada 'hello world' for Android; success!
Date: Sun, 30 Oct 2011 06:56:52 -0400
Date: 2011-10-30T06:56:52-04:00	[thread overview]
Message-ID: <82r51uoih7.fsf@stephe-leake.org> (raw)
In-Reply-To: 5e4cbab8-b375-4995-bf1a-e264b307a279@d37g2000prg.googlegroups.com

Anatoly Chernyshev <achernyshev@gmail.com> writes:

> 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.
>
> with Android.total.coverage, text_io;
> use Android.total.coverage, text_io;
> procedure Hello is
> begin
>   Put_Line("Hello, world!");
> end Hello;

You can do that now (with an ARM native cross compiler), and if you are
happy with command-line programs, that's fine.

But the point of my effort is to make GUI Android applications, in
particular a music player that is easy to operate while in a car and at
home. A command line application will _not_ meet my needs; I need to
take full advantage of the Android GUI application framework.

> At the moment, I would opt for Python. Here is its version of "Hello,
> world":
>
> import android
> droid = android.Android()
> droid.makeToast('Hello, World!')

Hmm. By definition, the 'main program' of an Android GUI app must be an
overriding of Android.App.Activity.onCreate. So I'm guessing that the
'android' Python package (is that the right term?) declares an onCreate
that does nothing.

How and when does the 'makeToast' statement get called? What shows on
the screen when this app is invoked?

The biggest problem I have with the current Android documentation is
that it does not document threading behavior, even though it has
multiple threads, and "callbacks" that must operate across threads.
Which means it is impossible to avoid deadlocks and race conditions. As
part of my Ada on Android development work, I'll be attempting to
reverse engineer and document the threading behavior of the various
features I use.
 
Ada could provide similar functionality to Python; provide a package
that is "simpler" than Android.App.Activity.

I don't see the point; doing useful stuff with a solid multi-tasking GUI
is not trivial, so you need complex structures to make it work. From
what I have seen so far, the Android GUI framework is easier to use, yet
just as powerful, as GtkAda.

It will be interesting to see if Ada tasks are useful with Android.

-- 
-- Stephe



  parent reply	other threads:[~2011-10-30 10:58 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
2011-10-30 10:56       ` Stephen Leake [this message]
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