as we know that Conversation threading is a feature used by many email clients in which the software aids the user by visually grouping messages.
i build an email client application using javamail running on Android.Guide from this post, i have sucessfully to get unread message.
This output is nested mail like converstation
- A replay to B (latest message)
- B reply to A
- mail from A to B (first mail)
My problem is, i want to get only the latest message on this thread [A replay to B (latest message)]. How Should i do it??
You're going to have to request enough envelope/header information to figure out which message that is, then you can fetch only the content for that message.
Related
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 am working on a chat app and on Reply Algorithm. Let I explain:
when someone want to reply to a specific message touches that message and on popup menu touches "Reply" then writes a message and click send. message that shows in channel is a premier message and it's reply(LIKE TELEGRAM APP). I don't want to send premier message again because of performance and My traffic limit in PUBNUB and premier message is there in client Apps. My algorithm is send premier message ID and reply then use that ID to find premier message. but App must involve a Query to find that message. I think start finding from last to first(because usually relies given to last messages) is good. questions is:
1 - all of this, is good way?
2 - there is better Query Algorithm?
this question is not for specific programming language but I am working on Android(JAVA).
i searched this but i couldn't find any solution ...
I want to develop an application in android , in this application you have a friend list. i want to you can send messages with XMPP to your friends, and get messages with XMPP through Google Talk Server . For be able to do this, i created a instance application about sending Google Talk (Xmpp) messages between two Android devices with this link and this link. i used asmack.jar for this and now i can send messages between 2 device. But Problem is this ;
i have two gmail addresses , for example foo#gmail.com and bar#gmail.com .
for chat between 2 devices and send message from first one to second recipient , i have to write "bar#gmail.com/Smack014GAB5B....." as recipent address . if i only write "bar#gmail.com" as recipient , i can't send it ...
Question is , how can i send message to recipient without "Smack014GAB5B..." extension after "/" ?
Any help would be great ...
[Background]
I am looking for some way to automate phone verification (6 digit code sent on cell phones(android) )
[My Way-probably really lame]
Create an app that polls messages coming in, search for keyword "verification".
If found ,get the 6 digit number from the message and update the file over network from cell.
Script on PC will read entry of file after the verification code was sent and use it.
Are there any API's exposed?
Verification is similar to what we have on gmail.
Thanks in advance for any inputs
Sync Messages to another Gmail acocunt where such login is not required.
Create an Console app that reads you gmail folders
poll for latest message, and voila, you have your code.
I'm using java server to send message to use google cloud message. But when i sent message i've received " project ** not whitelisted"
i've signed up at https://services.google.com/fb/forms/gcm/ and received a confirm email with content "Thank you. Your information has been sent to Google. A member of the team will be in touch shortly."
but when i try to send message again still received "project ** not whitelisted"
who can tell me how long does it take to whitelisted by google?
Probably you can expect mail from Google withing certain period(May be 3 months) of time.But am not sure how much time it will take.These are the links that i found on the internet which may help you:
1.Developer Console
2.Google user got mail
3.Discussion on Google group