Recent

Author Topic: what do you fell about xe5 or lazarus for android?  (Read 4024 times)

halflifezy

  • Jr. Member
  • **
  • Posts: 61
what do you fell about xe5 or lazarus for android?
« on: October 10, 2013, 04:27:00 pm »
xe5 comes out for few days.but i am very disappoint with it.
because too much units for android is not have.
i think lazarus is the right choose.just wait it.what do you think about it? ::)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: what do you fell about xe5 or lazarus for android?
« Reply #1 on: October 10, 2013, 05:20:40 pm »
Android part for LCL is far from complete, but already usable for some small apps. I don't think it's production ready anyway. There are native android controls package (not in lazarus package format) made by a chinese Lazarus programmer (search the android subforum), but I haven't really used it, just testing the example. It has no form designer, so you have to code everything by hand. It's somewhat more complete than LCL Custom Drawn for Android, though. The tightest Android implementation is the FPC JVM, which has full access to all Android libraries and the bindings can be updated with javapp app. It's also pure code at the moment and has slightly different supported syntax than regular Object Pascal, specially designed to interface with Java.

qoxop

  • New Member
  • *
  • Posts: 33
Re: what do you fell about xe5 or lazarus for android?
« Reply #2 on: December 18, 2013, 11:35:11 am »
I tried XE5 for a few days to see how the android stuff works there. Basically it works, but I found it is not for me. It is not done through VCL, but by Firemonkey. The finall app is too big for me (about 10 MB with database).
In a past I created some apps in Eclipse, now in InteliJIdea. For me it is the best tool for android. The main problem is, it is not pascal  :D I see a big potential in FPC for JVM. Because native for android is JAVA. But as Leledumbo said, You have to code just like  in JAVA. Especially User interface. Maybe some special components wich will wrap all necesary "java" code could be done. And then it could be very usefull.
I have not tried LCL, But as other users said, it is not ready for too compelx apps yet.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2302
Re: what do you fell about xe5 or lazarus for android?
« Reply #3 on: December 18, 2013, 03:33:14 pm »
Well, You can try "Lazarus Android Module Wizard"

https://github.com/jmpessoa/lazandroidmodulewizard....

follows some images and code for simple curiosity ... and the component palette page "Android Bridges"

*.lfm

Code: [Select]
object AndroidModule1: TAndroidModule1
  OnCreate = DataModuleCreate
  OldCreateOrder = False
  BackButton = False
  Title = 'jForm'
  BackgroundColor = colbrBlack
  OnJNIPrompt = DataModuleJNIPrompt
  Height = 150
  HorizontalOffset = 330
  VerticalOffset = 145
  Width = 150
  object jButton1: jButton
    Id = 0
    PosRelativeToAnchor = []
    PosRelativeToParent = []
    LayoutParamWidth = lpMatchParent
    LayoutParamHeight = lpWrapContent
    MarginLeft = 5
    MarginTop = 5
    MarginRight = 5
    MarginBottom = 5
    Visible = True
    BackgroundColor = colbrDefault
    Text = 'jButton'
    FontColor = colbrDefault
    FontSize = 0
    OnClick = jButton1Click
    left = 55
    top = 52
  end
end

*.pas
Code: [Select]
{Hint: save all files to location: C:\adt32\eclipse\workspace\AppDemo4\jni }
unit unit1;
 
{$mode delphi}
 
interface
 
uses
  Classes, SysUtils, And_jni, And_jni_Bridge, Laz_And_Controls;
 
type

  { TAndroidModule1 }

  TAndroidModule1 = class(jForm)
      jButton1: jButton;
      procedure DataModuleCreate(Sender: TObject);
      procedure DataModuleJNIPrompt(Sender: TObject);
      procedure jButton1Click(Sender: TObject);
    private
      {private declarations}
    public
      {public declarations}
  end;
 
var
  AndroidModule1: TAndroidModule1;

implementation
 
{$R *.lfm}

{ TAndroidModule1 }

procedure TAndroidModule1.jButton1Click(Sender: TObject);
begin
  ShowMessage('Hello World!');
end;

procedure TAndroidModule1.DataModuleCreate(Sender: TObject);
begin           //fix to *.lfm fail on cross compile Laz4Android..
    Self.OnJNIPrompt:= DataModuleJNIPrompt;
end;

procedure TAndroidModule1.DataModuleJNIPrompt(Sender: TObject);
begin
   Self.show
end;

end.


the original thread :
http://forum.lazarus.freepascal.org/index.php/topic,21919.0.html

thank you.



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

 

TinyPortal © 2005-2018