Recent

Author Topic: Cross platform - is Lazarus/FPC mature enough to compete?  (Read 13304 times)

ArminLinder

  • Sr. Member
  • ****
  • Posts: 314
  • Keep it simple.
Cross platform - is Lazarus/FPC mature enough to compete?
« on: December 11, 2017, 08:41:38 am »
Hi all,

till now I have successfully created small to medium size single-developer projects for Windows and Linux/Raspberry Pi, and I love Lazarus for those kind of work. Testing has revealed that most of my code would run on MacOS too, great.

The next project I am working on is going to be one step beyond, a fully blown portal site with SQL database and web frontend. backend work is done, the whole thing works well.

Front-end is Browser/Javascript/Bootstrap, backend is PHP on IIS or Apache, protocol is JSON. Of course, a working Internet connection is required.

What's on schedule now is an offline client for data aquisition in buildings, where there isn't a reliable Internet connection, if any at all. The user has to synchronize his data before entering the building, do his work (data aquisition) against a local storage, and the system shall synchronize the data back to the portal as soon as the user has Internet access again. Technically speaking the client has to buffer data in the local storage and connect to the JSON interface and deliver the data as soon as the Internet connection becomes active again.

The frontend has to run on the current mobile platforms (Android &  Ios are must, Windows Mobile maybe).

Must haves are:

- native look and feel (top requirement by management, where the Android and IOS fanboys fight a fierce battle, and I don't want to favor one side)
- need access to the hardware (camera, Internet connection)
- need some local storage with simple database capabilities
- must be distibutable via Application Store (i.e. whatever comes out of the development environment must be able to pass the Apple/Google/Microsoft certification process)
- must run on unmodified devices (no rooting or other kind of hack) without any dependencies except what the OS brings with it or what can be delivered via the package
- reasonably comfortable IDE with live debugger
- must *not* be free, but if it is, great.

I'd rather have a program once/run anywhere approach than develop with each platform's native development tools, but I am very well aware that not using the native tools may backfire, as the big players don't have any interest to support cross platform development, but rather lock everything in their ecosystem.

There are systems specialized on such Projects, Xamarin, PhoneGap, React Native, and from what I know I don't think Lazarus can compete with them.

Would anyone disagree?

Armin.
Lazarus 3.3.2 on Windows 7,10,11, Debian 10.8 "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15, Raspberry Pi

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #1 on: December 11, 2017, 11:10:56 am »
There is NativeScript from Telerik, at which you should have a look at: https://www.nativescript.org.
You can build native Android and iOS applications that can reuse your existing JavaScript code. In contrast to Apache Cordova etc. it creates true native frontends from an HTML-like (in fact it is XML) template and your JavaScript logic.

I don't think that Lazarus / FreePascal can compete with the JavaScript ecosystem for your use-case.
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11351
  • FPC developer.
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #2 on: December 11, 2017, 11:19:53 am »
dubst: Without any substantiation as to the reasons that sounds more like a plug/ad than an advise. You give no indication you actually know either FPC's mobile or the other suggested platforms. (e.g. by giving pros and cons)

Nimral:

Anyway, I don't know much about mobile (with FPC or without), but if Management is so sensitive it is usually best to keep your nose clean and go with their default. Free is then also not important, since Management can then cough up the cash.

Choosing your own tools is only beneficial if management and customers give you enough room for that, since otherwise you spend more time defending than you actually gain.
« Last Edit: December 11, 2017, 11:24:18 am by marcov »

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #3 on: December 11, 2017, 11:45:13 am »
@marcov, sorry, it is not an advertisement! We're developing web applications for more than a decade. With the development of the EcmaScript standard and the capabilities of the modern browsers, it is a huge advantage when you can re-use your existing JavaScript code. And it is an big advantage, when you write your application directly in JavaScript (or some dialect that can compile to it). We're also creating web applications that can be used offline and that sync data back as soon as the application is connected to the internet. So I have a big experience with this topic (more than with Free Pascal). And as I read that Nimrai wants to use native GUIs, NativeScript came into my mind immediately.

Maybe it is possible to create an mobile app für iOS and Android with Lazarus/FPC, but why should the developer want to rewrite the whole client logic from JavaScript in any other language (not only Free Pascal), when he can re-use the same code he has in production already?

But if there is a easy way with Free Pascal / Lazarus, I would be very interested! :-)
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

hrayon

  • Full Member
  • ***
  • Posts: 116
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #4 on: December 11, 2017, 12:42:55 pm »
"Progressive Web Apps"?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11351
  • FPC developer.
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #5 on: December 11, 2017, 01:11:15 pm »
Quote
Maybe it is possible to create an mobile app für iOS and Android with Lazarus/FPC, but why should the developer want to rewrite the whole client logic from JavaScript in any other language (not only Free Pascal), when he can re-use the same code he has in production already?

