Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If using Android you can take advantage of the built SQLiteDatabase and SQLiteOpenHelper. You'll find <strong>all</strong> the info you need <a href="http://www.vogella.com/articles/AndroidSQLite/article.html" rel="nofollow">here</a>. </p> <p>After parsing everything you can export to CSV the way you want by using <a href="http://developer.android.com/reference/java/io/File.html" rel="nofollow">File</a>.</p> <p><strong>EDIT:</strong> So basically what you need to do is to parse the bytes by reading them and that way have access to the content. In some cases you don't even need to convert them to a String, since could be that you only need the value of the byte. (ie.: Offset: 44 Length:4 Description:The schema format number. Supported schema formats are 1, 2, 3, and 4.). You can always check if your values are correct with any HEX editor, even opening the sqlite file with a text editor of any kind would help.</p> <p>Let's start from scratch. First, reading the file. Two approaches</p> <ul> <li>a. Read the whole file and parse it after </li> <li>b. Read and parse the whole file in blocks (recommended, specially for bigger files)</li> </ul> <p>Both approaches would share most of the following code:</p> <pre><code>File file = new File("YOUR FILE ROUTE"); int len = 1024 * 512; //512KB try { fis = new FileInputStream(file); } catch (FileNotFoundException e1) { fis = null; e1.printStackTrace(); } byte[] b = new byte[len]; int bread; try { while((bread = fis.read(b, 0, len))!=-1) { if(parseBlock(b, bread)==1) return; } fis.close(); } catch (IOException e) { e.printStackTrace(); } </code></pre> <p>The difference would be between getting partial blocks and parsing them on the fly (which I guess works for you) and getting the whole thing would be to just put:</p> <pre><code>fis.read(b, 0, fis.available); </code></pre> <p>Instead of the while loop.</p> <p>Ultimately your approach is right, and that's the way to get bytes into a String. (new String(b)). Moreover the first characters are likely to represent weird symbols, if you have a look to the file format of SQL, these are reserved bytes for storing some metadata. Open the sqlite file with any text editor and check that what you see there matches with what comes out of your code.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload