Recent

Author Topic: Android Module Wizard  (Read 707211 times)

Mladen

  • New Member
  • *
  • Posts: 30
Re: Android Module Wizard
« Reply #795 on: April 26, 2016, 12:46:25 pm »
Hello , dont know if you guys have tried but when ever i tried to use TThread in my android application it doesn't seems to work.

Code inside TThread.Execute never gets executed. I have added
Code: Pascal  [Select][+][-]
  1. {$IFDEF UNIX}{$define UseCThreads}{$IFDEF UseCThreads}
  2.   cthreads,
  3.   {$ENDIF}{$ENDIF}
because without it the application crashes at start. While on simple desktop application it works fine.

I also use jAsyncProcesses but that too also crashes my application when executed for example in
Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule2.AndroidModule2JNIPrompt(Sender: TObject);
  2. begin  
  3. jAsyncTask1.execute;
  4. end;
And after some heavier operation for example
Code: Pascal  [Select][+][-]
  1.  for i:=0 to Length(AndroidModule1.myArray)-1 do
  2.     begin
  3.       if AndroidModule1.myArray[i].article=s then
  4.         begin
  5.           jAsyncTask1.execute;
  6.           breaK;
  7.         end;
  8.     end;

while for example when used in on jButton click event it works fine.

Cheers!


Using Lazarus 2.0.12 with FPC 3.2.2 on Linux Mint 20.2 Xfce

ThreeCat

  • New Member
  • *
  • Posts: 25
Re: Android Module Wizard
« Reply #796 on: April 26, 2016, 03:23:10 pm »
How to limit permissions of apps? for example write only access to the Internet!
« Last Edit: April 26, 2016, 03:59:52 pm by ThreeCat »

Handoko

  • Hero Member
  • *****
  • Posts: 5149
  • My goal: build my own game engine using Lazarus
Re: Android Module Wizard
« Reply #797 on: April 26, 2016, 06:50:31 pm »
Did you mean this one:

Lazarus Main Menu > Project > Project Options > Project Option Section > [Lamw] Android Manifest

There you can see lots of checkboxes to configure the permissions.

ThreeCat

  • New Member
  • *
  • Posts: 25
Re: Android Module Wizard
« Reply #798 on: April 26, 2016, 06:56:35 pm »
thanks!

ThreeCat

  • New Member
  • *
  • Posts: 25
Re: Android Module Wizard
« Reply #799 on: April 26, 2016, 09:00:09 pm »
the question of course is trivial... how to remove the header of the form?... on the phone it was not

tintinux

  • Sr. Member
  • ****
  • Posts: 325
    • Gestinux
Re: Android Module Wizard
« Reply #800 on: April 28, 2016, 06:43:15 pm »
Hi

Do you want to remove or change the title displayed on the top of the Windows ?
It is the name of the project, or of the folder.

Me too... but sorry I don't know how !

Thanks to anybody who knows !
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #801 on: April 28, 2016, 07:04:05 pm »


Yes,  the name of the project =  folder.

you can try hide  action bar:

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.DataModuleJNIPrompt(Sender: TObject);
  2. begin
  3.         Self.HideActionBar();
  4. end;
  5.  

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

Handoko

  • Hero Member
  • *****
  • Posts: 5149
  • My goal: build my own game engine using Lazarus
Re: Android Module Wizard
« Reply #802 on: April 28, 2016, 07:16:11 pm »
It also can be changed to something else.

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);
  2. begin
  3.   SetTitleActionBar('Hello');
  4. end;

Although it works, but doesn't look good. I can see the 'original' title before it switches to the new name.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #803 on: April 30, 2016, 08:01:01 am »

Hello All!

There is a new LAMW revision!

https://github.com/jmpessoa/lazandroidmodulewizard

Version 0.6 - rev. 38.9 - 30 April 2016 -

   NEW! Component jAutoTextView

   NEW! jForm propertie and Event:
      ActionBarTitle = (abtDefault,
                                  abtTextAsTitle,      // Get Text property content as Title!
                                  abtTextAsTitleHideLogo,
                                  abtHideLogo,
                                  abtHide)          //<<-- Thanks to Handoko's bug

      OnSpecialKeyDown  // <<---- Thanks to Handoko's suggestion [but, not for Home and Overview, yet. Sorry...]

   NEW! Demo AppAutoCompleteTextViewDemo1

Thanks to All
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

ketch

  • New member
  • *
  • Posts: 8
Re: Android Module Wizard
« Reply #804 on: April 30, 2016, 08:11:12 pm »
Hi all,

