I am trying to recover emails using IMAP in Android I have been able to retrieve messages from the Inbox folder, but they are facing difficulty in parsing, especially getting the body part of the message (which I want to use in my app) is.
The function that takes a message and gives me a plain text body part (if possible closes the attachment).
got a private string (message message) {try {object m = message.getContent (); } Grip (IOException E) {// TODO Auto-Generated Catch Block e.printStackTrace (); } Catch (Messaging Up E) {// TODO Auto-Generated Catch Block e.printStackTrace (); } Return "ABC"; // Part of body to return }
I have imported the file. However using message.getcontent () ; I'm giving the error: 06-20 15: 22: 50.363: E / Android Runtime (9477): java.lang.RuntimeException: An error occurred while executing doInBackground () 06- 20 15: 22: 50.363: E / Android Random (9 477): Android.OS Async Task $ 3. Don (Async Task, JavaCong 78) 06-20 15: 22: 50.363: E / Android Random (9477): at java.util.concurrent. Future Task $ Sync.innerSetException (FutureTask.java .73) 06-20 15: 22: 50.363: E / Android Runtime (9477): at java.util.concurrent.FutureTask.setException (FutureTask.java:124) 06-20 15: 22: 50.363: E / Android Random (9477): $ Sync.innerRun on java.util.concurrent.FutureTask (FutureTask.java:307) 06-20 15: 22: 50.363: E / Android Time (9477): java .oncurrent.FutureTask.run on .util (FutureTask.java:137) 06-20 15: 22: 50.363: E / Android Random (9 477): Android.OS Sync Task $ SERIAL EXCHANGER $ 1.R (Async Task .Java 208) 06-20 15: 22: 50.363: E / Android Random (9 477): at java.util.concurrent.ThreadPoolExecutor.runWorker (Threadpool Exporter. Java: 1076) 06-20 15: 22: 50.363: E / Android Time (9477): at java.util .c Oncurrent.ThreadPool Excl. $ Worker.run (ThreadPoolExecutor.java lessons69) 06-20 15: 22: 50.363: E / AndroidTime (9477): java.lang.Thread.run (Thread.Java: 856) 06-20 15: 22: 50.363: E / Android Random (9 477): Due to: java.lang.NoClassDefFound Error: javax .activation.DataHandler 06-20 15: 22: 50.363: E / Android Random (9 477): at com.sun.mail.imap. IMAPMessage.getDataHandler (IMAPMessage.java:651) 06-20 15: 22: 50.363: E / Android Random (9 477): at javax.mail.internet.MimeMessage.getContent (MimeMessage.java:1420) 06-20 15: 22: 50.363: E / Android Runtime (9477): at com.example.jmail. Main activate $ network operation.Geti (main activity. Java: 108) 06-20 15: 22: 50.363: E / Android time (9477): com .example.jmail at .MainActivity $ NetworkOperation.doInBackground (MainActivity.java: 87) 06-20 15: 22: 50.363: E / Android Random (9477): at com.example.jmail. Main Activate $ Network Operation. Dawnbackground (Main Activity. JavaPrint) 06- 20 15: 22: 50.363: E / ANDRO Ed Rentime (9 477): Android.OS.Sync Task $ 2.Coll (Async Tasks Java 0464) 06-20 15: 22: 50.363: E / Android Rendime (9477): $ java.util.concurrent.FutureTask Sync.innerRun (FutureTask.java.35) 06-20 15: 22: 50.363: E / Android Time (9477): ... 5 more
Your main question has been answered.
Your error does not have to do with that. Unfortunately, Android is not Java, so it does not include javax.activation. To get it in Android you have to find out. You will find the answer on the stack overflow elsewhere.
No comments:
Post a Comment