<?xml version="1.0" encoding="utf-8"?>
<Application>
	<AppTitle>fileTutorial</AppTitle>
	<AppShortName>MyApp</AppShortName>
	<Author>Author name</Author>
	<Version>1.0</Version>
	<DesignDeviceName>GenericPhone</DesignDeviceName>
	<VariablesScanned>False</VariablesScanned>
	<PageWidth>320</PageWidth>
	<PageHeight>480</PageHeight>
	<AutoSizeWidth>True</AutoSizeWidth>
	<AutoSizeHeight>True</AutoSizeHeight>
	<HideScrollbars>False</HideScrollbars>
	<PublishPlatform>MobileApp</PublishPlatform>
	<EmptyBuildFolder>False</EmptyBuildFolder>
	<MobileBuildTarget>E:\core.zip</MobileBuildTarget>
	<LanguageCode>en</LanguageCode>
	<ThemeColor>#000000</ThemeColor>
	<MobileID>app.file.core2</MobileID>
	<MobileOSTypes>[AndroidOS]</MobileOSTypes>
	<WindowState>normal</WindowState>
	<TitleBar>True</TitleBar>
	<Sizeable>True</Sizeable>
	<MaximizeBtn>False</MaximizeBtn>
	<MinimizeBtn>True</MinimizeBtn>
	<SystemMenu>True</SystemMenu>
	<ContextMenu>False</ContextMenu>
	<AlwaysOnTop>False</AlwaysOnTop>
	<ShowInTaskbar>True</ShowInTaskbar>
	<SingleInstance>False</SingleInstance>
	<ChromeKioskMode>False</ChromeKioskMode>
	<CustomXML>&lt;plugin name=&quot;cordova-plugin-nativestorage&quot; source=&quot;npm&quot; spec=&quot;~2.1.0&quot;/&gt;</CustomXML>
	<Components>
		<FunctionList name="Subroutines">
			<Components>
				<Function name="createfile">
					<Code>var type = window.TEMPORARY;
   var size = 5*1024*1024;
   window.requestFileSystem(type, size, successCallback, errorCallback)

   function successCallback(fs) {
      fs.root.getFile(&apos;log.txt&apos;, {create: true, exclusive: true}, function(fileEntry) {
         alert(&apos;File creation successfull!&apos;)
      }, errorCallback);
   }

   function errorCallback(error) {
      alert(&quot;ERROR: &quot; + error.code)
   }</Code>
					<ScriptLanguage>JavaScript</ScriptLanguage>
				</Function>
				<Function name="writefile">
					<Code>var type = window.TEMPORARY;
   var size = 5*1024*1024;
   window.requestFileSystem(type, size, successCallback, errorCallback)

   function successCallback(fs) {
      fs.root.getFile(&apos;log.txt&apos;, {create: true}, function(fileEntry) {

         fileEntry.createWriter(function(fileWriter) {
            fileWriter.onwriteend = function(e) {
               alert(&apos;Write completed.&apos;);
            };

            fileWriter.onerror = function(e) {
               alert(&apos;Write failed: &apos; + e.toString());
            };
            var mytext= document.getElementById(&apos;area1&apos;).value;
            var blob = new Blob([mytext], {type: &apos;text/plain&apos;});
            fileWriter.write(blob);
         }, errorCallback);
      }, errorCallback);
   }

   function errorCallback(error) {
      alert(&quot;ERROR: &quot; + error.code)
   }</Code>
					<ScriptLanguage>JavaScript</ScriptLanguage>
				</Function>
				<Function name="readfile">
					<Code>var type = window.TEMPORARY;
   var size = 5*1024*1024;
   window.requestFileSystem(type, size, successCallback, errorCallback)

   function successCallback(fs) {
      fs.root.getFile(&apos;log.txt&apos;, {}, function(fileEntry) {

         fileEntry.file(function(file) {
            var reader = new FileReader();

            reader.onloadend = function(e) {
               var txtArea = document.getElementById(&apos;area2&apos;);
               txtArea.value = this.result;
            };
            reader.readAsText(file);
         }, errorCallback);
      }, errorCallback);
   }

   function errorCallback(error) {
      alert(&quot;ERROR: &quot; + error.code)
   }</Code>
					<ScriptLanguage>JavaScript</ScriptLanguage>
				</Function>
				<Function name="deletefile">
					<Code>var type = window.TEMPORARY;
   var size = 5*1024*1024;
   window.requestFileSystem(type, size, successCallback, errorCallback)

   function successCallback(fs) {
      fs.root.getFile(&apos;log.txt&apos;, {create: false}, function(fileEntry) {

         fileEntry.remove(function() {
            alert(&apos;File removed.&apos;);
         }, errorCallback);
      }, errorCallback);
   }

   function errorCallback(error) {
      alert(&quot;ERROR: &quot; + error.code)
   }</Code>
					<ScriptLanguage>JavaScript</ScriptLanguage>
				</Function>
			</Components>
		</FunctionList>
		<LibraryList name="Libraries"/>
		<PageList name="Main">
			<Components>
				<Page id="NewPage">
					<Components>
						<PushButton id="PushButton1">
							<left>28px</left>
							<top>117px</top>
							<width>154px</width>
							<height>46px</height>
							<caption>create file</caption>
							<click>createfile</click>
						</PushButton>
						<PushButton id="PushButton2">
							<left>28px</left>
							<top>173px</top>
							<width>154px</width>
							<height>46px</height>
							<caption>writeFile</caption>
							<kind>primary</kind>
							<click>writefile</click>
						</PushButton>
						<PushButton id="PushButton3">
							<left>28px</left>
							<top>228px</top>
							<width>154px</width>
							<height>46px</height>
							<caption>Readfile</caption>
							<kind>success</kind>
							<click>readfile</click>
						</PushButton>
						<PushButton id="PushButton4">
							<left>28px</left>
							<top>280px</top>
							<width>154px</width>
							<height>46px</height>
							<caption>deletefile</caption>
							<kind>danger</kind>
							<click>deletefile</click>
						</PushButton>
						<TextArea id="area1">
							<left>24px</left>
							<top>20px</top>
							<width>264px</width>
							<height>89px</height>
							<place_holder>write something....</place_holder>
						</TextArea>
						<TextArea id="area2">
							<left>27px</left>
							<top>336px</top>
							<width>264px</width>
							<height>89px</height>
							<place_holder>you can read here..</place_holder>
						</TextArea>
						<Paragraph id="Paragraph1">
							<left>204px</left>
							<top>118px</top>
							<width>102px</width>
							<height>21px</height>
							<text>nativestorage</text>
						</Paragraph>
						<PushButton id="PushButton5">
							<left>205px</left>
							<top>148px</top>
							<width>87px</width>
							<height>33px</height>
							<caption>write</caption>
							<click>beginJS
 var data = document.getElementById(&quot;area1&quot;).value;
     NativeStorage.set(&quot;dummy_ref_obj&quot;,
     data,
     function(result) {
         alert(&quot;Saved Data : &quot; + result);
     },
     function(e) {
         fail(&quot;Write Object Failed&quot;);
     });
