Web Archive File - XML File of Base64 Encoded Data

This section provides a tutorial example on how to view contents of a Web archive file, which is really an XML file with Base64 encoded data.

In previous tutorials I use able to build my own Web browser, AndroidWeb, to visit Web sites and save page contents into Web archive files. In this tutorial, I want to spend some time to explore those Web archive files.

First copy AndroidWeb "files" folder from the emulator to my Windows file system:

C:\herong>\local\android-sdk-windows\platform-tools\adb 
   pull /data/data/com.herongyang.web/files .\files

pull: building file list...
pull: /data/data/com.herongyang.web/files/Activity.log 
   -> .\files/Activity.log
pull: /data/data/com.herongyang.web/files/1323772666133.xml 
   -> .\files/1335017266133.xml
pull: /data/data/com.herongyang.web/files/1323772679558.xml 
   -> .\files/1335017279558.xml
pull: /data/data/com.herongyang.web/files/1323772686866.xml 
   -> .\files/1335017286866.xml
4 files pulled. 0 files skipped.

I have 3 Web archive .xml files, because I visited 3 Web pages in the previous tutorial:

Open 1323772666133.xml in a Web browser, I see this XML file structure:

<?xml version="1.0" ?> 
<Archive>
 <mainResource>
  <ArchiveResource>
   <url>aHR0cDovL3d3dy5nb29nbGUuY29tLw==</url> 
   <mimeType>dGV4dC9odG1s</mimeType> 
   <textEncoding>dXRmLTg=</textEncoding>
   <frameName /> 
   <data>PCFkb2N0eXBlIGh0bWw+PGh0bWwgbWFuaWZlc3Q9Imh0dHA6Ly...</data>
  </ArchiveResource>
 </mainResource>       
 <subresources>        
  <ArchiveResource>     
   <url>ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5T...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType>        
   <textEncoding>VVMtQVNDSUk=</textEncoding>
   <frameName />        
   <data>iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAABH...</data>  
  </ArchiveResource>
  <ArchiveResource>
   <url>ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5T...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType> 
   <textEncoding>VVMtQVNDSUk=</textEncoding> 
   <frameName /> 
   <data>iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAABH...</data>
  </ArchiveResource>
  <ArchiveResource>
   <url>ZGF0YTppbWFnZS9naWY7YmFzZTY0LFIwbEdPRGxoR0FBZUFLSUhB...</url>
   <mimeType>aW1hZ2UvZ2lm</mimeType> 
   <textEncoding>VVMtQVNDSUk=</textEncoding> 
   <frameName /> 
   <data>R0lGODlhGAAeAKIHAOvr69DQ0N3d3b+/v8DAwP////Pz8////y...</data>
  </ArchiveResource>
  <ArchiveResource>
   <url>ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5T...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType> 
   <textEncoding>VVMtQVNDSUk=</textEncoding> 
   <frameName /> 
   <data>iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAABH...</data>
  </ArchiveResource>
  <ArchiveResource>
   <url>ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5T...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType> 
   <textEncoding>VVMtQVNDSUk=</textEncoding> 
   <frameName /> 
   <data>iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAX...</data>
  </ArchiveResource>
  <ArchiveResource>
   <url>ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5T...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType> 
   <textEncoding>VVMtQVNDSUk=</textEncoding> 
   <frameName /> 
   <data>iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAABH...</data>
  </ArchiveResource>
  <ArchiveResource>
   <url>ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5T...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType> 
   <textEncoding>VVMtQVNDSUk=</textEncoding> 
   <frameName /> 
   <data>iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAABH...</data>
  </ArchiveResource>
  <ArchiveResource>
   <url>ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5T...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType> 
   <textEncoding>VVMtQVNDSUk=</textEncoding> 
   <frameName /> 
   <data>iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAABH...</data>
  </ArchiveResource>
  <ArchiveResource>
   <url>ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5T...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType> 
   <textEncoding>VVMtQVNDSUk=</textEncoding> 
   <frameName /> 
   <data>iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAABH...</data>
   </ArchiveResource>
  <ArchiveResource>
   <url>ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5T...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType> 
   <textEncoding>VVMtQVNDSUk=</textEncoding> 
   <frameName /> 
   <data>iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAABH...</data>
  </ArchiveResource>
  <ArchiveResource>
   <url>ZGF0YTppbWFnZS9wbmc7YmFzZTY0LG...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType> 
   <textEncoding>VVMtQVNDSUk=</textEncoding> 
   <frameName /> 
   <data>iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADIm...</data>
  </ArchiveResource>
  <ArchiveResource>
   <url>aHR0cDovL3d3dy5nb29nbGUuY29tL2ltYWdlcy9zcnByL2xvZ28z...</url>
   <mimeType>aW1hZ2UvcG5n</mimeType> 
   <textEncoding /> 
   <frameName /> 
   <data>iVBORw0KGgoAAAANSUhEUgAAARMAAABfCAMAAAD8mtMpAAAC/V...</data>
  </ArchiveResource>
 </subresources>
 <subframes>
  <Archive>
   <mainResource>
    <ArchiveResource>
     <url>YWJvdXQ6Ymxhbms=</url> 
     <mimeType>dGV4dC9odG1s</mimeType> 
     <textEncoding /> 
     <frameName>d2dqZg==</frameName> 
     <data /> 
    </ArchiveResource>
   </mainResource>
   <subresources /> 
   <subframes /> 
  </Archive>
 </subframes>
</Archive>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

This tells me that:

Last update: 2015.

Table of Contents

 About This Book

 Installing JDK 1.8 on Windows System

 Installation of Android SDK R24 and Emulator

 Installing Apache Ant 1.9 on Windows System

 Developing First Android Application - HelloAndroid

 Android Application Package (APK) Files

 Android Debug Bridge (adb) Tool

 Android File Systems

 Android 4.0.3 File Systems

 AboutAndroid - Application to Retrieve System Information

 android.app.Activity Class and Activity Lifecycle

 View Objects and Layout Resource Files

 Using "adb logcat" Command for Debugging

 Build Process and Package File Content

Building Your Own Web Browser

 android.webkit.WebView - Web Browser Base Class

 AndroidWeb - My Own Web Browser

 WebViewClient Subclass - Content Rendering Callbacks

 saveWebArchive() Method - Saving Web Archive Files

Web Archive File - XML File of Base64 Encoded Data

 Android Command Line Shell

 Samsung Galaxy Tab 3 Mini Tablet

 USB Debugging Applications on Samsung Tablet

 Android Tablet - LG-V905R

 USB Debugging Applications on LG-V905R Tablet

 Android Phone - LG-P925g

 USB Debugging Applications on LG-P925g Phone

 Outdated Tutorials

 References

 PDF Printing Version