[Android-development] Management of JAVA Files Among Qt-Versions and Across Kits

Eskil Abrahamsen Blomfeldt eskil.abrahamsen-blomfeldt at digia.com
Fri Sep 27 11:27:31 CEST 2013


On 09/27/2013 11:07 AM, Robert Iakobashvili wrote:
> Gentlemen,
>
> What was done:
> 1. Opened a Qt Android Project by using Qt-5.1.0
> 2. Later it was added Qt-5.1.1 kit
>
> Now, working with 5.1.1 or a later git-taken version.
> QtActivity.java and QtApplication.java remained as
> in the initially opened 5.1.0
>
> Thus, it was getting fixes done in C++ but not in JAVA.
>
> To renew the java file, the directory "android" was deleted
> and on a new build it was renewed with the new versions
> of  QtActivity.java and QtApplication.java
>
> Am I missing something?
>
> What's the best practices for advancing versions?
>
> If some project is working with let's say two different kits
> related to two different versions how could it be managed better?

This problem has been fixed with the introduction of the androiddeployqt 
tool in Qt 5.2. The Java files will no longer be added as part of your 
project, but just copied into a kit-specific build directory upon need.

>
> Yet another question is about patching of QtActivity.java
> (I understand that this is better not to do but in some
> cases that could not be avoided).
> If people on the list think that some hooks
> could be placed to the certain points
> like onCreate, onResume, etc.
> so that potential customization could be better structured
> and not done as a patching?

You can make your own Activity class which overrides the functions you 
want and which extends QtActivity. The goal should be not to patch 
QtActivity, I think.

To make this more convenient, there may be a need to add more virtual 
methods (hooks as you say) where it makes sense, so that you can easily 
adapt the behavior to what you want. I'd be interested in hearing what 
virtual methods you are interested in seeing :)

-- Eskil




More information about the Android-development mailing list