comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Ada on Android?
Date: Sat, 10 Sep 2011 13:38:10 -0400
Date: 2011-09-10T13:38:10-04:00	[thread overview]
Message-ID: <82wrdgguwt.fsf@stephe-leake.org> (raw)
In-Reply-To: j4d3ih$pgr$1@dont-email.me

Brian Drummond <brian@shapes.demon.co.uk> writes:

> On Wed, 07 Sep 2011 20:15:12 -0400, Stephen Leake wrote:
>
>> Ada is supposed to be able to target the JVM; also being able to target
>> ARM is an orthogonal issue. Targeting the ARM would be useful for
>> compiling a new cryptographic library, for example. Totally unnecessary
>> for building a music player.
>
> Not necessary. Perhaps sufficient if you can bind to the API from native 
> code and write native code callbacks (you can from C/C++ in Android 2.3, 
> so presumably also Ada).
>
> I am not suggestion there is anything wrong in targetting the JVM in Ada!
> However, if that turns out to be problematic, native code could offer an 
> alternative approach. Ideally, both will work.

Ah. I guess JNI is more complicated/complete than I had thought.
I'll have to read more about it. For example, there is now a
NativeActivity that allows writing a complete Activity in native code.

>> It is possible to do without the GUI builder by writing either Java or
>> Ada code that constructs the GUI; we have the same choice in GtkAda. I'm
>> going with the recommended approach to make sure I know what its
>> advantages are before I give up on it.
>
> Interesting. As far as I could see, we have to use XML (or the builder) 
> to control layout. If you can do that in [Java/Ada] instead, that's very 
> good news! I missed that. Any references to it, or sample projects?

I haven't tried it yet, but see
http://developer.android.com/reference/android/widget/LinearLayout.html
; you can specify a LinearLayout in code, and add things to it. 

There are reasons to use the XML; it keeps layout separate from the
rest of the code, so specifying portrait vs landscape vs widget is
cleaner. But similar separation could be achieved with appropriate
subprograms (or should I say "methods"? sigh).

Allowing users to specify layout at runtime might be a big advantage.

>>> A GTKAda binding to that mess would be nice ... (though probably
>>> difficult to impossible)
>> 
>> Why would that be nice?
>
> Just commonality with other platforms. I hear you about the mess in GTK 
> underneath! 
>
> If we can develop for Android and use the same product on other platforms 
> (not just Windows), that would also be nice. Nicer, if the underlying 
> windowing stuff is cleaner.

Yes, cross platform is a nice dream. I had high hopes for GtkAda for
that. At the moment, I think QtAda is better, but not by much.

I would like to port my Android music App to windows.

It may be that the Android windowing classes are built on top of Gtk,
in which case it _might_ be possible to port them to Windows. That would
be neat.

>>> I'll report if/when I have a HelloWorld running.
>> 
>> I'm talking about the full Android windowing Hello World at
>> http://developer.android.com/resources/tutorials/hello-world.html.
>> _not_ just Ada.Text_IO.Put_line.
>
> So am I; or rather, the exact equivalent "hello-jni" example from
> http://developer.android.com/sdk/ndk/overview.html#samples

Ok. I guess I should install the NDK and look at that.

-- 
-- Stephe



  reply	other threads:[~2011-09-10 17:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-05 17:22 Ada on Android? Stephen Leake
2011-09-05 20:15 ` onox
2011-09-06  1:16   ` Stephen Leake
2011-09-06 10:33     ` Brian Drummond
2011-09-06 12:08       ` jrmarino
2011-09-07 23:09         ` Brian Drummond
2011-09-08  0:15       ` Stephen Leake
2011-09-09 13:16         ` Brian Drummond
2011-09-10 17:38           ` Stephen Leake [this message]
2011-09-06 16:54   ` Pascal Obry
2011-09-06 18:11     ` jrmarino
2011-09-08  0:18       ` Stephen Leake
2011-09-08  5:51         ` jrmarino
replies disabled

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