does laz4android support BeginThread( ) this function? lazarus / 43-Android ---------------------------------------------------------------------- greenzyzyzy · 2014-09-04 08:05 does laz4android support BeginThread( ) this function? ---------------------------------------------------------------------- greenzyzyzy · 2014-09-12 10:11 laz4android no idea to use MultiThread? i just test BeginThread this function,when call it ,program quit immediately. ---------------------------------------------------------------------- greenzyzyzy · 2014-09-14 08:39 well,i have search the web ,it have a way to use thread, that is use 'pthread_create' this function,if want to use jni in thread maybe need use some other functions. ---------------------------------------------------------------------- Leledumbo · 2014-09-14 10:25 I don't know whether BeginThread works there (you did have CThreads in your program's uses clause, don't you?), but I use jmpessoa's Android Module Wizard and it has jAsyncProcess which works just fine for multithreading. Certainly the thread handling is different. ---------------------------------------------------------------------- greenzyzyzy · 2014-09-14 12:29 BeginThread can not work,and  jmpessoa's Android Module Wizard need to use eclipse? ---------------------------------------------------------------------- Leledumbo · 2014-09-14 12:46 Quote from: greenzyzyzy on September 14, 2014, 02:29:51 pmjmpessoa's Android Module Wizard need to use eclipse? No. I don't use Eclipse at all, only Ant. ---------------------------------------------------------------------- felipemdc · 2014-09-14 12:51 It supports only what is supported in JNI libraries, see the list here: http://wiki.freepascal.org/Custom_Drawn_Interface/Android#NDK_Librarie s_available_in_Android_2.2_.28API_level_8.29 I don't know in which library exacty "cthreads" unit links to... Well, there do is in the list above the library "libthread_db" which is debug info for pthreads, so I guess that pthreads is supported in JNI, probably in the unit libc.so One would need to modify cthreads unit to link to this library. I have an Android application written in (mostly) Pascal, but my Pascal code is single-threaded ... ---------------------------------------------------------------------- greenzyzyzy · 2014-09-14 12:59 yes,i just use "pthread_create" this function.it can works,it is in the "libc.so",just found it from web. and Lazarus Android Module Wizard  how to use?i see it use eclipse in the manual. ---------------------------------------------------------------------- Leledumbo · 2014-09-14 13:28 QuoteLazarus Android Module Wizard  how to use?i see it use eclipse in the manualRead carefully. It CAN use Eclipse, but it's not a REQUIREMENT. What Eclipse does is only automating the call to Android SDK tools (google even has an IDE-less tutorial), and that's just one or two commands, with one done only once (to create the project structure). The other is simply building the project, which you can do with Ant. Simply by copying build.xml from ant demo and modify it to your project (or Eclipse demo), you can build everything without ever needing to install Eclipse. ---------------------------------------------------------------------- greenzyzyzy · 2014-09-14 13:35 i am a newer,sorry ,i do not know what is ant. is it android sdk tool or java tool? ---------------------------------------------------------------------- Mike.Cornflake · 2014-09-14 13:43 https://www.google.com.au/search?q=ant http://ant.apache.org/ Very powerful utility that one, seen it configured to do some amazing stuff.  At the time it struck me as steep learning curve is required to create a new project.  Editing an existing one (as per leledumbo's suggestion) should be easy enough though. ---------------------------------------------------------------------- greenzyzyzy · 2014-09-14 13:46 thanks all, i will get some time to learn it. ---------------------------------------------------------------------- greenzyzyzy · 2014-09-14 14:06 ask a new question, is Lazarus Android Module Wizard call android functions still need to use JNI functions to call them? ---------------------------------------------------------------------- Leledumbo · 2014-09-14 14:11 Quote from: greenzyzyzy on September 14, 2014, 04:06:04 pmask a new question, is Lazarus Android Module Wizard call android functions still need to use JNI functions to call them? better a new thread but yes, it uses JNI to wrap calls to Android library (well, that seems to be the only way to go). ---------------------------------------------------------------------- greenzyzyzy · 2014-09-14 14:21 if i want to call other Android functions in "Lazarus Android Module Wizard" program, still need JNI functions? ---------------------------------------------------------------------- Leledumbo · 2014-09-14 14:34 Quote from: greenzyzyzy on September 14, 2014, 04:21:37 pmif i want to call other Android functions in "Lazarus Android Module Wizard" program, still need JNI functions? Certainly, unless the function resides in a system (non-Java) library. ---------------------------------------------------------------------- greenzyzyzy · 2014-09-14 14:38 Quote from: Leledumbo on September 14, 2014, 04:34:46 pmQuote from: greenzyzyzy on September 14, 2014, 04:21:37 pmif i want to call other Android functions in "Lazarus Android Module Wizard" program, still need JNI functions? Certainly, unless the function resides in a system (non-Java) library. en,it is still hard to call Android functions.ah,i have install Lazarus Android Module Wizard.but why it is no GUI lcl? ---------------------------------------------------------------------- jmpessoa · 2014-09-14 16:45 Hi greenzyzyzy! Q1. Quote....still hard to call Android functions.... What android function or object you need access? I can try to implement them.... Q2. Quote....but why it is no GUI lcl? Lazarus Android Module Wizard Components are just FCL/JNI .... Soon we will have a form designer! Thank you! ---------------------------------------------------------------------- felipemdc · 2014-09-14 17:28 Quote from: greenzyzyzy on September 14, 2014, 03:46:27 pmthanks all, i will get some time to learn it. There is no need to learn about ant. All you need to do is: 1> Install ant which is very easy in Linux (apt-get install ant or whatever similar). In Windows it is hard so I simply gave up, and I build my Android project only in Linux since I added dependency to the latest AdMob SDK which is hard to include in the project manually (manually = without ant) 2> To build your project write in the Linux command line: cd myproject/android ant debug If you have a proper set of files it will generate a APK package in the myproject/android/bin directory. If not it will throw an error. or to make a release build: ant release For ant release to work you need to setup in one of the .properties files the path to your key. You don't need to learn anything else about ant. Or at least I haven't learned and I don't regret =) Less brain space wasted in learning yet another build system. You do need to learn how to modify all those project files like the manifest file, the .properties files, etc, etc. Google helped me here in every case. ---------------------------------------------------------------------- greenzyzyzy · 2014-09-15 01:56 thanks all. ---------------------------------------------------------------------- greenzyzyzy · 2014-09-15 03:58 Quote from: Leledumbo on September 14, 2014, 12:25:57 pmI don't know whether BeginThread works there (you did have CThreads in your program's uses clause, don't you?), but I use jmpessoa's Android Module Wizard and it has jAsyncProcess which works just fine for multithreading. Certainly the thread handling is different. it is does not have jAsyncProcess,only have jAsyncTask. right? ---------------------------------------------------------------------- Leledumbo · 2014-09-15 15:33 Quote from: greenzyzyzy on September 15, 2014, 05:58:25 amQuote from: Leledumbo on September 14, 2014, 12:25:57 pmI don't know whether BeginThread works there (you did have CThreads in your program's uses clause, don't you?), but I use jmpessoa's Android Module Wizard and it has jAsyncProcess which works just fine for multithreading. Certainly the thread handling is different. it is does not have jAsyncProcess,only have jAsyncTask. right? Ah yes, sorry for the name. ---------------------------------------------------------------------- greenzyzyzy · 2014-09-17 10:47 Quote from: jmpessoa on September 14, 2014, 06:45:48 pm Hi greenzyzyzy! Q1. Quote....still hard to call Android functions.... What android function or object you need access? I can try to implement them.... Q2. Quote....but why it is no GUI lcl? Lazarus Android Module Wizard Components are just FCL/JNI .... Soon we will have a form designer! Thank you! when will have form designer?is it in this year? ---------------------------------------------------------------------- Daniello · 2014-09-30 17:02 Hi, just a comment about multithreading in Android. Normal fpc threads work in Android if you add cthreads as the first unit of the whole project. But this requires FPC built from trunk, older versions had a bug and just crash.