First i want to say that i have discover LAMW recently and i think it is a great solution for Android development with freepascal and lazarus. You have done an amazing work!!!!

I started an application using jCanvasES1. I need to input keyboard entry in the jCanvasES1.
When i touch the JCanvasES1, i can show the keyboard with the instruction ToggleSoftInput but how can i receive the pressed key in jCanvasES1, there is no event for that...

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #805 on: May 01, 2016, 07:09:37 am »

Hello tintinux!

I got fix the "AppCameraDemo" !!

Hello  ketch!

what keys you need?  jForm,  now have "OnSpecialKeyDown"  event ...
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

ketch

  • New member
  • *
  • Posts: 8
Re: Android Module Wizard
« Reply #806 on: May 01, 2016, 12:20:10 pm »
Hello jmpessoa!

I render a text editor in jCanvasES1. I need to get what the user press on the soft keyboard.
I have give a try to OnSpecialKeyDown like this:

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.jCanvasES1_1GLDown(Sender: TObject; Touch: TMouch);
  2. begin
  3.   AndroidModule1.ToggleSoftInput();
  4. end;
  5.  
  6. procedure TAndroidModule1.AndroidModule1SpecialKeyDown(Sender: TObject;
  7.   keyChar: char; keyCode: integer; keyCodeString: string; var mute: boolean);
  8. begin
  9.   ShowMessage('SpecialKeyDown fired');
  10. end;

I press on the jCanvasES1 for show the soft keyboard, then i press some key on the soft keyboard but the SpecialKeyDown even is not fire (the message is never display)...

Maybe i do something wrong...

In addition, i want to have more than one jCanvasES1 with text editor on the screen, i need to get the input only in the one who is focused.
« Last Edit: May 01, 2016, 01:05:33 pm by ketch »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #807 on: May 01, 2016, 07:57:20 pm »

Ok ketch!

Please, go to "App.java" [...\src\...] and  uncomment "default"

Quote
@Override
   public boolean onKeyDown(int keyCode, KeyEvent event) {
      switch(keyCode) {
        .......................................
         .......................
        //default: controls.jAppOnKeyDown(c,keyCode,KeyEvent.keyCodeToString(keyCode));           
      }
     .......................
   }       

In pascal side

try:

ShowMessage(keyCodeString);
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

ketch

  • New member
  • *
  • Posts: 8
Re: Android Module Wizard
« Reply #808 on: May 02, 2016, 01:55:57 am »
Hello jmpessoa!

Thank you very much !!!! This modification is what i need.

Why is this code line disable in App.java ?

Handoko

  • Hero Member
  • *****
  • Posts: 5149
  • My goal: build my own game engine using Lazarus
Re: Android Module Wizard
« Reply #809 on: May 02, 2016, 05:35:42 pm »
Hello. I found somethings not working correctly, hope it can be fixed on next release.

1. Can't build FPC 3.1.1 + Lazarus 1.6

I followed the instruction "new_how_to_install_by_renabor.txt" and succeed to install FPC 3.1.1 + Lazarus 1.5 + LAMW. That's great, I was very happy. So I remove all of them and perform a clean installation of FPC 3.1.1 + Lazarus 1.6, but I failed when building Lazarus. Now, I ended with FPC 3.0.0 + Lazarus 1.6 that I installed using deb packages downloaded from SourceForge.

Can someone tell me, FPC 3.1.1 can't be combined with Lazarus 1.6? Or is there anything wrong in the instruction manual?

2. LAMW doesn't accept short version of home folder name

My home folder is "/home/handoko/"
It can be shortened as "~/"

I installed following the installation instruction but I replaced all the "/home/handoko/" with "~/". Nothing went wrong. So, somebody please update the installation guide (to use short version home name).

Unfortunately, LAMW doesn't accept short version of home folder name. If I use the short version name on LAMW configuration form, I'll get error. Please see the attached image.

3. Missing NDK 11c on the configuration form

I use NDK version 11c, but there is no such option on the path setting. Please see the attached image. Strange thing is, everything seems working correctly although I choose 10c but actually I have 11c installed. Why?

4. What is Linux-x8664?

Is it a typing mistake? Please see the attached image.

5. Items on the Ndk Platform listbox aren't properly sorted

It should be 14, 15, 17, 21 ... Please see the attached image.

6. Can't cross build on Linux

I'm sure my Linux make tool is in "/usr/bin" folder. But it said cannot run extern [make] tool.
« Last Edit: May 02, 2016, 06:54:22 pm by Handoko »

 

TinyPortal © 2005-2018