0

I have been working on a program in which I use codes from this API (musicg) : http://code.google.com/p/musicg/

However, I still have one part of my code which causes me trouble (GraphicRender.java). In the import part, it happens that some lines remain underlined in red, meaning some data are missing. Do you have any idea of where I can find these missing parts ?

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;

Thanks in advance for any lead you could give me, I'd really appreciate some help to make this work !

See you

Charles
  • 50,943
  • 13
  • 104
  • 142
Phalanx
  • 1,217
  • 6
  • 25
  • 36

3 Answers3

1

java.awt.* can not be resolved in android as java.awt.* contains native code. These native code needs to be supported by android separately. So far, it is not done.

However, you can use android.graphics, android's graphics library.

More information available at : http://developer.android.com/reference/android/graphics/package-summary.html

Rahul
  • 15,979
  • 4
  • 42
  • 63
0

These imports cannot be resolved on Android.

While Android has a lot of classes that the standard Java Development Kit does, it implements its own UI system. Due to this, awt is not included in Android.

However, attempts have been made at porting parts of awt to Android. I haven't tried out the project personally, so I can't say if it meets your requirements.

You could also look into JavaCV and OpenCV for image processing on Android.

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
0

For the java.awt, I found this android port - https://bitbucket.org/mkmatlock/android-pdfbox/downloads/ (look for the android-awt-*.jar and throw it into your project as a library dependency). I was looking for a pdfbox port (which uses awt internally) when I found that. I haven't tested it thoroughly but it seems to suppress my compile errors.

I'm still looking for the javax.imageio port, will update when I find one.

Karthik V
  • 51
  • 2