where did you read anything about client logic in javascript? Am I really confused.

Quote
But if there is a easy way with Free Pascal / Lazarus, I would be very interested! :-)

From the little I know is that FPC does not offer much of shared GUI between iOS and Android. If you don't leverage  large pascal codebases it might not be the best.   Even if you do, you might work with a Pascal or Pascal-JVM library, and do the GUI on top with other tools.

There are umpteen "easy" tools, but the people making the bigger webapps seem to mostly use the vendor tools (Xcode/Android Studio). The "easy" crossplatform tools are mostly just for one-time users that have to crank out a phone app. At least that is what it seems to me.

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #6 on: December 11, 2017, 02:16:37 pm »
@marcov nimral wrote:
Front-end is Browser/Javascript/Bootstrap, backend is PHP on IIS or Apache, protocol is JSON. Of course, a working Internet connection is required.
... if JavaScript is not only used to let buttons disappear, there must be a client logic ;-) In a typical JavaScript application, you also follow a traditional MVP/MVP or MVVM approach - you have a controller, the data and a view.
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #7 on: December 15, 2017, 11:37:58 am »
You can program the backend, database model and web server using Object Pascal quickly at very efficient manner (Using mORMot for example). GUI is another history...

You can make 6 different GUI apps. And every app will have pros and cons.

For example :
- Native app (Android SDK) with Android Studio. (Only JSON API client and controls)
- Native app (Android NDK + Android SDK) with Android Studio and C++. (Only JSON API client and controls)
- Javascript (React, Angular, JQuery, Cordova...) Application (HTML forms and Ajax Javascript )
- Firemonkey app using Delphi. Not bad at all
- Xamarin app using C# and VS
- Lazarus and FPC Pascal using LCL and custom drawn widgets (Android NDK + Android SDK)

I seen Lazarus LCL on Android and custom OpenGL app made in FPC and the results are very good, you need to research a bit.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1738
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #8 on: December 15, 2017, 12:23:23 pm »
Quote
You can program the backend, database model and web server using Object Pascal quickly at very efficient manner (Using mORMot for example). GUI is another history...

The above quote is the way my database progs are written.
mORMot+FPC+Lazarus:
First, a server is made. With an embedded sqlite3 engine. Testing: Windows; running: Linux.
Followed by a windows/linux client app. With local and remote (the server) database (single change: 2 lines of code).
The above allows for very easy testing and GUI.
Followed by an Android app with LAMW with local database for easy testing. Followed by the remote database connection.
Database logic is shared between all clients and the server(s).
As an extra, Javascript clients (JSON, remote server) allow for many more clients.

Honest sidenote: (only) after a (steep) learning curve, the productivity will become very high.

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #9 on: December 15, 2017, 01:25:04 pm »
Quote
You can program the backend, database model and web server using Object Pascal quickly at very efficient manner (Using mORMot for example). GUI is another history...
The above quote is the way my database progs are written.

Yeah!  8-) Mine too! At professional level. There are robust, fast and well written backends.

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #10 on: December 15, 2017, 01:29:13 pm »
Followed by an Android app with LAMW
LAMW how this works? Like FireMonkey? Fast and native? With native components?

Quote
Honest sidenote: (only) after a (steep) learning curve, the productivity will become very high.

I like your sidenote!
« Last Edit: December 15, 2017, 01:31:24 pm by turrican »

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #11 on: December 15, 2017, 01:34:32 pm »
You should try it yourself. The installation about LAMW is a bit tricky. I wrote a tutorial about it, also a sample code and an apk:
http://forum.lazarus.freepascal.org/index.php/topic,38777.msg264419.html#msg264419

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #12 on: December 15, 2017, 01:38:31 pm »
You should try it yourself. The installation about LAMW is a bit tricky. I wrote a tutorial about it, also a sample code and an apk:
http://forum.lazarus.freepascal.org/index.php/topic,38777.msg264419.html#msg264419

Thank you very much Handoko! This is my homework for this weekend. I'm going to analyze this framework and write my experience about it ;)

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #13 on: December 15, 2017, 01:39:53 pm »
Please join in the Lazarus + LAMW fun.
LAMW need more testers, users, programmers and developers!
 ;D

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: Cross platform - is Lazarus/FPC mature enough to compete?
« Reply #14 on: December 15, 2017, 01:43:31 pm »
Sure, I'm very excited :) What this framework really is? A JNI Android controls wrapper for Object Pascal NDK Libraries?

 

TinyPortal © 2005-2018