0

I need these libraries in my android project. How can I use them?
I get import com.sun.*, java.awt.* cannot be resolved in android project

import com.sun.pdfview.PDFFile;
import com.sun.pdfview.PDFPage;

import java.awt.Graphics;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.Transparency;
import java.io.*;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import javax.swing.*;
import javax.imageio.*;
import java.awt.image.*;
Tuna
  • 2,937
  • 4
  • 37
  • 61
Ehsan
  • 517
  • 1
  • 7
  • 32
  • A simple search found [this](http://stackoverflow.com/questions/6344654/how-to-add-java-awt-image-package-in-android). – ChiefTwoPencils Sep 14 '13 at 18:00
  • I dont understand the answer? how to use these libraries in my android project?? – Ehsan Sep 14 '13 at 18:43
  • The long and skinny of it is you're not going to be able to use them (awt). The alternative is using Androids own [graphics package](http://developer.android.com/reference/android/graphics/package-summary.html). – ChiefTwoPencils Sep 14 '13 at 18:54
  • and what about com.sun.pdfview.PDFFile;? what is the alternative one? – Ehsan Sep 14 '13 at 19:23

1 Answers1

1

The classes in sun.* are not meant to be imported. They are for internal use of the JVM only.

Use UnsupportedOperationException instead of NotImplementedException.

Welcome to StackOverFlow, please next time search your problem before asking the question.

got the answer from here, simple search did it all.

Community
  • 1
  • 1
Ahmed Ekri
  • 4,601
  • 3
  • 23
  • 42