The Android application I'm working on right now is to search for the keywords "friend" and "important" in the mail(specifically in the subject and content) received in the inbox for the email given, which is implemented using IMAP to connect and read data of the email.
I have implemented the IMAP protocol to read mails, it reads the emails perfectly fine. However, I am having a problem searching for keywords in emails, I have tried implementing the horse pool String match algorithm, but it doesn't work as intended, so I scrapped it. Is there another way to search for keywords in an email(keywords in the subject and content)?
Is there an inbuilt search algorithm or are there more efficient ways to implement this?