i am using the default email app that come with ics, and i want to catch the email recieving programatically (i want to recieve and sender information and the email body itself), how can i do it? i tried search however i only find how to send email and how to recieve email in gmail (which is not my case)
thanks
Unfortunately, there is no way to "catch" emails as they come to the phone. You'll have to manually connect to the mail server and download the emails. If you're interested in doing that, I've used the javamail-android port, which actually is pretty fully featured.
Related
I made a Python code that automatically sends mail.
The contents of the body in the mail were written in HTML format so that the mail could go at a specific time.
If you send an e-mail in the form of Text, the e-mail linked to Samsung e-mail (email service on Android phone) does not show the body. (When checked by Android phone, the attachment is sent normally, but the body is exposed in white.)
Conversely, when sending mail in the form of Html, the contents of the body are printed twice only in the groupware mail (PC).
(If you send it to the groupware mail, Naver mail, Daum mail, or Google mail registered in Samsung email, it will only be printed once.)
I don't understand at all the phenomena that are printed twice only in "Groupware PC" and that the text does not come out when printed in text form in Samsung e-mail, so what part should I check?
I am trying to automated a flow where I can read sms and then parse the SMS to read the OTP and enter it in another webapp. Looked through all forums but couldn't find an answer.
I am writing code in java and trying to run a webapp on android device using appium.
Can someone suggest how to do it?
If you want to read sms from device in Appium session there is a good approach described in discuss.appium.io
I think you can create several sessions in one test: 1 - to get sms with native app, 2 - open webApp in mobile browser and do whatever you need
This approach worked for me
Suppose your OTP sms is like "OTP is 12345 for your order", and it shows up in your notification panel,
Reach the OTP Screen
Pull down the notification bar ((AndroidDriver) driver).openNotifications();
Wait for this element otpElement with xpath //android.widget.TextView[contains(#text,'OTP is')] is displayed (ie, While the sms arrives)
Use OTPmessage = otpElement.getText() to get the OTP message text
Extract OTP using this code : String OTP = StringUtils.substringBetween(OTPmessage, "OTP is ", " for ");
Close notification panel using ((AndroidDriver) driver).pressKey(new KeyEvent(AndroidKey.BACK));
I dont think this is a good approach if you are testing the app. It might take lot of time for the OTP to arrive thereby failing your test unnecessarily. Better ask your devs keep the OTP fixed so you don't need to receive it through the sms everytime.
You can add a key to store last OTP in an in-memory storage like Redis or closured Dictionary in your backend language, you will then update this key with the value of the OTP you want to send out via an SMS service provider. The last sent OTP stored in this key should then be exposed via an additional api endpoint in your service, which you would then call as part of your automated script after doing an action that will make the OTP to be sent.
A more reliable and robust modification of this will be to expose an API that retrieves the OTP stored against each phone number, you must have this stored already of course before you could do the verification in-app. This endpoint must only be exposed within a test environment, that's the precaution to pay attention to, or you make the endpoint available only to authorized user roles.
I'm just wondering is it possible to send a Message from the app without using actionView or actionSend ( meaning no asking for chooser to send via google or hotmail etc.. ) from the Intent ?
what I want to make is like a TextView and a Button
the user will enter a text in the textview and then click the Button to send the message, then the message will be automiatlly sent to the developer ( me )
I hope what I'm thinking of is possible.
I'm not sure what kind of message you are trying to send, but you can use the SMS feature of the phone to send not only a SMS, but an email, too.
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("1"+yourPhoneNumber, userPhoneNumber, message, null, null);
You can replace phone numbers with emails and it will work without user interaction (unlike sending an email through an email client which cannot be done automatically). You can try it out by texting your own email. For your specific situation, you could set up a developer email that handles all of these messages that you are trying to send. The only issue with this is that you may not know who you are receiving messages from. For example, if you send a SMS -> email, it might show up as from something#vz.com or something. However, you can mitigate this by including addition info in the message payload itself.
Yes, it is possible. You can use the internet connection to have the message saved to some cloud storage or something. Personally, I prefer using Parse.com because they have an amazing API that saves you a lot of hassle.
Just add the message from the EditText to a ParseObject and call the saveEventually() method. As soon as the internet is back on, the message will be sent to your cloud storage.
I have seen many times the ease of sending an email in the foreground using the Android Intent Action.SEND.
However I need to implement a feedback form which emails us the details on completion. This doesnt really suit the Android Intent because the user wouldnt want to see the generated email before sending.
Does anyone have any sample code which can send an email form the background if we assume the smtp server is lol.does.thiswork and the username = lala, password = po.
Cheers
Possible duplicate of this: Sending Email in Android using JavaMail API without using the default/built-in app and plenty of example code in there.
as an editorial note, anytime an application I am using on a phone sends an email, I personally WOULD want it in the foreground. If its just feedback from a form on your application, you could also use several solutions other than email: a web form in a webview, or create a socket back to a server you host, or a use a webservice etc...
I am new to android. I configured the email address in the android emulator.I want to get the email content,if the configured email receives the mail from other mailid.which notification shall i use and how to get the email content when the notification raises the alert. how can i achieve this.
Thanks in advance.....
It sounds to me like you're trying to say that you signed-in to the mail app on the Android device. From my understanding of the question you've raise, signing-in to an email account on the Android device doesn't mean any application can just grab emails from it. The closest solution I can think of is creating an IMAP connection to a mail server to grab mail content.