Search code examples
javaandroidsearchsearchable

Searchable pages in android app


I have saved several html pages, which I want to put into an android app that allows offline searching of heading of these html pages. How can this be achieved?


Solution

  • Hope you are using Android native programming and your files are in the res or raw folder. I have done like this in my application

    1. Create a text file with all the html file headings.
    2. Read the file content in an array or arraylist when the application starts.
    3. When user enter the data and click search, I will parse through my arraylist and note the position which has that string. In my application user entered string can be in multiple headings.
    4. My file names are like d0, d1, d2 etc. So once I get the file position I will construct the file name by placing 'd' in front of the arrayindex