I am working in an Android project recently. Our project uses a computer vision library called boofcv:
http://boofcv.org/index.php?title=Main_Page
After importing the library source code into our project, I found that Android Studio cannot revolve symbols from sun.awt.image.* and java.awt.color.ColorSpace.
package boofcv.core.image;
import boofcv.struct.image.*;
import sun.awt.image.ByteInterleavedRaster;
import sun.awt.image.IntegerInterleavedRaster;
import sun.awt.image.ShortInterleavedRaster;
import javax.swing.*;
import java.awt.*;
import java.awt.color.ColorSpace;
import java.awt.image.*;
import java.lang.reflect.Array;
/**
* Functions for converting to and from {@link BufferedImage}.
*
* @author Peter Abeles
*/
public class ConvertBufferedImage {
......
But then I wrote a very simple test program and found that my jdk did contain those classes. my program:
import sun.awt.image.ByteInterleavedRaster;
import sun.awt.image.IntegerInterleavedRaster;
import sun.awt.image.ShortInterleavedRaster;
import javax.swing.*;
import java.awt.*;
import java.awt.color.ColorSpace;
import java.awt.image.*;
class test{
public static void main(String[] args) {
ByteInterleavedRaster b;
IntegerInterleavedRaster i;
ShortInterleavedRaster s;
ColorSpace c;
System.out.println("testing");
}
}
Did I miss some configuration or it is just the issue of Android Studio?
Any help is greatly appreciated.
Don't use the visualization package for anything on Android. It's based off on swing which isn't supported on Android. Use the android package in integration. It has similar functions for visualizing data.
https://github.com/lessthanoptimal/BoofAndroidDemo
that might be useful for you.