I understand the analysis xml, I use for this purpose XMLPullParser . As an example, I decided to look into the fb2 file and write a reader. File format is described here .

In principle, it is possible to analyze the file, but several questions arise:

  1. If, for example, you copy the file 1.fb2 to the folder raw \ xml, the studio swears that the file should be. extension * .xml. Why? Can I somehow work with xml-th structure files using XMLPullParser?

  2. The fb2 file has to be edited before analyzing.

    <?xml version="1.0" encoding="windows-1251"?><FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink">


I had to remove xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" and change the encoding to UTF-8. After that, xml-fb2 "got bored" can someone be able to comment

PS Parser settings ( FEATURE_VALIDATION , FEATURE_PROCESS_DOCDECL ) looked, but they didn’t help me, maybe they didn’t get it right with them

  • You are one question - why? touch on a variety of topics. Resources is a rigid structure and you cannot store a .fb2 file in the xml folder, so it swears. Store in assets, but the data there does not have a structure, so you will have to use streams to read them by bytes, then why complicate and limit yourself, immediately read the data from memory (SD) along the way, use xmlparser to work with fb2. As an option, just change the file extensions and put it already in package xml, what is your question? where is the mistake? what exactly does not work? - Shwarz Andrei
  • How to open a .fb2 file with SD, now it turns out only by changing the extension to .xml? - nikomp
  • If I add intent-filter <data android: pathPattern = ". * \\. Fb2" /> in the manifest and change the extension to .fb2, the file does not open - nikomp

0