Page 1 of 1

execsystem with parameters

Posted: June 5th, 2018, 1:12 pm
by AriSilva
Is there a way to call an outside application passing a parameter?
Like
execsystem("app:com.example.jorge.meurecordatorio"); // open recordatorio
But I need to pass an identification key to this program, something like
execsystem("app:com.example.jorge.meurecordatorio, parm"); // open recordatorio

Re: execsystem with parameters

Posted: June 5th, 2018, 1:37 pm
by josh
Unfortunately that is not possible on Android.

Re: execsystem with parameters

Posted: June 6th, 2018, 9:56 am
by AriSilva
2bad.
So, if I need to pass something to another program I should write a file with a predefined name, writing the information on that file.
Now, in Android (I´m fairly new on this environment) If I want to write a file in the root, how do I set this file´s filename?
And, next, if I need to receive something back from this other program, if this program writes a file in the root, how to I access that file? I mean, can I use an absolute address, and if not, what is the relative address I should use, supposing my pff and pen files are in csentry\survey1\programs\pgm1.pen
Best
Ari

Re: execsystem with parameters

Posted: June 6th, 2018, 10:57 am
by josh
In Android this can be a bit tricky as not all parts of the filesystem are writeable/readable by every application. I'm pretty sure no app is allowed to write to the root of the filesystem (i.e. "/"). On most devices every app should be able to write to the csentry directory or it's parent directory. This is usually /mnt/sdcard/csentry. In theory it can vary from device to device although so far it has been the same on every device I've seen. In CSPro you can get the correct directory using pathname(csentry). In a Java application you can get the directory from Environment.getExternalStorageDirectory().getAbsolutePath() to get /mnt/storage and then add csentry to it.