AWT Classes on Android

Hi all,
I am building android export functionality for my game editor however I am now in a dilemma,
I am using some of the AWT classes in the GradientFogFilter and android is not happy with me.

I was wondering if anyone here knows of an alternative way to handle these classes on android:

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.LinearGradientPaint;
import java.awt.geom.Point2D;
import java.awt.image.BufferedImage;

The only way to get out of this without major modifications will require you to write a bridging API which adds these classes, but wrap android components… or else search for someone already did this, writing cross-platform APIs is a very daunting task.

Check the android.media package, the android.opengl, and the android.graphics packages, here.

EDIT:
I don’t know if this can help you anyway (it’s so old and not maintained, but might be a good starting point):

1 Like

Thanks a million, I will have a look.

1 Like

Except “java.awt.LinearGradientPaint” the rest of them are implemented in this library:

(Note that the “java.awt.GradientPaint” class is there so you may be able to implement LinearGradientPaint yourself)

3 Likes