btw, this is also affected by the bug (JS-110) in the version validator which would prevent a version like 1.0.1 being used.<br><br><div class="gmail_quote">On 20 January 2011 22:09, Martin Denham <span dir="ltr"><<a href="mailto:mjdenham@gmail.com">mjdenham@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I initially made a few tweaks to JSword to make And Bible work on Android and over the past few months I have been trying either to undo the changes or to feed them back into JSword in some way. There are still a few changes I have outstanding and the most significant relate to indexes. There are i) modified download method ii) new index download thread and iii) index creation for low memory devices.<div>
<br></div><div>I have just modified the And Bible index creation code to make it more consistent with JSword so I will leave that until it is better tested but the index download method code has not changed for a while and I was wondering if it would be possible to find a way to remove my need to hack the JSword AbstractSwordInstaller after every check out.<div>
<br></div><div>It is very messy but here is my hack in AbstractSwordInstaller:</div><div><br></div><div><div> public void downloadSearchIndex(Book book, URI localDest) throws InstallException {</div><div> // TRANSLATOR: Progress label for downloading one or more files.</div>
<div> String jobName = UserMsg.gettext("Downloading files");</div><div> Progress job = JobManager.createJob(jobName, Thread.currentThread());</div><div> job.beginJob(jobName);</div><div><br>
</div><div> //use and-bible index location</div><div> String indexLocation = "/and-bible/indices/v1";</div><div> try {</div><div> String version = (String)book.getBookMetaData().getProperty("Version");</div>
<div> String versionSuffix = version!=null ? "-"+version : "";</div><div> download(job, indexLocation, book.getInitials()+versionSuffix + ZIP_SUFFIX, localDest);</div><div> } catch (InstallException ex) {</div>
<div> job.cancel();</div><div> throw ex;</div><div> } finally {</div><div> job.done();</div><div> }</div><div> }</div></div><div><br></div><div>You can see that indexes include a version number as per PocketSword resulting in file names like "ESV-1.0.1.zip" and are downloaded form a folder I was allocated on the Crosswire site.</div>
<div><br></div><div>One possibility might be just to tidy the above, put it in AbstractSwordInstaller and make it the default index download code for now. Another possibility might be to have (yet more) statics that either switch the above index download method or set parameters used by the current method. The last possibility would be for me just to continue hacking JSword.</div>
<div><br></div><div>What do you think?</div><div><br></div><div>Regards</div><div>Martin</div></div>
</blockquote></div><br>