endJS</click>
						</PushButton>
						<PushButton id="PushButton6">
							<left>204px</left>
							<top>188px</top>
							<width>87px</width>
							<height>33px</height>
							<caption>read</caption>
							<click>beginJS
var data = document.getElementById(&quot;area2&quot;).value;
        NativeStorage.getString(&quot;dummy_ref_obj&quot;,
            function (result) {
                alert(&quot;Current Stored Value was: &quot; + result);
            },
            function (e) {
                fail(&quot;Read Object Failed&quot;);
            });

endJS</click>
						</PushButton>
						<Paragraph id="Paragraph2">
							<left>205px</left>
							<top>230px</top>
							<width>91px</width>
							<height>66px</height>
							<style>font-size:8pt</style>
							<text>added plugin strings in Platform&gt;Mobile</text>
						</Paragraph>
					</Components>
				</Page>
			</Components>
		</PageList>
		<PageList name="Master">
			<Components>
				<Page id="MasterPage"/>
			</Components>
		</PageList>
		<PageList name="Dialog">
			<Components>
				<Page id="NewDialog">
					<Components>
						<DialogContainer id="DialogContainer1">
							<left>0px</left>
							<top>0px</top>
							<width>320px</width>
							<height>480px</height>
							<close_button>False</close_button>
						</DialogContainer>
					</Components>
				</Page>
			</Components>
		</PageList>
	</Components>
</Application>
