Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here what's the mean of "<strong>Local Database</strong>"?</p> <p>Preferred way is download your pages in either <strong>Internal Storage</strong><code>(/&lt;data/data/&lt;application_package_name&gt;)</code> (by default on non rooted device is private to your application) or on <strong>External Storage</strong><code>(public access)</code>. Then refer the pages from that storage area when user device has not a internet connection (<code>offline mode</code>).</p> <p><strong>Update: 1</strong></p> <p>To store those pages, you can use simple <a href="http://developer.android.com/reference/java/io/File.html" rel="nofollow">File</a> read/write operation in Android.</p> <p><strong>For example:</strong></p> <pre><code>String FILENAME = "hello_file"; String string = "hello world!"; FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE); fos.write(string.getBytes()); fos.close(); </code></pre> <p>This example store file <strong>hello_file</strong> in your application's internal storage directory.</p> <p><strong>Update: 2</strong> Download Web-Content </p> <pre><code>HttpClient httpClient = new DefaultHttpClient(); HttpContext localContext = new BasicHttpContext(); HttpGet httpGet = new HttpGet("http://www.xxxx.com"); HttpResponse response = httpClient.execute(httpGet, localContext); String result = ""; BufferedReader reader = new BufferedReader( new InputStreamReader( response.getEntity().getContent() ) ); String line = null; while ((line = reader.readLine()) != null){ result += line + "\n"; } </code></pre> <p>// Now you have the whole HTML loaded on the result variable</p> <p>So write result variable in File, using my update 1 code. Simple.. :-)</p> <p>Don't forget to add these two permission in your android application's manifest file.</p> <pre><code> &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt; &lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt; </code></pre>
    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.
 

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