When you use xpath that is to locate nested elements you have to start your query from .. Like String query = ".//*[contains(@resource-id, 'delivered_indicator')]";
I'm going to be perfectly honest and say in my 30 years of manual and automated testing I find automating manual test cases for mobile devices a waste of time. The time and $$ involved in creating and maintaining the test suites, considering their relatively short shelf life, is better spent buying a few of the most popular devices and writing comprehensive ...
In modern applications to gain performance not all the content is loaded at once. Option I would suggest is.
Can you scroll to the bottom of the page in the start and then try to find the elements? That way you can be sure that all the elements were loaded.
When querying Android apps with Xpath there is no id attribute. There is a resource-id attribute instead. Appium is doing work behind the scenes to still provide By.id as a locator despite this.
If you don't use contains here, you'll need to put in the full resource-id, which is very long.