Extract specific keyword from incoming message android broadcaster

92
May 02, 2018, at 04:20 AM

I want to extract a keyword from String.

Means that i want to extract all keywords from incoming message, and then check each string in the database is exist or not. And ignore common words (i.e. i, am, or, you, me, that, ...etc), accept only keywords, college, human, love, LGS, etc.

How i can do it in android?

A main problem is that, check the existence of specific keywords.

If you have another solution please guide me.

Thanks-

Answer 1

Just split the string and walk the list.

String[] searchwords = myMessageString.split(" ");
for ( int i=0; i < searchwords.length; i++) {
   bool found = searchDatabaseForWord(searchwords[i]);
   if(found){
        //do something with it.
   }
}
READ ALSO
How to adding string before just selected item at WheelPicker (React Native JS)

How to adding string before just selected item at WheelPicker (React Native JS)

I want to add '$' sign before the just Selected WheelPicker itemBut my code is add '$' before front of All Picker Item

84
Extend Volume Panel in Android

Extend Volume Panel in Android

I'm currently developing an app for casting video to ChromecastI want to control the Chromecast volume by hardware buttons

130
Full width text input like Gmail in Android

Full width text input like Gmail in Android

I don't understand how Gmail is making a full width text input in the New Email activity, either for the recipients or the mail content, and with the surrounding full width border

102
Is it possible to create a CMake-only project for Android Studio?

Is it possible to create a CMake-only project for Android Studio?

I have an 'MyLibaar' project that creates my reusable module for multiple Android apps

85