|
|
(Chilkat for Android™ API) Get POP3 Mailbox XML Summary
Returns an XML document detailing the UIDLs and sizes of messages in a POP3 mailbox.
Sample XML returned:
...
Download: Chilkat for Android™ Java Libraries
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;
import android.app.Activity;
import com.chilkatsoft.*;
import android.widget.TextView;
import android.os.Bundle;
public class SimpleActivity extends Activity {
// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
String outStr = "";
// The mailman object is used for receiving (POP3)
// and sending (SMTP) email.
CkMailMan mailman = new CkMailMan();
// Any string argument automatically begins the 30-day trial.
boolean success;
success = mailman.UnlockComponent("30-day trial");
if (success != true) {
outStr += mailman.lastErrorText() + "\n";
tv.setText(outStr);
setContentView(tv);
return;
}
// Set the POP3 server's hostname
mailman.put_MailHost("mail.chilkatsoft.com");
// Set the POP3 login/password.
mailman.put_PopUsername("****");
mailman.put_PopPassword("****");
// Get the number of messages in the mailbox.
String xml;
xml = mailman.getMailboxInfoXml();
outStr += xml + "\n";
tv.setText(outStr);
setContentView(tv);
}
static {
// Important: Make sure the name passed to loadLibrary matches the shared library
// found in your project's libs/armeabi directory.
// for "libchilkat.so", pass "chilkat" to loadLibrary
// for "libchilkatemail.so", pass "chilkatemail" to loadLibrary
// etc.
//
System.loadLibrary("chilkat");
// Note: If the incorrect library name is passed to System.loadLibrary,
// then you will see the following error message at application startup:
//"The application <your-application-name> has stopped unexpectedly. Please try again."
}
}
|