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.

Source: https://github.com/nutiteq/gdal/wiki/AndroidHowto

Attachments (1)

typemaps_java.i (52.3 KB ) - added by jaakl 11 years ago.

Download all attachments as: .zip

Change History (6)

by jaakl, 11 years ago

Attachment: typemaps_java.i added

comment:1 by Even Rouault, 11 years ago

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.

comment:2 by jaakl, 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 jaakl, 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 Even Rouault, 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 Even Rouault, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.