Recent

Author Topic: [Solved] LAMW: how to add mips target?  (Read 9963 times)

turronet

  • New Member
  • *
  • Posts: 19
Re: LAMW: how to add mips target?
« Reply #15 on: October 04, 2017, 10:59:41 pm »
Hi Jmpessoa,

I found a way to get the Nogui JNI app working, simply in the new project template You left getSum and getString method unimplemented, so I got it work.
I discovered this by analyzing the demos.
so the toolchain is definitely correct, but still failiing when using GUI.
I tried to open and build a demos gui, but I'm getting invalid apk.

so .... go forward....


jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: LAMW: how to add mips target?
« Reply #16 on: October 04, 2017, 11:13:20 pm »
Quote
I tried to open and build a demos gui, but I'm getting invalid apk.

No!

Please, try first a simple "hello world" .... [like a form and a button ...]

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

turronet

  • New Member
  • *
  • Posts: 19
Re: LAMW: how to add mips target?
« Reply #17 on: October 05, 2017, 01:10:06 am »
I hope there were some unimplemented method even in GUI template....it wasn't.
Anyway got demo GUI compiled but still fc.

Do You know how to debug these apk made by fpc?

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: LAMW: how to add mips target?
« Reply #18 on: October 05, 2017, 01:48:55 am »

In Attachment,  there is my first and incomplete mips project...
but there is a "libcontrols.so"  by my experimental  mips cross-compile.

Can you complete [build apk] and test/run it ?

Thank you!

[EDITED]

apk [download] link:

https://od.lk/d/Ml8xNDczMDExMTRf/LamwGUIProjectMips1-debug.apk
« Last Edit: October 05, 2017, 02:33:49 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

turronet

  • New Member
  • *
  • Posts: 19
Re: LAMW: how to add mips target?
« Reply #19 on: October 05, 2017, 12:10:48 pm »
Many Thanks Jose!

still crash  :'(

did You use win fpc 3.0?

Code: Pascal  [Select][+][-]
  1. I/ActivityManager(  386): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.lamw.lamwguiprojectmips1/.App} from uid 1000 on display 0
  2. V/WindowManager(  386): addAppToken: AppWindowToken{13a74407 token=Token{33f6ea46 ActivityRecord{6865621 u0 org.lamw.lamwguiprojectmips1/.App t1179}}} to stack=1 task=1179 at 0
  3. I/HmHomeView(  504): onPause
  4. I/art     (15351): Late-enabling -Xcheck:jni
  5. I/ActivityManager(  386): Start proc 15351:org.lamw.lamwguiprojectmips1/u0a117 for activity org.lamw.lamwguiprojectmips1/.App
  6. I/HmLauncher-Test(  504): Set prop under watch face page. 0
  7. I/art     (  504): Background partial concurrent mark sweep GC freed 8218(438KB) AllocSpace objects, 36(2MB) LOS objects, 9% free, 19MB/21MB, paused 42.112ms total 496.466ms
  8. W/linker  (15351): libcontrols.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
  9. W/art     (15351): Can't call EnsureArtActionInFrontOfSignalChain due to unitialized fault manager
  10. F/libc    (15351): Fatal signal 10 (SIGBUS), code 128, fault addr 0x0 in tid 15351 (guiprojectmips1)
  11. I/DEBUG   (   91): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
  12. I/DEBUG   (   91): Build fingerprint: 'Huami/huanghe/watch:5.1/PACEfied/28:user/release-keys'
  13. I/DEBUG   (   91): Revision: '00000001'
  14. I/DEBUG   (   91): ABI: 'mips'
  15. I/DEBUG   (   91): pid: 15351, tid: 15351, name: guiprojectmips1  >>> org.lamw.lamwguiprojectmips1 <<<
  16. I/DEBUG   (   91): signal 10 (SIGBUS), code 128 (SI_KERNEL), fault addr 0x0
  17. I/DEBUG   (   91):  zr 00000000  at 00000001  v0 00000006  v1 7fecd048
  18. I/DEBUG   (   91):  a0 73c78ac0  a1 7fecd03c  a2 7fecd040  a3 7fecd044
  19. I/DEBUG   (   91):  t0 00000000  t1 00000101  t2 00000001  t3 00000000
  20. I/DEBUG   (   91):  t4 00000000  t5 00000000  t6 00000000  t7 00430000
  21. I/DEBUG   (   91):  s0 0000005b  s1 73c27800  s2 7fecd424  s3 00000004
  22. I/DEBUG   (   91):  s4 30ef53d8  s5 7fecd3c0  s6 7fecd3b0  s7 7fecd424
  23. I/DEBUG   (   91):  t8 73bfd5e8  t9 56aaf665  k0 00000001  k1 00000000
  24. I/DEBUG   (   91):  gp 56aff5d0  sp 7feccf98  s8 7fecd010  ra 56a65664
  25. I/DEBUG   (   91):  hi 00000000  lo 00000e20 bva 56aaf665 epc 56aaf665
  26. I/DEBUG   (   91):
  27. I/DEBUG   (   91): backtrace:
  28. I/DEBUG   (   91):     #00 pc 0006b665  /data/app/org.lamw.lamwguiprojectmips1-1/lib/mips/libcontrols.so
  29. I/DEBUG   (   91):
  30. I/DEBUG   (   91): Tombstone written to: /data/tombstones/tombstone_02
  31. I/BootReceiver(  386): Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)
  32. W/ActivityManager(  386):   Force finishing activity 1 org.lamw.lamwguiprojectmips1/.App
  33. I/Zygote  (  113): Process 15351 exited due to signal (10)
  34. W/InputMethodManagerService(  386): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@1cd1335d attribute=null, token = android.os.BinderProxy@3c72c47e
  35. W/ActivityManager(  386): Exception thrown during pause
  36. W/ActivityManager(  386): android.os.DeadObjectException
  37. W/ActivityManager(  386):       at android.os.BinderProxy.transactNative(Native Method)
  38. W/ActivityManager(  386):       at android.os.BinderProxy.transact(Binder.java:496)
  39. W/ActivityManager(  386):       at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:706)
  40. W/ActivityManager(  386):       at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:833)
  41. W/ActivityManager(  386):       at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:2738)
  42. W/ActivityManager(  386):       at com.android.server.am.ActivityStack.finishTopRunningActivityLocked(ActivityStack.java:2595)
  43. W/ActivityManager(  386):       at com.android.server.am.ActivityStackSupervisor.finishTopRunningActivityLocked(ActivityStackSupervisor.java:2497)
  44. W/ActivityManager(  386):       at com.android.server.am.ActivityManagerService.handleAppCrashLocked(ActivityManagerService.java:11504)
  45. W/ActivityManager(  386):       at com.android.server.am.ActivityManagerService.makeAppCrashingLocked(ActivityManagerService.java:11401)
  46. W/ActivityManager(  386):       at com.android.server.am.ActivityManagerService.crashApplication(ActivityManagerService.java:12085)
  47. W/ActivityManager(  386):       at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:11596)
  48. W/ActivityManager(  386):       at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
  49. E/lowmemorykiller(   83): Error opening /proc/15351/oom_score_adj; errno=2
  50. D/PowerkeyUtils(  504): clearDisablePowerKey
  51. I/Hmclc   (  504): onResume
  52. D/CompassWidgetManager(  504): on resume
  53. I/springboard(  504): plugin [com.huami.watch.compass.CompassWidgetView] onResume
  54. I/StepLauncherView(  504): onResume
  55. D/HmLauncher-Test(  504): onResume
  56. I/ActivityManager(  386): Process org.lamw.lamwguiprojectmips1 (pid 15351) has died
  57.  

