![]() |
SWT on N900/Fremantle works
Hi,
as Java "kind of" works (http://talk.maemo.org/showthread.php?t=37405) it would be great to have also SWT running. One option would be to build SWT in Scratchbox on the ARMEL target. Though afaik building SWT requires Java and here unfortunately both JDK's fail to run under Scartchbox with similar errors: Quote:
Is it feasible to get the required files from debian packages or is the whole task a bigger endeavor? At least the guys from Jalimo also got SWT packaged for their Java port. ;) Any comments are highly appreciated. Best regards Wonko |
SWT on N900/Fremantle works
Allright it works! :D
Just managed to build SWT and run the first example application on my N900. The short story: As Java does not run under Scratchbox i built SWT in two steps. The first was to build the native libraries in Scratchbox and the second to build the Java part on the N900 itself. You can find the patches etc. at the project garage site: https://garage.maemo.org/projects/swt-hildon/ I'll also add another post where i'll explain the details of building SWT later on. In order to test the whole stuff i used the "SimpleSwtSample" example from http://wiki.evolvis.org/jalimo/index.php/Maemo. Compile the example as follows (note: i am using the openjdk downloaded from http://www.camswl.com/openjdk): Code:
CLASSPATH="path_to_swt/swt.jar" /home/user/java/openjdk/camswl/j2sdk-image/bin/javac SimpleSwtSample.java Code:
CLASSPATH=.:path_to_swt/swt.jar /home/user/java/openjdk/camswl/j2sdk-image/bin/java -Djava.library.path=path_to_swt/ SimpleSwtSample Best regards Wonko |
Building SWT
Here are the detailed steps used for building SWT.
The following is executed in Scratchbox (in the armel target of course): Code:
#!/bin/sh Code:
mkdir swt |
Re: SWT on N900/Fremantle?
:( java.lang.UnsatisfiedLinkError : no swt-gtk-3555 or swt-gtk in swt.library.path? or jar file etc.
Please help. JRE 1.6.0.10 |
Re: SWT on N900/Fremantle?
Quote:
You do this by setting the "-Djava.library.path" "option" as follows: Code:
CLASSPATH=./swt.jar java -Djava.library.path=path_to_swt/ SimpleSwtSample Another option would be to copy the native libs to /usr/lib or (better, if you want this solution) copy the libs to /opt/maemo/usr/lib and then place symlinks to /usr/lib. If you are just playing around i think the first option (setting "-Djava.library.path") is best. |
Re: SWT on N900/Fremantle?
Alright,
i adapted the patch from http://wiki.evolvis.org/jalimo/index.php/Maemo (namely: http://evolvis.org/plugins/scmsvn/vi...20&root=jalimo) to work with the current SWT version and Fremantle. The patch can be downloaded from: http://user.fh-frankfurt.de/~rc9000/...t-hildon.patch Also the build instructions above have been updated to make use of the patch. Edit: And of course the downloads at http://user.fh-frankfurt.de/~rc9000/maemo_swt have also been updated ;) |
Re: SWT on N900/Fremantle?
I added a patch which enables scrolling via the touch UI for org.eclipse.swt.widgets.Tree and Table instead of using scrollbars.
The patch can be found at: http://user.fh-frankfurt.de/~rc9000/...ee-table.patch A compiled version of SWT with this patch applied can be downloaded from http://user.fh-frankfurt.de/~rc9000/...t/experimental So far everything worked nicely here. Please let me know if this works also well for you. |
Re: SWT on N900/Fremantle?
I added two more patches.
The first simply adds native methods for using hildon buttons and file dialog chooser and (most important) cleans a little bit up the code. I.e. the methods flagged with "no_gen" have been moved into os_custom.c. This should improve the maintainability. The second patch changes org.eclipse.swt.widgets.FileDialog to make use of HildonFileChooserDialog. Again the patches are in the usual place and a compiled version has been uploaded to experimental. |
Re: SWT on N900/Fremantle?
Added another patch which enables pop-up menus.
Note: This is only provided for compatibility reasons as, according to the documentation (http://wiki.maemo.org/Documentation/...s#Context_menu) pop-up or context menus should not be used. Patch and compiled binaries are at the usual locations. |
Re: SWT on N900/Fremantle?
Alright, had some time to update the patches etc. to SWT-3.5.2.
As usual patches and compiled versions can be found at http://user.fh-frankfurt.de/~rc9000/maemo_swt/ The swt.jar now also includes the *.so libraries. An additional jar is available without the *.so files. Best regards Wonko |
Re: SWT on N900/Fremantle?
Great work, thanks a lot! It works like a charm.
Jan |
Re: SWT on N900/Fremantle?
I think I'm going to enjoy writing, compiling *and* running SWT applications onboard. This is really great news for java developers and N900 owners. Thank you for your contributions, Wonko.
BTW, one of my SWT app uses the browser widget. The error I get is: Code:
java.lang.UnsatisfiedLinkError: no swt-mozilla-gtk-3555 or swt-mozilla-gtk in swt.library.path, java.library.path or the jar file Code:
MOZILLA_FIVE_HOME=/opt/mozilla |
Re: SWT on N900/Fremantle?
Its nice to see this is useful :)
Quote:
As it turns out building this part of SWT is more complicated. I started to fiddle about this component the weekend. So far i got it build and was able to run a very simple test application. Though the functionality is far from being usable. E.g. scrolling does not work and links do not work either. Just the first web page opened is displayed. If you still want to have a look at the result you can get it at http://user.fh-frankfurt.de/~rc9000/...mental/swt.jar I tested the whole thing using fennec 1.0.0 from the Mozilla web site. The whole thing is run as follows: Code:
MOZILLA_FIVE_HOME=/opt/mozilla/xulrunner-1.9.2.1 java -cp .:swt.jar test.BrowserTest |
Re: SWT on N900/Fremantle?
Alright, the browser works! :)
I uploaded compiled versions to http://user.fh-frankfurt.de/~rc9000/.../experimental/ The patch can be found at http://user.fh-frankfurt.de/~rc9000/...-mozilla.patch I'll update the build instructions accordingly on the first page. |
Re: SWT on N900/Fremantle?
Are you using that Cambrige version of OpenJDK or did you manage to compile OpenJDK from Debian?
|
Re: SWT on N900/Fremantle?
Congratulations, Wonko, thanks for the good work!
Soeiro, I'm using the Cambridge OpenJDK. |
Re: SWT on N900/Fremantle?
Quote:
|
Re: SWT on N900/Fremantle?
I added two more patches and uploaded the results to the experimental directory.
Scrollable Composites now make use of the touch UI for scrolling and Tree and Table are scrollable in all directions. The patches are found at the usual location. |
Re: SWT on N900/Fremantle?
Ok,
you can now also grab SWT from the repository. Currently its only in devel but I think I'll promote it soon. SWT will be installed in /opt/maemo/usr/share/swt and a symlink will be placed to /usr/share/swt. Because SWT is a library you have to install it via "apt-get install swt-hildon". |
Re: SWT on N900/Fremantle?
Quote:
Excuse the inconvenience. |
Re: SWT on N900/Fremantle?
I uploaded a new version.
This version enables visible "expanders" in trees. I.e., an expander icon is shown at the left for items that can be expanded because of child items. As usual, let me know how this works for you. ;) |
Re: SWT on N900/Fremantle?
Thanks!
Wonko, are you writing java code on the n900 itself? If so, what is your setup in terms of IDE, editors, etc... Just wondering... |
Re: SWT on N900/Fremantle?
Quote:
I am from time to time doing smaller changes etc. to some existing Java projects on the N900 while I am on the go. For this I use Vim, Ant, and Subversion. It's not really Java but at least related, so: Sometimes I play around with Clojure as well. For this I also use Vim plus the clojure-color-repl which, in my opinion, produces neat output. SWT also works with Clojure, by the way. ;) |
Re: SWT on N900/Fremantle?
Cool.
Me, I am currently looking for a decent solution. I have tried the following on the debian chroot: Netbeans, Jedit and emacs with JDEE. The first two are too slow, but that's hardly a surprise. Unfortunately, emacs with JDEE is not working out of the box (JDEE menu doesn't expand when .java file is loaded), and I haven't had the time to look into it. vi is cool,l but I would love to have some project management features and basic code generation / templates. |
Re: SWT on N900/Fremantle?
Alright,
I update the package to the current SWT version 3.6. As usual you can find the patches etc. at the garage site. I also uploaded the new version to extras-devel. Ah well, scratch my notes from yesterday. The real issue is that SWT extracts the native libraries from the jar to /tmp/swtlib-32 by default, while /tmp is only 1MB in size, resulting in an error due to no space left on device. I'll upload a newer version which shall fix this problem asap. |
Re: SWT on N900/Fremantle?
I uploaded a new version again.
This one does not use /tmp anymore to extract the native libraries to but instead extracts these to /var/tmp/swtlib-32. Please delete /tmp/swtlib-32 to avoid strange errors and excuse the inconvenience. Edit: Sorry, was quite in a hurry. Of course using $HOME for temporary files is a silly idea. Instead I use /var/tmp for now. Another new version is on the way. |
Re: SWT on N900/Fremantle?
Alright, I updated the patches to the current version 3.6.1 of SWT.
The new version is also already in extras-devel. |
Re: SWT on N900/Fremantle?
Updated patch to 3.6.2 and uploaded new version.
|
Re: SWT on N900/Fremantle?
SWT link is dead for the last few days.
http://user.fh-frankfurt.de/~rc9000/.../experimental/ |
Re: SWT on N900/Fremantle?
Quote:
Well this web site was hosted on my student account at the university. As I am no longer a student it was about time for it to go down. :) It contained only old stuff anyway. ;) You can get the code, patches etc at the garage page: https://garage.maemo.org/projects/swt-hildon/ I'll update the initial post as well. |
All times are GMT. The time now is 00:47. |
vBulletin® Version 3.8.8