User Tools

Site Tools


built_in:open_file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

built_in:open_file [2015/11/30 05:21]
administrator old revision restored (2015/09/29 17:54)
built_in:open_file [2018/04/17 01:20]
Line 1: Line 1:
-=====OpenFile===== 
  
-//(Information and examples taken from the DroidScript documentation)// 
- 
-====Description==== 
- 
-The **OpenFile** method allows you to open a file with an external application on your device. The user will be prompted you to choose an appropriate App to handle the specified file type 
- 
-You can also pass null for the second parameter and the type will be automatically determined from the filename. 
- 
-<code> app.OpenFile( fileName, type, prompt );</code> 
- 
----- 
- 
-====Examples==== 
- 
-<code javascript> 
- 
-function OnStart() 
-{ 
-   app.WriteFile( "/sdcard/test.txt", "Hello" ); 
-   app.OpenFile( "/sdcard/test.txt", "text/plain", "Choose Editor" ); 
-}   
-</code> 
- 
-<code javascript> 
- 
-function OnStart() 
-{ 
-  app.OpenFile( "/sdcard/Download/doc.pdf", "application/pdf", "Open With..." ); 
-} 
- 
- 
-</code> 
built_in/open_file.txt · Last modified: 2018/04/17 01:20 (external edit)