New Version LazToApk v0.9.0.36 is available
lazarus / 43-Android
----------------------------------------------------------------------
DelphiFreak · 2015-10-06 20:29
Hello Forum,
I have updated laztoapk.
***** IF YOU HAVE A WORKING SETUP, THEN THERE IS NO NEED TO INSTALL
0.9.0.36! ***
This version only contains some more trace-messages. It might help
some folks to find out what's wrong with their setup.
Changes: please see here: http://sourceforge.net/p/laztoapk/svn/HEAD/t
ree/trunk/install/Changes.txt
Files are here at sourceforge.net. PLEASE,PLEASE READ THE PDF-
INSTRUCTIONS!!
http://sourceforge.net/projects/laztoapk/files/?source=navbar
Regards,
Sam
What is LazToApk?
To build a piece of software which can be installed on an arm-android
device, you need Java JDK, Android SDK, Android NDK and laz4android.
LazToApk is a software which will help you to download and configure
all these needed 3rd-Party Tools.
LazToApk creates&executes the batch-files to build,sign and package
the final apk-file.
----------------------------------------------------------------------
eggy · 2015-11-28 03:51
I am new to Lazarus and all else related to it. I have downloaded
laz4android1.4.4-FPC3.0.0RC2.exe and installed it. I am not clear if I
need Laz2apk, if I already have installed Jave JDK, Android SDK,
Android NDK, NDK tools from before I ever installed anything of
Lazarus. Can you please clarify? Also, can I develop Win32 apps with
Laz4android, or do I need to download another setup for this? Thanks!
----------------------------------------------------------------------
DelphiFreak · 2015-11-28 05:29
Hello eggy,
welcome to the lazarus world.
First of all, laztoapk is not really needed, but should help you to
setup the whole toolchain correctly.
1.) laztoapk contains a prepared lazarus project-template. ( because
compiler settings and project paths must be setup correctly for
android)
2.) laztoapk prepares the batch-files "build_app.bat","build_debug_apk
.bat","generate_debug_key.bat","adb_install.bat".
Note1: laztoapk works only on windows platforms.
Note2: In my last conversation with the maintainer of laz4android, he
told my that is waiting for the final release of FPC 3.0. Then he will
build a new release of laz4android and after that I will build a new
release of laztoapk. So if you don't get things working, you may want
to wait a week until new versions are available, because FPC 3.0 was
just released on the 25.Nov.
----------------------------------------------------------------------
Deepaak · 2015-11-28 05:43
binary build with Lazarus for android using this tool is native or
java executable which is deployed in android.
----------------------------------------------------------------------
eggy · 2015-11-28 10:36
I am still confused, since the laz4android I downloaded is named:
laz4android1.4.4-FPC3.0.0RC2.exe, so it appears to be using
FPC3.0.0RC2 already, and Lazarus 1.4.4.
Another complication is that I have the NVIDIA CodeWorks for Android
installed, so my Android SDK, NDK and other stuff paths are in
C:\NVPACK. When I start laz4android, it opens up a default project and
compiles it without error, but that is with target set to 'default',
so I am assuming it is only Windows. When I switch to 'Android' for
target, all hell breaks loose. I am assuming it is a path issue, and
the batch files you mention might help me resolve that. I can build
Android apps from MS Visual Studio with the NVIDIA Tegra plugin
already, so I know my toolchain is good. I am just new to Lazarus. I
did take Pascal (Turbo Pascal) back in univeristy in 1984!
Thanks for your help.
----------------------------------------------------------------------
eggy · 2015-11-28 10:49
One more question: Is laz4android also good as my standard lazarus
install to develop Windows apps too? It seems to be, but I don't want
to have to download another package if I don't have to. Thanks!
----------------------------------------------------------------------
DelphiFreak · 2015-12-08 12:32
New Version 0.9.0.34 is available for download at sourceforge.net
07.Dezember 2015 (v0.9.0.34)
- updated to download laz4android1.4.4-FPC3.0.0.7z
- fixed uggly bug. Button "Step1: Select/Create Project Folder" on
tabsheet "manual" did always reset/overwrite an existing project.
- some source clean-up.
- more fixes and rework for the tabsheet "manual".
- added button to edit the project.
----------------------------------------------------------------------
dieselnutjob · 2015-12-23 11:24
Hello Sam,
I have successfully compiled the example project1.apk.
I am using Windows 7 64 bit, but I installed jdk 32 bit as it says in
your instuctions.
The project1.apk will run on my Android 4.4 phone, but it will not run
on my Android 5.1.1 phone.
if says here
http://forum.lazarus.freepascal.org/index.php/topic,30546.0.html
that we need "-k-pie" compiler options for Android 5
Please can you tell me how do I configure compiler options with
laztoapk?
thanks
----------------------------------------------------------------------
dieselnutjob · 2015-12-23 11:41
I have modified the file
C:\laztoapk\downloads\laz4android\fpc\3.0.0\bin\i386-win32\fpc.cfg
I added the line
-k-pie
When I run the application on Android 5.1.1 I am still getting
"Unfortunately, Project1 has stopped"
----------------------------------------------------------------------
dieselnutjob · 2015-12-23 18:21
comparison of adb logcat output:-
Android 5 (not working):-
I think that the problem is line 4 " No implementation found for int
com.pascal.project2.LCLActivity.LCLOnCreate(android.app.Activity)"?
Code: [Select]I/ActivityManager(24707): Start proc com.pascal.project2
for activity com.pascal.project2/.LCLActivity: pid=7179 uid=10518
gids={50518, 9997, 3003, 1028, 1015} abi=armeabi
I/art ( 7179): Late-enabling -Xcheck:jni
I/lclapp ( 7179): Trying to load liblclapp.so
W/linker ( 7179): liblclapp.so has text relocations. This is wasting
memory and prevents security hardening. Please fix.
E/art ( 7179): No implementation found for int
com.pascal.project2.LCLActivity.LCLOnCreate(android.app.Activity)
(tried Java_com_pascal_project2_LCLActivity_LCLOnCreate and Java_com_p
ascal_project2_LCLActivity_LCLOnCreate__Landroid_app_Activity_2)
D/AndroidRuntime( 7179): Shutting down VM
E/AndroidRuntime( 7179): FATAL EXCEPTION: main
E/AndroidRuntime( 7179): Process: com.pascal.project2, PID: 7179
E/AndroidRuntime( 7179): java.lang.UnsatisfiedLinkError: No
implementation found for int
com.pascal.project2.LCLActivity.LCLOnCreate(android.app.Activity)
(tried Java_com_pascal_project2_LCLActivity_LCLOnCreate and Java_com_p
ascal_project2_LCLActivity_LCLOnCreate__Landroid_app_Activity_2)
E/AndroidRuntime( 7179): at
com.pascal.project2.LCLActivity.LCLOnCreate(Native Method)
E/AndroidRuntime( 7179): at
com.pascal.project2.LCLActivity.onCreate(LCLActivity.java:246)
E/AndroidRuntime( 7179): at
android.app.Activity.performCreate(Activity.java:5933)
E/AndroidRuntime( 7179): at android.app.Instrumentation.callAct
ivityOnCreate(Instrumentation.java:1105)
E/AndroidRuntime( 7179): at android.app.ActivityThread.performL
aunchActivity(ActivityThread.java:2251)
E/AndroidRuntime( 7179): at android.app.ActivityThread.handleLa
unchActivity(ActivityThread.java:2360)
E/AndroidRuntime( 7179): at
android.app.ActivityThread.access$800(ActivityThread.java:144)
E/AndroidRuntime( 7179): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
E/AndroidRuntime( 7179): at
android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 7179): at
android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 7179): at
android.app.ActivityThread.main(ActivityThread.java:5221)
E/AndroidRuntime( 7179): at
java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 7179): at
java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 7179): at com.android.internal.os.ZygoteInit$
MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime( 7179): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
I/Process ( 7179): Sending signal. PID: 7179 SIG: 9
I/ActivityManager(24707): Process com.pascal.project2 (pid 7179) has
died
Android 4.4 (works):-
Code: [Select]I/Timeline( 896): Timeline: Activity_launch_request
id:com.pascal.project2 time:14675263
I/ActivityManager( 556): START u0 {act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10200000
cmp=com.pascal.project2/.LCLActivity} from pid 896
I/UsageStats( 556): Deleting usage file : usage-20151102
V/Zygote ( 5754): Switching descriptor 32 to /dev/null
V/Zygote ( 5754): Switching descriptor 9 to /dev/null
D/dalvikvm( 5754): Late-enabling CheckJNI
I/ActivityManager( 556): Start proc com.pascal.project2 for activity
com.pascal.project2/.LCLActivity: pid=5754 uid=10063 gids={50063,
3003, 1028, 1015, 1023}
I/dalvikvm( 5754): Enabling JNI app bug workarounds for target SDK
version 8...
V/PhoneStatusBar( 674): setLightsOn(true)
I/lclapp ( 5754): Trying to load liblclapp.so
D/dalvikvm( 5754): Trying to load lib /data/app-
lib/com.pascal.project2-1/liblclapp.so 0x41e41190
D/dalvikvm( 5754): Added shared lib /data/app-
lib/com.pascal.project2-1/liblclapp.so 0x41e41190
I/lclapp ( 5754): JNI_OnLoad called
I/lclapp ( 5754): Reading our Activity Class
I/lclapp ( 5754): JNI_OnLoad finished
I/lclapp ( 5754): LCLOnCreate called by LCLActivity.onCreate
I/lclapp ( 5754): [TCDWSCustomForm.ShowHide] First form layout
adjustment lOldDPI=96 lNewDPI=213 lOldFormWidth=253 lNewFormWidth=100
D/libEGL ( 5754): loaded /system/lib/egl/libEGL_tegra.so
E/ ( 5754): file
/data/data/com.nvidia.NvCPLSvc/files/driverlist.txt: not found!
I/ ( 5754): Attempting to load EGL implementation
/system/lib//egl/libEGL_tegra_impl
I/ ( 5754): Loaded EGL implementation
/system/lib//egl/libEGL_tegra_impl
D/libEGL ( 5754): loaded /system/lib/egl/libGLESv1_CM_tegra.so
D/libEGL ( 5754): loaded /system/lib/egl/libGLESv2_tegra.so
I/ ( 5754): Loading GLESv2 implementation
/system/lib//egl/libGLESv2_tegra_impl
D/OpenGLRenderer( 5754): Enabling debug mode 0
I/lclapp ( 5754): [LCLOnConfigurationChanged] i=0 lOldDPI=213
lNewDPI=213 lOldFormWidth=100 lNewFormWidth=720
I/Timeline( 5754): Timeline: Activity_idle id:
android.os.BinderProxy@41e3cc00 time:14675822
I/ActivityManager( 556): Displayed com.pascal.project2/.LCLActivity:
+470ms
I/Timeline( 556): Timeline: Activity_windows_visible id:
ActivityRecord{41f1ae48 u0 com.pascal.project2/.LCLActivity t6}
time:14675832
I/healthd ( 138): battery l=30 v=3 t=20.3 h=2 st=2 chg=u
I/lclapp ( 5754): [TCDWidgetSet.AppTerminate] Start
I/AndroidRuntime( 5754): VM exiting with result code 0, cleanup
skipped.
I/ActivityManager( 556): Process com.pascal.project2 (pid 5754) has
died.
I/WindowState( 556): WIN DEATH: Window{41fe7518 u0
com.pascal.project2/com.pascal.project2.LCLActivity}
W/ActivityManager( 556): Force removing ActivityRecord{41f1ae48 u0
com.pascal.project2/.LCLActivity t6}: app died, no saved state
W/InputMethodWrapper( 783): Incoming session is null
W/InputMethodManagerService( 556): Got RemoteException sending
setActive(false) notification to pid 5754 uid 10063
I/Timeline( 896): Timeline: Activity_idle id:
android.os.BinderProxy@41e3cb90 time:14678395
I/Timeline( 556): Timeline: Activity_windows_visible id:
ActivityRecord{42189ba8 u0 com.slim.slimlauncher/.Launcher t1}
time:14678694
----------------------------------------------------------------------
tomkemp · 2015-12-31 10:25
Hi,
I have exactly the same problem. I can't run lcl Android applications
on Android 5, 5.1 etc. I tried compile code on Windows and Linux. I
don't have any idea why it doesn't work.
-k-pie option causes that application closing with "Unfortunately,
Project1 has stopped" message, without that option application close
without any information.
I found that with -k-pie option on Android 2.2 ( old Samsung device )
running application is not possible.
Anybody run with success LCL application on Android 5 ?
----------------------------------------------------------------------
CrayfishDTim · 2016-02-15 13:50
Same Probleme here =/ somebody please help us
----------------------------------------------------------------------
Handoko · 2016-02-15 15:07
@tomkemp, @CrayfishDTim
Are you running the apk on Intel-based Android devices? AFAIK,
LazToApk still can't generate codes for Intel-based machines properly.
It's still on the early stage, most of the efforts are focus on ARM
devices.
----------------------------------------------------------------------
DelphiFreak · 2016-02-15 19:24
Hi,
if you want to try laztoapk with intel stuff, then we need to change
some things.
You could help me to do that, because I have not much time.
So if you have time, then look at this code:
Line 977: https://sourceforge.net/p/laztoapk/svn/HEAD/tree/trunk/sour
ce/apkmanagermain.pas
The method Code: Pascal [Select][+][-]window.onload = function(){var
x1 = document.getElementById("main_content_section"); if (x1) { var x
= document.getElementsByClassName("geshi");for (var i = 0; i function
TfrmApkManager.CopyNDKFilesToFPC: boolean; copies the arm- files to
the fpc folder.
So if you want to use intel stuff, this probably would need to copy
the intel-files from ndk to fpc folder.
Then you would need to adjust the files in
C:\laztoapk\TemplateProject. e.g. if you look at file
templatemain.pas you see $ifdef CPUARM}
You must also analyze the other files: see templateandroid.lpi line
90: -->
And so on. Sorry I have not time at the moment but if you get it
working I will update laztoapk so you could select CPU.
Thank you,
Sam
----------------------------------------------------------------------
CrayfishDTim · 2016-02-16 09:02
but i have a S5 with ARMv7
on s4 everything works fine
----------------------------------------------------------------------
DelphiFreak · 2016-02-16 16:53
Did you try to change in your project options to 7
your project.lpi file -->
----------------------------------------------------------------------
tomkemp · 2016-02-16 21:07
Hi,
I have tried to run my code without success on:
- LG G3 ( stock Android 5.1 )
- Samsung Note 4 ( stock Android 5.1 )
- HTC desire 820 ( stock Android 5.0.2 )
I can run my application on:
- Samsung Galaxy S3 ( Android 4.3 )
- Samsung Galaxy Mini ( Android 2.3 )
All phones from my list are ARM compatible not Intel. I am not sure if
I tried ARMv7 option. I can check it.
----------------------------------------------------------------------
CrayfishDTim · 2016-02-17 12:19
Quote from: DelphiFreak on February 16, 2016, 05:53:54 pmDid you try
to change in your project options to 7
your project.lpi file -->
Yes i changed that =/
on s5 with android 4.4 everything works fine.
i tried that -k-pie linker option too
----------------------------------------------------------------------
tomkemp · 2016-02-17 14:28
@CrayfishDTim
so your conclusion is that S5 with Android 4.4 works fine with 5.x not
?
I am asking to be sure, because I have the same feeling that something
is wrong with running applications on Android 5.x.
I think It is not a problem with laztoapk, it is general issue with
Lazarus CustomDrawn applications and Android 5.x.
----------------------------------------------------------------------
CrayfishDTim · 2016-02-17 15:51
Quote from: tomkemp on February 17, 2016, 03:28:04 pm@CrayfishDTim
so your conclusion is that S5 with Android 4.4 works fine with 5.x not
?
yeah thats exactly my problem
the app is just closing
----------------------------------------------------------------------
engkin · 2016-02-17 16:20
Quote from: dieselnutjob on December 23, 2015, 07:21:01 pmAndroid 5
(not working):-
I think that the problem is line 4 " No implementation found for int
com.pascal.project2.LCLActivity.LCLOnCreate(android.app.Activity)"?
Because liblclapp.so, which contains LCLOnCreate, was not loaded:
Code: [Select]W/linker ( 7179): liblclapp.so has text relocations.
This is wasting memory and prevents security hardening. Please fix.
Just curious, what FPC version are you using?
You might want to read the update on this post AND this thread. Notice
that they both are about Android 6, I believe it should work on
Android 5 as well.
----------------------------------------------------------------------
DelphiFreak · 2016-02-17 17:33
Hi all,
laztoapk 0.9.0.34 uses laz4android1.4.4-FPC3.0.0.7z.
laztoapk 0.9.0.33 used laz4android1.5-49903-FPC3.1.1.7z
So if you want to try if FPC3.1.1 works to compile for Android 5.x,
feel free and download laz4android from here:
laz4android1.5-49903-FPC3.1.1.7z
There are so many factor's that play into this, one person can not
manage this all.
I tried to start a wiki table so people could contribute there
successful combinations. https://sourceforge.net/p/laztoapk/wiki/Home/
Now I see that I should also have added a column to keep track on the
laz4android version.
Sam
----------------------------------------------------------------------
tomkemp · 2016-02-17 20:00
First of all I completely agree it is not possible to check everything
by one person. It is too many variants of Smartphones and Android
versions.
I tried laz4android 1.5 revisions 49903 and 50093. In both cases
application lclandroidtest still doesn't work on Android 5.x.
What I observe was:
- I didn't get this message:
Quoteliblclapp.so has text relocations. This is wasting memory and
prevents security hardening. Please fix.
- after adding -k-pie option I got message:
QuoteE/AndroidRuntime(29846): java.lang.UnsatisfiedLinkError: No
implementation found for int
com.pascal.lcltest.LCLActivity.LCLOnCreate(android.app.Activity)
(tried Java_com_pascal_lcltest_LCLActivity_LCLOnCreate and Java_com_pa
scal_lcltest_LCLActivity_LCLOnCreate__Landroid_app_Activity_2)
Long story short still doesn't work. I think the best way is to switch
to LOGO language ;-)
----------------------------------------------------------------------
engkin · 2016-02-17 20:29
Quote from: tomkemp on February 16, 2016, 10:07:41 pmI have tried to
run my code without success on:
- LG G3 ( stock Android 5.1 )
- Samsung Note 4 ( stock Android 5.1 )
- HTC desire 820 ( stock Android 5.0.2 )
-LG G3 has Krait 400 ( ARMv7-A )
-Samsung Note 4 either:
- Krait 450 ( ARMv7-A )
- Cortex-A53 or Cortex-A57 ( ARMv8-A )
-HTC desire 820 has Cortex-A53 ( ARMv7-A )
----------------------------------------------------------------------
tomkemp · 2016-02-18 19:32
You have right, but I think it is not a reason of our problems.
@CrayfishDTim tried his application on s5 with 4.4 and 5.x Android. On
4.4 it works fine on 5.x not. Conclusion is simple lazarus customdrawn
( lcl ) applications doesn't work on Android 5.x