Opened 11 years ago
Closed 10 years ago
#5107 closed defect (fixed)
Android Swig for Java fix
Reported by: | jaakl | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | svn-trunk |
Severity: | normal | Keywords: | android |
Cc: |
Description
Swig .i file for GDAL refers to awt Color object which is not available for Android. I replaced it with int which is used in Android for color (ARGB), and then it is usable for Android. The result file is attached as hotfix.
A smarter .i file would be beter, which makes different API for desktop Java and Android, or simply use int-based color everywhere, as you can quite simply reconvert int in desktop java.
Attachments (1)
Change History (6)
by , 11 years ago
Attachment: | typemaps_java.i added |
---|
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Yes, I had to removed this IndexColorModel method definition from gdal_java.i together with imports import java.awt.image.IndexColorModel; import java.awt.Color;
comment:3 by , 11 years ago
There seems to be no java.awt.image.IndexColorModel analog in Android, and I did not really need it (or know I needed it) to decode images, so removal made sense.
comment:4 by , 11 years ago
trunk r26068 "Java bindings: run 'make ANDROID=yes' in swig/java to generate SWIG bindings that compile for Android (java.awt.Color replaced by int, ColorTable.getIndexColorModel() removed (#5107)"
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I've tried your version, but it doesn't appear to be sufficient to make compilation work. I have compilation failures due to public IndexColorModel getIndexColorModel(int bits) defined in swig/include/java/gdal_java.i. I don't understand why it would work for you if you don't change that file too.