[fpc-pascal] FPC programs in Android without JNI

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Mon Dec 6 14:42:58 CET 2010


Hello,

There was already a previous thread about Android apps with JNI, so I
thought I should start one for discussing non-JNI apps, which means
that I am really running executables as opposed to linking a .so to
Java via JNI.

I succeeded in running a simple FPC Pascal application in Android and
showing it's WriteLn output in a message dialog:

http://p-tools.svn.sourceforge.net/viewvc/p-tools/PascalNotes4Android/?pathrev=190

Basically you need to rename your app so that it looks like a .so and
then upon initialization the Java app needs to copy it to a folder
where it can run the application. The folder is returned by
getApplicationContext().getFilesDir which points to
/data/data/packagename/ and then I use chmod to make the executable
runnable.

I don't know how it will fare for apps running for prolonged amounts
of time at the moment, some Android developers said it is possible
that it won't work.

The Pascal app needs to be compiled separately and placed in the
lib/eabi folder. Then after that issue "ant debug" to build the APK
installer.

bye,
-- 
Felipe Monteiro de Carvalho



More information about the fpc-pascal mailing list