What is the API that allows me to launch any file external to the application?
iOS: Solar2D Documentation — Plugins | Activity Popup
Android:
https://solar2dmarketplace.com/plugins?AndroidShare_tech-scotth
Thanks for your answer. But I didn’t mean this. I want to be able to open a file that belongs to another application.
I think the question was misunderstood. How do I open a document from LUA. For example, I have a Readme.txt file, as would be the API for the document to open and appear at the front of the screen.
If it’s a text file, then you can display it as text object:
-- assuming test.txt is at the base of project's directory.
local file = io.open(system.pathForFile("test.txt", system.ResourceDirectory), "r")
local content = file:read("*all")
io.close(file)
local text = display.newText(content, 100,100)
Should be aware that you can only open files that exists within the project’s directory.
And in case you’re wondering, there’s no API to open a particular type of file, with the exception of loading an html file into a webView object, you’ll need to parse the data and choose a way to display it.
I think I’ve seen a PDF plugin, but it’s a plugin and not part of the standard API.
I appreciate the help, but I’m not talking about opening a text file in read or write mode. I am referring to being able to open any file from an LUA statement, but neither to read it nor to write it, simply to launch it, as if we were double-clicking on an alias of the operating system, as if it were a double-click of the mouse or a Command - O.
You can use:
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.