Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want your data to be accessible to other Android applications, then the recommended way is to write a <a href="http://developer.android.com/guide/topics/providers/content-providers.html#creating" rel="nofollow noreferrer">Content Provider</a>. If, on the other hand you want your data to be used in non-android applications, you will need to "export" it. This you have to code on your own.</p> <p>I can think of three options right now:</p> <ol> <li><strong>Create XML files</strong><br> Unfortunately, Android does not include all that is necessary to conveniently create XML files. Most notably, the <code>javax.xml.transform</code> is not available, and adding platform classes is not recommened. That means you will have to write it out on your own "transform" class</li> <li><strong>Create JSON files</strong><br> JSON is well supported by the Android API. See <a href="http://developer.android.com/reference/org/json/package-summary.html" rel="nofollow noreferrer">here</a> and <a href="http://www.json.org" rel="nofollow noreferrer">here</a></li> <li><strong>Create Java serialized files</strong><br> As long as your objects implement the interface "Serializable", then they can easily be written out to files. I've never needed to do that myself, but it should be straightforward, and examples should be available on the net. (As an example, Google came up with <a href="http://www.devx.com/Java/Article/9931/1954" rel="nofollow noreferrer">this mini-tutorial</a>)</li> </ol> <p>When you store your files privately, then consider using <a href="http://developer.android.com/reference/android/content/Context.html#openFileInput(java.lang.String)" rel="nofollow noreferrer">openFileInput</a> and <a href="http://developer.android.com/reference/android/content/Context.html#openFileOutput%28java.lang.String%2C%20int%29" rel="nofollow noreferrer">openFileOutput</a>. If you want to store explicitly on the SD-Card, you should use <a href="http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory()" rel="nofollow noreferrer">getExternalStorageDirectory()</a> to retrieve the root folder.</p> <p>My personal recommendation would be to use JSON files. It's a simple format which does well for most cases and it's widely available. Apart from that de/serialization is dead-simple. </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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    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