I created an Android app for World Health Organization long ago. I made different kinds of search engines before with full-text indexing. This time I wanted to do something different. I had only 4 days to make the app. They had different kinds of contents like
Plain text files
And they needed a search engine to search all the contents and show a unified result set ( Showing results in a same page with relevancy ). Now I could implement it in SQLite, but that would mean a lot of task and the gain would be much lesser than a document-based search engine like Apache Lucene.
Interfaces were built to create public API and minimize client code to access fungible objects. I do use interfaces heavily for all the purposes you probably are familiar with. Today I would like to introduce a new and opinionated way I am using interfaces which helps me to create consistent structures of similar classes.
I am into studying reactive architectures right now. I was reading to build scalable architectures for web applications. I just ran into an article which I could not resist to read even though it’s about Android development:
I needed to create a dynamic gallery yesterday. I could easily create an ImageView and add it to a container. But it was hard to set layout parameters to the image. I needed it to position it correctly. Most important need was to set its width as MATCH_PARENT. It can be done by setting up a proper LayoutParams object.
I was learning android fragments. I made a separate layout for large screens.
Now I am calling updateArticleView() from MainActivity which is actually updating the Text View inflated by the ArticleFragment. I am getting NULL by this line
But getView() works fine and I can update the text. I printed the view hierarchy and it has the element, but somehow findViewById of the activity cannot return the object. Application is working. I posted the problem to stackoverflow. Let’s see someone can solve the catch.