Can't watch catch Exception with printStprintStackTrac

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Can't watch catch Exception with printStprintStackTrac

Postby Dayn » Mon Jul 13, 2009 11:12 am

I have to connect on a imap4 Server.

I can't watch my exception error.

Here my code:

// initialisation des paramètres du systéme
Properties props = new Properties();
props.setProperty("mail.transport.protocol", "imap");

// Spécification du serveur mail IMAP
props.put("mail.imap.port", "143");
props.put("mail.imap.host", host);

// Récupère la session
Session session = Session.getDefaultInstance(props, null);
try{

// Get a Store object
Store store = session.getStore("imap");


// Connection au serveur IMAP
store.connect(host, username, password);


// Close the Store
store.close();
}
catch(MessagingException mex) {
mex.printStackTrace();
}


My question is: Where is print my exception error?

I watched console DDMS and Android, but i can find that.

Thanks

And thanks for my last custom button topic
User avatar
Dayn
Developer
Developer
 
Posts: 31
Joined: Thu Jul 09, 2009 10:45 am
Location: Paris and Dijon

Top

RE

Postby Dayn » Mon Jul 13, 2009 11:28 am

I'm finding i can use Log.e

with this code :

try{

catch(MessagingException mex) {
Log.e(TAG, "Exception Error=" + mex);
}

And i can whatch that on DDMS


Sorry about my topic but I think is not useless .
User avatar
Dayn
Developer
Developer
 
Posts: 31
Joined: Thu Jul 09, 2009 10:45 am
Location: Paris and Dijon

RE

Postby Dayn » Mon Jul 13, 2009 11:29 am

I'm finding i can use Log.e

with this code :

try{

}
catch(MessagingException mex) {
Log.e(TAG, "Exception Error=" + mex);
}

And i can whatch that on DDMS


Sorry about my topic but I think is not useless.
User avatar
Dayn
Developer
Developer
 
Posts: 31
Joined: Thu Jul 09, 2009 10:45 am
Location: Paris and Dijon

Postby Dayn » Mon Jul 13, 2009 11:34 am

My exception is:

javax.mail.MessagingException: Permission denied (maybe missing INTERNET permission);

Do you know what kind of permission I have to have with android because my code have no error with console java.


Thank, sorry I'm made a mistake on the last topic
User avatar
Dayn
Developer
Developer
 
Posts: 31
Joined: Thu Jul 09, 2009 10:45 am
Location: Paris and Dijon

Postby Dayn » Mon Jul 13, 2009 1:44 pm

Well , so I'm finding here that I can use <uses-permission android:name="android.permission.INTERNET" />

So now my exception error disapear but my emulator bocked displaying :

The application Connection Imap Android (process com.connectionimapandroid) has stopped unexpectedly. please try again

here my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.connectionimapandroid"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".ConnectImapAndroid"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:minSdkVersion="3" />
</manifest>


So please what the matter ?

Thanks

Dayn
User avatar
Dayn
Developer
Developer
 
Posts: 31
Joined: Thu Jul 09, 2009 10:45 am
Location: Paris and Dijon

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 3 guests