1

In my android project, I use a external jar which will use the class

Here is the error information:

06-13 02:45:18.586: ERROR/dalvikvm(228): Could not find class 'javax.activation.MimetypesFileTypeMap', referenced from method weibo4j.http.HttpClient.multPartURL

Who can tell me why this happened?

Andro Selva
  • 53,910
  • 52
  • 193
  • 240
cloud
  • 505
  • 1
  • 8
  • 21

2 Answers2

2

The javax.activation package is not part of the Android core (as you can see, it's not in the package index), so you will not be able to use that Jar without a recompiled javax.activation jar (if there is one at all). What does this external Jar do?

dmon
  • 30,048
  • 8
  • 87
  • 96
  • Thank you very much, i use a sdk which references that jar, but that sdk is a java-sdk. 'javax.activation.MimetypesFileTypeMap' is in the 'rt.jar' which locates at the lib of jre6, how can i recompile that jar? – cloud Jun 13 '11 at 13:39
  • [This project](http://code.google.com/p/javamail-android/) might help you out. Check out their downloads section. Note, however, that if the class is not originally included in the Android SDK it is for a good reason, and you might want to consider a more standard Android approach for whatever it is you're doing. – dmon Jun 14 '11 at 12:27
0
String ext= MimeTypeMap.getFileExtensionFromUrl(uri)

By this you can get extension of file and then compare with different mimetype

Milad Faridnia
  • 9,113
  • 13
  • 65
  • 78