<?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>
	<AppIcon>C:\Users\Asmat\Documents\VisualNeoWeb\Libraries\img\default-icon.png</AppIcon>
	<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>
	<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>82px</left>
							<top>119px</top>
							<width>154px</width>
							<height>46px</height>
							<caption>create file</caption>
							<click>createfile</click>
						</PushButton>
						<PushButton id="PushButton2">
							<left>82px</left>
							<top>175px</top>
							<width>154px</width>
							<height>46px</height>
							<caption>writeFile</caption>
							<kind>primary</kind>
							<click>writefile</click>
						</PushButton>
						<PushButton id="PushButton3">
							<left>82px</left>
							<top>230px</top>
							<width>154px</width>
							<height>46px</height>
							<caption>Readfile</caption>
							<kind>success</kind>
							<click>readfile</click>
						</PushButton>
						<PushButton id="PushButton4">
							<left>82px</left>
							<top>282px</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>
					</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>
