LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Mobile (https://www.linuxquestions.org/questions/linux-mobile-81/)
-   -   email app is not working in android emulator (https://www.linuxquestions.org/questions/linux-mobile-81/email-app-is-not-working-in-android-emulator-864216/)

jkm 02-21-2011 11:17 PM

email app is not working in android emulator
 
hi
i need to implement an email application for android.
i have a code of email app that is running fine, but only when i create a java project. It is not running when i create android project.
Is there any dependency to run this email app in android emulator?
Please help, i m stuck on this point. OR if any other solution, plz tell.
I m using eclipse in ubuntu.
This is my very first post in a forum, so sorry for any mistake.

Thanks in advance.

business_kid 02-22-2011 10:40 AM

Welcome to LQ.

What goes wrong? What are you using? Have you set about it with adb? Tried to collect a log? The android comes with gmail & email app, which use network & stuff. I think you have reading to do.

jkm 02-23-2011 03:24 AM

email app is not working in android emulator
 
Thanks for reply.

I am using eclipse IDE in ubuntu. In eclipse, there are options to create a new project; like File>New>"Java project", "Android project", "Project...", etc. One thing is that I have an email application code.
Now, the problem is:
when i create a new "Java project" and use this email application code, it runs fine, mail sent successfully.
But, when i create a new "Android project" and use this email application code, it doesn't run; infact there is a run time error.
The log is as below:


Console log:

[2011-02-23 14:25:09 - AndroidEmailApp] ------------------------------
[2011-02-23 14:25:09 - AndroidEmailApp] Android Launch!
[2011-02-23 14:25:09 - AndroidEmailApp] adb is running normally.
[2011-02-23 14:25:09 - AndroidEmailApp] Performing email.app.sendmail activity launch
[2011-02-23 14:25:09 - AndroidEmailApp] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'AVD9'
[2011-02-23 14:25:09 - AndroidEmailApp] WARNING: Application does not specify an API level requirement!
[2011-02-23 14:25:09 - AndroidEmailApp] Device API version is 9 (Android 2.3.1)
[2011-02-23 14:25:09 - AndroidEmailApp] Uploading AndroidEmailApp.apk onto device 'emulator-5554'
[2011-02-23 14:25:10 - AndroidEmailApp] Installing AndroidEmailApp.apk...
[2011-02-23 14:25:39 - AndroidEmailApp] Success!
[2011-02-23 14:25:40 - AndroidEmailApp] Starting activity email.app.sendmail on device emulator-5554


LogCat log:

02-23 14:26:39.124: INFO/System.out(2875): Hi...in try...1!
02-23 14:26:39.124: INFO/System.out(2875): Hi...in postmail...1!
02-23 14:26:39.135: INFO/System.out(2875): Hi...in postmail...2!
02-23 14:26:39.194: INFO/System.out(2875): Hi...in postmail...3!
02-23 14:26:39.385: INFO/System.out(2875): Hi...in postmail...4!
02-23 14:26:39.385: INFO/System.out(2875): Hi...in postmail...5!
02-23 14:26:39.475: INFO/System.out(2875): Hi...in postmail...6!
02-23 14:26:40.335: INFO/System.out(2875): Hi...in authentication...1!
02-23 14:26:40.335: INFO/System.out(2875): Hi...in authentication...2!
02-23 14:26:40.365: WARN/System.err(2875): Cannot send Email. javax.mail.MessagingException: Could not connect to SMTP host: gmail-smtp.l.google.com, port: 587;
02-23 14:26:40.365: WARN/System.err(2875): nested exception is:
02-23 14:26:40.375: WARN/System.err(2875): java.net.SocketException: Permission denied
02-23 14:26:40.385: INFO/System.out(2875): Hi...in try...2!

So, i want to know, is there any dependency to run this email application code in android emulator??, as it is running fine in "Java project".

--
Thanks

jkm 02-28-2011 07:18 PM

Hey!
that issue is now solved.
i had to take permission of internet in code.
now, mail is being sent through android emulator also.

thanks.

archtoad6 03-02-2011 10:56 AM

Mark it so. --J.L.Picard :)

jkm 03-07-2011 01:37 AM

How to add a progress bar in android email app?
 
Hi
Can anybody please tell me how to add a progress bar in android email application,
so that, when user clicks on "send mail" button, he/she can understand that the mail sending process is going on.


All times are GMT -5. The time now is 10:41 PM.