Happy to share, Peter!
- Find appropriately structured text file worthy of transformation into an app
- Edit/pre-process it into a structured format suitable for manipulation
- Run Perl script to wrap individual entries with appropriate XML (including dynamically generated unique element IDs)
- Download app .aia, extract Screen1.bky or equivalent from it following guidelines as posted elsewhere (replace files in situ, primarily), insert generated XML into it, and copy it back into .aia, upload revised .aia
Along with this, of course, there’s also the creation of “art” as appropriate (buttons, Google / Amazon app store imagery, background images) which, in my case, typically also involves finding images suitable for manipulation that are clearly public domain and thus don’t create any issues with intellectual property licensing.
The first step is to identify a meaningfully important text that is appropriately structured, i.e., is broken down by the author or translator into units no larger than a couple of paragraphs at most, which make coherent sense (generally) when viewed on a stand alone basis. The Gospel of Thomas, being a “sayings gospel”, with each component completely independent of any other, is an ideal example, but the Art of War, as well, fits that model. “Nuggets of wisdom”, so to speak.
The second / third step is to prepare the text for import and run a Perl script to wrap individual entries in XML. I copied and pasted the content into my first app, but manually creating a list of 80+ items, then copying and pasting text into it, is incredibly tedious and silly, given that (from being a sysadmin) I have high degree of facility and experience with manipulating text (aka XML) files using Perl and regular expressions. This means making sure that the content is reformatted in a consistent way that enables it to be programmatically manipulated.
This usually involves a bit of regexp based search and replace using “vi”, plus a visual scan to pick up any anomalies. I use markers of some sort (such as blank lines) to cue the Perl script as to when to insert the beginning and end XML sections that will be copied and pasted into the app’s ScreenX.bky file. I’ll also use the Perl script to dynamically assemble headings (such as with the Art of War app) that make sense. When reading the book, having a chapter heading appear once, then individual paragraph numbers follow it, makes sense, because you know where in the book you are. By contrast, the app’s selective excerpting of text requires that prepending the Chapter heading to each paragraph number, thus providing an indication of where in the book the excerpt comes from, in case the reader’s curiosity is sparked and they want to go directly there and read further. Primary purpose of the Perl script, though, is to pre and post pend XML to each entry so that the text can be imported into a .bky file and from there into an .aia file.
Final step is to carefully insert the generated XML into the .bky file’s associated list definition, making sure to update the number of items in it definition at the same time. The process of altering an .aia file without destroying its integrity is described elsewhere. The .bky files are sensitive to malformed XML, so you have to be precise about only replacing the content portion of the list containing the text file entries. Experience teaches me that it is best to isolate the list definition that will contain the text files at the bottom or top of the file.
From there, hopefully, it’s smooth sailing. Occasionally, I’ll notice that I’ve missed something, and have to go back and edit the original text file appropriately and go through the import process a second time. Rarely, I’ll be able to manually “fix” the problem by editing the list components in AB directly, but generally speaking, dealing with manually defined 100+ item list entries is not something you want to do given the constraints of the UI.
Does that answer the question? I posted some code elsewhere in the forums that illustrates how to dynamically generate a valid XML id, that’s really the only “unique” element to what I’m doing.