<p>Interested but far from what I know about, so I will read your pists but I dont know enough to not just add noise to the discussion.</p>
<p>I&#39;m thinking the same about my post last night too... No one got any ideas for mingw sh.exe being added to the path just because it finds mingws gcc.exe?</p>
<div class="gmail_quote">On Jul 12, 2011 11:03 AM, &quot;Robert Schuster&quot; &lt;<a href="mailto:r.schuster@tarent.de">r.schuster@tarent.de</a>&gt; wrote:<br type="attribution">&gt; Hi everyone,<br>&gt; is actually anyone interested in all these explanations? ;)<br>
&gt; <br>&gt; Anyway I finished the Proof-Of-Concept implementation and also its<br>&gt; description. If anyone has a question about the Java part rework it is<br>&gt; all on:<br>&gt; <br>&gt; <a href="http://community.kde.org/Necessitas/Java/Redesign">http://community.kde.org/Necessitas/Java/Redesign</a><br>
&gt; <br>&gt; I&#39;d suggest those who are concerned to actually look at the PoC and the<br>&gt; comments within.<br>&gt; <br>&gt; I&#39;m now starting with an actual Android implementation of the ideas.<br>&gt; I&#39;ll refine the information on the website as soon as I see that this is<br>
&gt; necessary.<br>&gt; <br>&gt; Happy hacking!<br>&gt; Robert<br>&gt; <br>&gt; Am 07.07.2011 12:22, schrieb Robert Schuster:<br>&gt;&gt; Hi all,<br>&gt;&gt; finally I found the time to do a write up of the concept of the Java<br>
&gt;&gt; part rework that Bogdan, Christian and I talked about at QCS in Berlin.<br>&gt;&gt; Attached is (hopefully) a drawing that shows the individual components.<br>&gt;&gt; This mail is supposed to be a complete explanation of the whole topic.<br>
&gt;&gt; For a discussion on IRC later this day it would be nice if you&#39;ve read<br>&gt;&gt; it. :)<br>&gt;&gt; <br>&gt;&gt; Base technique: At QCS we found out that it is very impractical to have<br>&gt;&gt; that many Java classes in sourcecode form in each application. Simply<br>
&gt;&gt; because every class becomes part of the public interface. This will<br>&gt;&gt; cause a huge maintenance burden. I&#39;d simply say it would not work. We<br>&gt;&gt; need to move large parts of the code into places that are independent<br>
&gt;&gt; from the application. This however strongly required the need to add<br>&gt;&gt; classes from a foreign APK or DEX file to the application&#39;s classpath.<br>&gt;&gt; We were not sure whether Android would allow this but it indeed does. As<br>
&gt;&gt; a proof of concept we wrote a demo[0] application which can load any (!)<br>&gt;&gt; APK or DEX file and create an instance of any class and call its<br>&gt;&gt; toString() method. The POC worked in the way we wanted on a rooted but<br>
&gt;&gt; also on a normal locked device.<br>&gt;&gt; <br>&gt;&gt; With this technique at hand we can do the following:<br>&gt;&gt; * Move all code that is not really necessary for app startup into<br>&gt;&gt; separate APK files<br>
&gt;&gt; * Define an interface between App and Loader which can handle updates<br>&gt;&gt; (that allows for incompatible changes in the App code over time)<br>&gt;&gt; * Profit! Err, yeah ... ;)<br>&gt;&gt; <br>&gt;&gt; Let&#39;s explain all the little boxes from the drawing:<br>
&gt;&gt; <br>&gt;&gt; App:<br>&gt;&gt; ----<br>&gt;&gt; This is the source code that is part of each Android-Qt application. The<br>&gt;&gt; user *may* change little pieces of the code as long as it does not<br>&gt;&gt; violate the interface to the Loader or Ministro. What the user can do is<br>
&gt;&gt; calling any methods of the public interfaces to the loader for example.<br>&gt;&gt; We will mark the pieces of code that the user *must* not remove or<br>&gt;&gt; modify otherwise.<br>&gt;&gt; This whole thing will be as small as possible!<br>
&gt;&gt; Whenever there is the need to change the App code in an incompatible way<br>&gt;&gt; we need to introduce a new Loader interface. E.g. we will have a<br>&gt;&gt; LoaderVersion1 interface for now. When it changes the App code will ask<br>
&gt;&gt; for LoaderVersion2. The Loader&#39;s reponsibilities will be explained below.<br>&gt;&gt; <br>&gt;&gt; Loader:<br>&gt;&gt; -------<br>&gt;&gt; The Loader connects methods from the App with the Android Activity<br>
&gt;&gt; class. It will implement all available methods in order to gain maximum<br>&gt;&gt; control over the App code without letting the App decide by itself. The<br>&gt;&gt; Loader is published by us and can as such be updated over time allowing<br>
&gt;&gt; *us* to fix bugs, introduce new feature to *existing* applications<br>&gt;&gt; without changing them.<br>&gt;&gt; There might be applications with different versions of the starter code<br>&gt;&gt; in it. Each of those version requires a specific interface in the<br>
&gt;&gt; Loader. The most up to date version of the Loader will understand (=<br>&gt;&gt; implement) and offer all interfaces. That way old and new application<br>&gt;&gt; start code is always compatible with the Loader.<br>
&gt;&gt; If a Loader cannot satisfy the requested interface of an application<br>&gt;&gt; then this means that the current version of the Loader is too old and it<br>&gt;&gt; will update itself.<br>&gt;&gt; (The Loader will technically be part of Ministro, when Ministro is<br>
&gt;&gt; installed. If the user is a developer and chose &#39;use local libs&#39; then<br>&gt;&gt; the loader will also be copied to a well known directory and directly<br>&gt;&gt; included into the Apps classpath. As such at runtime of an App the<br>
&gt;&gt; Loader APK will be part of the App&#39;s process space!)<br>&gt;&gt; <br>&gt;&gt; Ministro:<br>&gt;&gt; ---------<br>&gt;&gt; Ministro does what it does right now: It downloads the libs (if<br>&gt;&gt; necessary), provides the locations of the libraries and tells the app<br>
&gt;&gt; that it can start. I&#39;m actually thinking of putting the &#39;satisfy a<br>&gt;&gt; certain Loader interface version&#39; into Ministro, too. Because that seems<br>&gt;&gt; like the best place for it).<br>&gt;&gt; Unlike now the interface between App and Ministro will become upgrade<br>
&gt;&gt; compatible. While changes will happen less frequently it is very<br>&gt;&gt; important that we allow and can deal with incompatible changes to the<br>&gt;&gt; interface between Ministro and the App.<br>&gt;&gt; <br>
&gt;&gt; Bridge:<br>&gt;&gt; -------<br>&gt;&gt; These are all the classes that interact in some way with the C++ code of<br>&gt;&gt; the Android-Qt port. Unlike now they will be a private interface.<br>&gt;&gt; Meaning that we can do *any* change we want in them. For each supported<br>
&gt;&gt; Qt version (4.9, 5.0 etc.) there will be an accompanying bridge. The<br>&gt;&gt; bridge may even consist of multiple APKs if we want to save space (e.g.<br>&gt;&gt; if QtMobility is not used, then the classes for it do not need to be<br>
&gt;&gt; available as well).<br>&gt;&gt; <br>&gt;&gt; Qt:<br>&gt;&gt; ---<br>&gt;&gt; These are the native Qt libraries. No change needed. Except that any<br>&gt;&gt; code can *assume* the existence of certain bridge classes and can<br>
&gt;&gt; resolve class names at will.<br>&gt;&gt; <br>&gt;&gt; Caveats:<br>&gt;&gt; -------<br>&gt;&gt; From a development perspective this is quite a task. The Java code<br>&gt;&gt; changes are not so difficult (for me at least) but I have no clue how we<br>
&gt;&gt; can modify the Android-Qt build to also compile Java classes, dexify and<br>&gt;&gt; make an APK out of them. Because this is what we need. When you compile<br>&gt;&gt; Qt for Android you&#39;ll need a Java compiler, the DEX tool and something<br>
&gt;&gt; that creates an APK for you. IOW this is where I need you help.<br>&gt;&gt; <br>&gt;&gt; The Ministro build also needs to be changed a bit. The Ministro APK<br>&gt;&gt; could contain the Loader classes. That would not be a problem. However<br>
&gt;&gt; somehow QtCreator needs the Loader classes too when using &#39;use local<br>&gt;&gt; libs&#39; flag. I propose that the SDK installer also downloads the Loader<br>&gt;&gt; classes (which might be the same as Ministro but as a library not an<br>
&gt;&gt; application) from a known location.<br>&gt;&gt; <br>&gt;&gt; I plan to use real Java interfaces in order to define the public<br>&gt;&gt; interface. An alternative approach would be to rely on reflection only.<br>
&gt;&gt; However that will make the interface very opaque and the code will be<br>&gt;&gt; difficult to read for anyone with only a small knowledge of Java. Having<br>&gt;&gt; interfaces however means we will need to share bits of sourcecode<br>
&gt;&gt; between the projects (namely the interface file). I&#39;m still<br>&gt;&gt; contemplating how to do this properly.<br>&gt;&gt; <br>&gt;&gt; For tonight I am mostly interested in how to solve the caveats.<br>&gt;&gt; <br>
&gt;&gt; Let me know what you think. If not we&#39;ll see each other at 7pm CET/GMT+1. :)<br>&gt;&gt; <br>&gt;&gt; Regards,<br>&gt;&gt; Robert<br>&gt;&gt; <br>&gt;&gt; [0] - <a href="http://paste.debian.net/122188/">http://paste.debian.net/122188/</a><br>
&gt;&gt; <br>&gt;&gt; <br>&gt;&gt; <br>&gt;&gt; <br>&gt;&gt; _______________________________________________<br>&gt;&gt; Necessitas-devel mailing list<br>&gt;&gt; <a href="mailto:Necessitas-devel@kde.org">Necessitas-devel@kde.org</a><br>
&gt;&gt; <a href="https://mail.kde.org/mailman/listinfo/necessitas-devel">https://mail.kde.org/mailman/listinfo/necessitas-devel</a><br>&gt; <br>&gt; <br>&gt; -- <br>&gt; tarent solutions GmbH<br>&gt; Thiemannstr. 36 a, D-12059 Berlin • <a href="http://www.tarent.de/">http://www.tarent.de/</a><br>
&gt; Tel: +49 30 5682943-30 • Fax: fax +49 228 52675-25<br>&gt; <br>&gt; Rochusstraße 2-4, D-53123 Bonn • <a href="http://www.tarent.de/">http://www.tarent.de/</a><br>&gt; Tel: +49 228 52675-0 • Fax: +49 228 52675-25<br>&gt; HRB AG Bonn 5168 • USt-ID (VAT): DE122264941<br>
&gt; Geschäftsführer: Boris Esser, Elmar Geese<br>&gt; <br>&gt; <br></div>