[Lazarus] Hints for Android

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Fri Apr 12 10:46:50 CEST 2013


On Fri, Apr 12, 2013 at 10:18 AM, Sven Barth
<pascaldragon at googlemail.com> wrote:
> Every form should have it's own Activity and
> the global state should be mapped through an extension of the
> android.app.Application class.

Do you have any link to the docs that say that every window should
have a new Activity? Window does not descend from Activity. It does
not look correct to me... but I will study the issue.

For dialogs at least I am 100% sure they don't use one Activity per
dialog. Nothing in the docs here about this:
http://developer.android.com/reference/android/app/AlertDialog.Builder.html

Also: if I don't do it like that what's the difference for my user? I
haven't see one so far.

Also, I know applications with millions of downloads in the store
which don't use one Activity per window and never saw a problem with
it. We use one activity for the main application and another for the
crash logger, but not one per form AFAIK, thought I am not 100%
knowledged in the source code.

Anyway, even if I went to change this (which so far I am not convinced
of), it is hardly a "rewrite". Something like 0,1% of the code would
need to be changed.

> Also you didn't seem to notice that the only
> fixed exports that are really necessary are JNI_onload and JNI_onunload. The
> other ones can be inserted using JNI which you already provide a possiblity
> for but you've added the comment "apparently not needed" there and didn't
> complete that. Of course, if you manually export all functions you don't
> need that, but if you use this dynamic JNI approach you reduce the amount of
> functions that the user needs to export to just two basic functions.

Ok, now this is something interrested that I just learned! I had no
idea about this. This is trivial to change, the only work will be
testing in all the devices if it still works afterwards. I tested the
current implementation in dozens of devices.

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list