From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4cb1f8d1c17d39a8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.0.170 with SMTP id 10mr5971934pbf.2.1319972291924; Sun, 30 Oct 2011 03:58:11 -0700 (PDT) Path: p6ni33177pbn.0!nntp.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Ada 'hello world' for Android; success! References: <8239efcjuw.fsf@stephe-leake.org> <98ca5430-aa52-4e39-b789-70d0dd6adb46@d33g2000prb.googlegroups.com> <824nyrq5p6.fsf@stephe-leake.org> <5e4cbab8-b375-4995-bf1a-e264b307a279@d37g2000prg.googlegroups.com> Date: Sun, 30 Oct 2011 06:56:52 -0400 Message-ID: <82r51uoih7.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt) Cancel-Lock: sha1:/vehpIlYr9OZtG6iDPBmwKEFTf4= MIME-Version: 1.0 X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 635834ead2d6ce26b0fa601644 Xref: news1.google.com comp.lang.ada:18761 Content-Type: text/plain; charset=us-ascii Date: 2011-10-30T06:56:52-04:00 List-Id: Anatoly Chernyshev 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