I found by enabling debugging symbol that jform.show2 crashes, there is something bad when accessing to graphics as native console and console + libcontrol.so work.

Start thinking the framwork of the smartwatch have a reduced set so not everything implemented or highly customized

turronet

  • New Member
  • *
  • Posts: 19
Re: LAMW: how to add mips target?
« Reply #20 on: October 06, 2017, 10:01:48 pm »
From log:
Quote
F/art     ( 5232): art/runtime/runtime.cc:289] java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.hide()' on a null object reference
F/art     ( 5232): art/runtime/runtime.cc:289]   at void org.lamw.lamwguiproject18.jForm.HideActionBar() (Controls.java:625)
If you have some "HideActionBar()"  in your pascal code,  try to comment it....
[/quote]

MANY THANKS!!!! now it works!!!!!

by commenting the content of GetActionBarHeight() method in controls.java I got it working on mipsel smartwatch!
« Last Edit: October 06, 2017, 10:04:13 pm by turronet »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [Solved] LAMW: how to add mips target?
« Reply #21 on: October 06, 2017, 10:24:36 pm »
\o/  \o/ \o/ \o/ \o/

Congratulations!!!!

Thank you!

[EDITED 1]

Can you comment [only to test...] this code in "AndroidWidget.pas"   [line number 2754 in jForm "init" method ..]
Code: [Select]
// ActionBarHeight:= jForm_GetActionBarHeight(FjEnv, FjObject);  //comment here ...
not in " controls.java"  ?

[EDITED 2] Fixed!!!
« Last Edit: October 10, 2017, 05:25:54 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

turronet

  • New Member
  • *
  • Posts: 19
Re: [Solved] LAMW: how to add mips target?
« Reply #22 on: October 16, 2017, 11:04:54 pm »
Hi Jose,

tested Today on both win32 and ubuntu, GREAT!!! everything works fine to me.
Even the cross fpc builder works as expected

Many thanks for Your amazing work!

 

TinyPortal © 2005-2018