Hi, a query I want to open a text file.
For example I want to open "lista.txt"
I've tried this:
Dir_existe02 = pathname (Application) + "Lists \" + "listing.txt";
1. execsystem (maketext ("app: com.example.android.notepad"));
2. execsystem (maketext ("app% s", dir_existe02));
Trying to execute the "1" was not executed and therefore neither the "2".
Open a text file with notepad on android
Re: Open a text file with notepad on android
When you use app: with execsystem there is no way to specify an argument. It will only launch the application. Instead you can use view: with the name of the file. Then, based on the extension of the file, Android will launch the appropriate to view that type of file (kind of like when you double click on a file in Windows). So if you have notepad installed and it knows how to open .txt files then when you use execsystem with view it will launch the file in notepad or if there are multiple programs on your Android device that know how to open .txt files it will ask you which one you want to use and you can choose notepad.
The code would be:
execsystem(maketext("view:%s", dir_existe02));
The code would be:
execsystem(maketext("view:%s", dir_existe02));
Re: Open a text file with notepad on android
Is it possible to run (.bat) files in Cspro? when I write out the logic to run it opens file explorer in Windows rather than executed the .bat file.
-
- Posts: 1792
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Open a text file with notepad on android
You can run batch applications (on Windows). I've used this code to run a batch application:
execsystem(maketext('"%sCreate Deployment.bat"',pathname(Application)),wait);
I would look into whether your DOS batch file is written properly. If you double-click on it in Explorer, does it run properly?Re: Open a text file with notepad on android
It usually opens Windows explorer when the path or filename of the bat file you are launching is incorrect. I bet that you don't have the filename or path correct in your call to execsystem.