execsystem with parameters

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

execsystem with parameters

Post 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
Best
Ari
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: execsystem with parameters

Post by josh »

Unfortunately that is not possible on Android.
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Re: execsystem with parameters

Post 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
Best
Ari
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: execsystem with parameters

Post 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.
Post Reply