Lazarus

Programming => General => Topic started by: Blade on December 04, 2021, 09:18:42 pm

Title: Mobile development - Android & iOS
Post by: Blade on December 04, 2021, 09:18:42 pm
well actually i have install 10 testing apps on my android device.
the complains is all abou ie. try to install indy components...
try to open demo lamw projects and belive me NOTHING works...
It is not part of the Lazarus or FreePascal project and the developers have no responsibility over it and no obligation to make it work.

Oddly, nick1965's complaint about trying to use Lazarus for Android has a small bit of legitimacy.  Don't get me wrong, in no way am I excusing being rude or a user not taking the time to read help documentation (including wiki).  The angle that I'm talking about has to deal with expectations, and arguably the Lazarus team should be aware of such.  Ignoring that people would want to develop mobile applications for Android and iOS is strange.  Delphi has positioned itself where it's not just for the desktop, but also for mobile.  People who would be looking at Lazarus as a potential alternative, would obviously be considering this when making comparisons and decisions. 

Probably the most glaring weakness or oversight of Lazarus is exactly that, creating mobile apps.  That Lazarus is seen as not capable in that area, is arguably worrisome and problematic.  And other programming languages/open source IDEs, have been making themselves viable ways to create mobile applications.  LAMW/Laz4Android is a fantastic effort, but them not being more thoroughly integrated into Lazarus, does appear to create a bit of awkwardness that would most obviously become a problem for newbies and beginners.  And LAMW/Laz4Android is only a partial solution, as there isn't any equally viable Laz4iOS project.  When people claim that Lazarus is an alternative, then the weakness in mobile development, can possibly lead to disappointment for some people coming from the Delphi world.
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 04, 2021, 10:09:30 pm
in no way am I excusing being rude or a user not taking the time to read help documentation (including wiki).

I think it appropriate to spell out here that while the wiki is useful it is basically "user experiences", and is neither official nor consistently maintained.

The core developers and documenters can only do so much and as such the wiki is enormously useful, BUT if there is a hint of disagreement between the wiki and formal documentation it's the wiki which has to be treated as unreliable... and that sort of thing can normally be resolved promptly by raising the point in one of the forum areas.

Quote
The angle that I'm talking about has to deal with expectations, and arguably the Lazarus team should be aware of such.  Ignoring that people would want to develop mobile applications for Android and iOS is strange.  Delphi has positioned itself where it's not just for the desktop, but also for mobile.  People who would be looking at Lazarus as a potential alternative, would obviously be considering this when making comparisons and decisions.

I'm inclined to agree.

Quote
Probably the most glaring weakness or oversight of Lazarus is exactly that, creating mobile apps.

Detail here for people whose first language is not English. The traditional meaning of "oversight" is "omission, something overlooked". A more recent usage is equivalent to "supervision". It's a word I try to avoid in technical writing because of that ambiguity.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Martin_fr on December 04, 2021, 10:09:59 pm
Oddly, nick1965's complaint about trying to use Lazarus for Android has a small bit of legitimacy.  Don't get me wrong, in no way am I excusing being rude or a user not taking the time to read help documentation (including wiki).  The angle that I'm talking about has to deal with expectations, and arguably the Lazarus team should be aware of such. Ignoring that people would want to develop mobile applications for Android and iOS is strange.
First of all, the response anyone gets/got on this forum are responses from the community.

And it is not about ignoring, it is about available volunteers in the team and in the community. People (community and team) volunteer to help with whatever they like to help with. Most will help outside their chosen area, if they know something on the topic. But few will go, pick up something they do know nothing about, and do the full research for someone else.

So, the amount of people who have experience with Lazarus + Android, appears to be relatively small (compared to the size of the community). And if that is the case, answers will take longer. Some people may only read up on the forum once a week. Some may miss the topic at first. Some may think they have the answer, and then it turns out to be wrong and make it worse. Such are the dynamics of a community and/or volunteer driven project.

Take me for an example. I had not seen his questions, but had I seen them, yes I would have ignored them. I have no clue. Never used Laz+Android myself. Don't even know who does, so I couldn't even alert a knowledgeable person to look at it. Not because I don't wont to, but because I got to much else to do.

Quote
Probably the most glaring weakness or oversight of Lazarus is exactly that, creating mobile apps.  That Lazarus is seen as not capable in that area, is arguably worrisome and problematic. 
Maybe, but that will only change if people volunteer. Answer questions, document, supply patches....

Obviously there are already existing people, who supplied what is already there. Not sure if they are all still active and the Android stuff, or if they all read the forum. Maybe some of them are on the mail list. Maybe some are temporarily or permanently busy with other things. Again, all volunteers. Each decide for themself, when and how much.

Quote
And other programming languages/open source IDEs, have been making themselves viable ways to create mobile applications.  LAMW/Laz4Android is a fantastic effort, but them not being more thoroughly integrated into Lazarus, does appear to create a bit of awkwardness that would most obviously become a problem for newbies and beginners.  And LAMW/Laz4Android is only a partial solution, as there isn't any equally viable Laz4iOS project.  When people claim that Lazarus is an alternative, then the weakness in mobile development, can possibly lead to disappointment for some people coming from the Delphi world.
All that may be true. But it is also chicken and egg...

Without advertising what is there, no one will come, and no new volunteers. And without volunteers, it will not progress or maybe just ever so slowly.

But yes, if some wikipage promises to much, then it should be thought to be corrected.
Find out if the author of that page is still active. Leave a note on the wiki's talk page, ask here on the forum, and also ask on the maillist(s). If they are still there, speak to them.


Title: Re: Mobile development - Android & iOS
Post by: Blade on December 04, 2021, 10:21:25 pm
@MarkMLl

Good response.  I agree with most of what you wrote.

Note- probably I should add, for those that might not know or to prevent any confusion, the Free Pascal compiler can of course be used on a wide range of CPUs and OSes (and a greater range than what Delphi can do).  Where with the Lazarus IDE and creating mobile applications, usually it's about the LCL, components, building GUI apps, or the convenience of the process for doing such.
Title: Re: Mobile development - Android & iOS
Post by: Martin_fr on December 04, 2021, 11:12:08 pm
Sorry going briefly offtopic.

Quote
Probably the most glaring weakness or oversight of Lazarus is exactly that, creating mobile apps.
Detail here for people whose first language is not English. The traditional meaning of "oversight" is "omission, something overlooked". A more recent usage is equivalent to "supervision". It's a word I try to avoid in technical writing because of that ambiguity.

Not following...

Yes, I get "oversight" can be a noun derived from "overseeing" (supervise, look after). But I can't make any sense of that usage in the above sentence.

If it was "glaring weakness of oversight", then yes. There is or may be a lack of supervision.
But it is "glaring weakness or oversight", so "creating mobile apps" is a weak point, or something that got overlooked/missed (an "oversight").

I am seeking here for some oversight (supervision) in my efforts to find an oversight (omission to glean from the provided info). Could you help?
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 04, 2021, 11:22:34 pm
The thing about mobile development with Lazarus is that to be well integrated into Lazarus it needs to integrate into the LCL as a widgetset.

I must confess it's a few years since I've looked into it so no guarantees about the correctness of the following statements. Back then LAMW controls where just rather thin wrappers around the JNI, where the GUI was basically done in (automatically generated) Java which interacted with native code, basically when an event was caused the Java code called the native pascal code, and changes to the gui where sent from the native code to the Java GUI.

This is actually quite a neat idea, and makes sense in that it allows a rather easy integration and iterative extension for different components by "just" implementing a JNI wrapper for these components.
But this approach also means that you can't reuse the LCL structure and components, as well as being specifically tailored to android. So it is a "hotfix by design", i.e. it can never be integrated into the wider LCL ecosystem.

A proper Lazarus integration, such that it is compatible with other platforms in the "write once compile anywhere" principle would require a custom android widgetset. There was the effort on making the "custom drawn" widgetset available for android: https://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android
The custom drawn widgetset is from the idea pretty similar to Firemonkey, i.e. on how delphi supports cross compatibility.  I don't know if this was continued and if so what the current state is.

I think the lack of mobile support is the biggest weakness of Lazarus, especially as mobile platforms have become the most important target for software (Android + iOS make around 55% of the OS market share) and Lazarus is very lacking in that regard.
While I think that LAMW is actually pretty great as it gives a solution to being able to develop for android, and back when I played around with it had a lot of fun with it, in it's current form it is by design not really compatible with the common Lazarus and LCL development in general. That said, the JNI binding technique could potentially be leveraged to build a widgetset. But as already stated, this would require pretty much a complete rewrite.

One Idea I have on my ever expanding list of future projects is to try to build a Pas2JS-Lazarus-Cordova pipeline to create allow for building cross plattform apps on the basis of web technology which works really well on both desktop and mobile
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 05, 2021, 01:15:03 am
...a Pas2JS-Lazarus-Cordova pipeline to create allow for building cross plattform apps on the basis of web technology which works really well on both desktop and mobile

I do agree that such an approach is viable, as this strategy was kind of pursued by Smart Pascal (and related products).  But, it would appear to also lead to a lot of complexity and frustration with dealing with languages and technologies outside of Lazarus and Object Pascal.  It looks like this route has achieved only moderate success, so far (as I can tell or have seen).  Maybe if there was something more tightly integrated, where it contained the desktop equivalent of Cordova or PhoneGap, it might come off as a stronger option. 

In contrast, Delphi is making mobile development easier and keeping it mainly within the confines of their IDE and Object Pascal.  Among other languages that have open source projects that have kind of pulled off multi-OS development, in their own way, is Lua.  Which comes along with the limitations of scripting languages (slower, security, etc...).  It has interpreters on the major OSes, so didn't need to be coupled with JavaScript (HTML, CSS, or substituting friends).


The thing about mobile development with Lazarus is that to be well integrated into Lazarus it needs to integrate into the LCL as a widgetset...

...A proper Lazarus integration, such that it is compatible with other platforms in the "write once compile anywhere" principle would require a custom android widgetset...

Debatably, this route would be the most preferable, though it appears more difficult or in need of developers to champion it.  It would make Lazarus a more viable alternative, and do more to promote it as a tool for both desktop and mobile development.

Even something like Laz4iOS (as a sister project to Laz4Android), where even though it's not fully supported or integrated into Lazarus, would still go a long way in the public perception of Lazarus in general because of the obvious comparison to Delphi.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 05, 2021, 01:53:13 am
In contrast, Delphi is making mobile development easier and keeping it mainly within the confines of their IDE and Object Pascal.  Among other languages that have open source projects that have kind of pulled off multi-OS development, in their own way, is Lua.  Which comes along with the limitations of scripting languages (slower, security, etc...).  It has interpreters on the major OSes, so didn't need to be coupled with JavaScript (HTML, CSS, or substituting friends).
I think that a web-technology based approach, if integrated seamlessly, has many advantages over what Delphi is doing. Most importantly, HTML + CSS is actually really good for providing easiely stylable GUIs with little effort. Whenever I used Firemonkey, I found it pretty hard to make some decent looking styles, while with CSS and HTML I don't just think it is easier, but because it is the most widely used GUI technology around, you can find a lot more examples and/or royalty free code and styles online.
And one thing I found, at least back when I used it (well thats also a few years back now) Firemonkey never felt native. Even simple things like Buttons never looked and felt like native buttons. The browser engines on Mobile phones are provided by the OS and are guaranteed to behave like native controls.

Also Firemonkey UIs are really slow, the render-engines of browsers are so highly optimized that they are blazing fast, they can refresh the image at hundreds to thousands of frames a second. Firemonkey often felt laggy, e.g. when opening the side menu.

Debatably, this route would be the most preferable, though it appears more difficult or in need of developers to champion it.  It would make Lazarus a more viable alternative, and do more to promote it as a tool for both desktop and mobile development.

Even something like Laz4iOS (as a sister project to Laz4Android), where even though it's not fully supported or integrated into Lazarus, would still go a long way in the public perception of Lazarus in general because of the obvious comparison to Delphi.
The thing about this is, that LAMW is an android solution through and through. And one thing is, when you develop a mobile app, you usually want the same app for both Android and iOS. This is why most apps are build on web technology and native apps are more of the exception. A solution for Lazarus should focus on unifying at least android and iOS, even if it is incompatible to Desktop. A widgetset would from a users point of view be the best solution, but of course this would also entail the largest development and maintainance overhead.

What I was wondering, as QT5 supports Mobile, wouldn't it be possible to use the already existing widgetset for mobile. But I am simply not knowledgable enough about QT and the corresponding widgetsets for that matter
Title: Re: Mobile development - Android & iOS
Post by: dbannon on December 05, 2021, 02:25:52 am
.....
The thing about this is, that LAMW is an android solution through and through. And one thing is, when you develop a mobile app, you usually want the same app for both Android and iOS. This is why most apps are build on web technology and native apps are more of the exception. A solution for Lazarus should focus on unifying at least android and iOS, even if it is incompatible to Desktop. A widgetset would from a users point of view be the best solution, but of course this would also entail the largest development and maintainance overhead.

Yes, I agree. The desktop and mobile screen are too different a concept, users expect different behaviour.  Canonical spent heaps on Unity mainly trying to make it a desktop (the software) that worked on a mobile device and a desktop machine. Microsoft tried to make a mobile OS that looked and felt like Windows and now have to make do with selling a handful of those silly Windows tablet thingos.

I have not tried to make any Lazarus-Android apps, unlike our friend Nick, I understand the cross over is hard and would need to put some effort in. Effort I cannot spare at present. But I am glad that a small number of Lazarus users are making progress in that direction !

Davo 
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 05, 2021, 03:38:52 am
I think that a web-technology based approach, if integrated seamlessly, has many advantages over what Delphi is doing.

I disagree about that point.  This "integrated seamlessly", would likely have to be to make JavaScript, HTML, and CSS virtually invisible.  It appears to me as something very difficult to pull off.  Even in the case of Smart Pascal or pas2js, there will be conflicts between the desktop and web technologies or languages involved, where the user has to have web developer type knowledge to solve.  It then creates a conflict of having to jump over one side of the fence or the other.  Where the Delphi approach limits such issues.  You are more focused on targeting the OS, and web technologies are not on the radar, unless that is what the user is focusing on. 

I think the web technology based approached works better with people who have advanced web development backgrounds, who are then targeting the desktop.  Keep in mind that JavaScript is a "3 or more for 1" package deal, that includes HTML and CSS.  Where the Delphi approach would arguably be better for those that are coming from desktop based or Pascal backgrounds.  To include those that primarily interface or work with the desktop and desktop apps, such as IT professionals, workers at various businesses, etc...

Whenever I used Firemonkey, I found it pretty hard to make some decent looking styles...
...Firemonkey never felt native...

Well, part that is opinion, and another part is how Delphi has implemented it.  Add to that, the FireMonkey framework is something that Delphi bought and then integrated, versus developed themselves.  As with anything else, it can improve with each new version.

...And one thing is, when you develop a mobile app, you usually want the same app for both Android and iOS...

I very much agree with you.  I think this is where a bit of uneasiness about LAMW comes in, despite it being such a great initiative and project.  It's like solving one part of the equation, but not the other.  But, it's what is out there.  Better there is an Android solution, then none.

Preferably, there be a solution for both Android and iOS.  Except to me, and acknowledging the present situation, even if Lazarus had two totally different solutions then that would be better.  If there is Laz4Android, which is totally different from Laz4iOS, at least both exist.  Though even in that scenario, I do think there would be a significant level of cross-over and concepts.

Some years back, it looked like Lazarus users/independent developers were making iPhone apps and did a significant amount of work towards an iOS solution.  Oddly, whenever it looks like an iOS solution is about to come together (to a LAMW level), it seems to get abandoned.  Example, from Simon Choi, https://blog.naver.com/simonsayz/221209784815 (https://blog.naver.com/simonsayz/221209784815).

What I was wondering, as QT5 supports Mobile, wouldn't it be possible to use the already existing widgetset for mobile...

Yeah, it would be nice if one of the more advanced users or developers give their opinion on this.
Title: Re: Mobile development - Android & iOS
Post by: loaded on December 05, 2021, 03:51:24 am
I wrote apps for windows and android with Lazarus and they all worked flawlessly. In fact, my youngest son laid the foundation of reading in this program 3 years ago, and he learned to read by himself in this program before he went to primary school. Currently 7 years old.
My eldest son, on the other hand, can make projects at LAMW and run them easily on his own phone. Currently 14 years old.
They'll probably both be good Lazarus users (and hopefully developers too).
Because instead of complaining, the constant magic question "How am I going to do this?" they ask.
Result Success !!!
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 05, 2021, 04:41:29 am
@loaded

To prevent confusion and misunderstandings, letting you know that his thread wasn't created by me.  Not hating on Lazarus (as I like it), or on any projects.  The moderators broke this off from the original thread, "So many bugs in Lazarus Ide".  The context of the post that I made was about possible reasons why the OP might have felt disappointed with Lazarus, in comparison to Delphi.  The OP of that thread was having various self-inflicted issues, which included trying to get LAMW installed and working.

I'm not saying that it isn't possible to build Android apps with LAMW (nor do I think that's Warfley's position). By the way, congrats to your son.  In regards to where the conversation was going, we were discussing that Delphi has a comprehensive solution for developing mobile applications for both Android and iOS (FireMonkey Framework), where Lazarus doesn't yet.  Then Warfley and I took the conversation towards possible ideas.  Myself, and possibly others, would like to see Lazarus in a more favorable position in terms of public perception, usability, and in comparison to Delphi.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 05, 2021, 05:41:33 am
I disagree about that point.  This "integrated seamlessly", would likely have to be to make JavaScript, HTML, and CSS virtually invisible.  It appears to me as something very difficult to pull off.  Even in the case of Smart Pascal or pas2js, there will be conflicts between the desktop and web technologies or languages involved, where the user has to have web developer type knowledge to solve.  It then creates a conflict of having to jump over one side of the fence or the other.  Where the Delphi approach limits such issues.  You are more focused on targeting the OS, and web technologies are not on the radar, unless that is what the user is focusing on.
You also have the same conflict in Delphi. Firemonkey is a completely different framework that is completely incompatible with the VCL. If you come from the VCL things like layouting or styling of Firemonkey applications are completely different. A web technology based framework for GUI development would be similarly not compatible with the LCL as Firemonkey is not compatible with the VCL.

Of course with things like pas2js the difference is a little bit larger, as the underlying web technology completely alters some of the behavior of the code (e.g. that every object in pas2js is internally a javascript object and therefore basically a dynamic dictionary).
But a more pressing issue here is that the existing packages and libraries, if they aren't pure high level algorithmic, would probably not work (i.e. everything that contains API calls or something similar). But there is also an alternative to that. The Webapp solutions, like react, allow to bind the javascript code against native libraries. So a solution that is similar to LAMW could be implemented, where the interface is build using web technology, and the pascal code is compiled to a native library, where then wrappers are used for hooking up the GUI controls to the underlying pascal code.
Basically you could build the same thing as Firemonkey, but rather than having an OpenGL rendering interface drawing all the UI, use the browser to render the UI. This would in the long term potentially even be less effort to develop and maintain than Firemonkey is.

Something like that could potentially even be implemented as an LCL widgetset.
But with this discussion I think we are loosing ourselves in hypotheticals, which, while neat to think about, are simply out of reach due to the massive development it would take. A more reasonable and archivable approach here, and what I want to experiment on somewhen I have a little bit more free time, would be to simply use Pas2JS with cordova to develop cross plattform apps, that simply use Pascal as a language, but are not necessarily compatible with the usual FreePascal/Lazarus ecosystem.

I think the web technology based approached works better with people who have advanced web development backgrounds, who are then targeting the desktop.  Keep in mind that JavaScript is a "3 or more for 1" package deal, that includes HTML and CSS.  Where the Delphi approach would arguably be better for those that are coming from desktop based or Pascal backgrounds.  To include those that primarily interface or work with the desktop and desktop apps, such as IT professionals, workers at various businesses, etc...
Not necessarily. You could easiely build a framework that hides all the HTML and CSS, the same way the LCL hides the underlying technology through the widgetset system
I personally would preferr to have HTML and CSS because it is simply more powerful than the conventional GUI editors you have, e.g. in Lazarus. If I want to have a custom tyled checkbox, I basically have to implement the drawing code myself using the Canvas. With HTML/CSS I can simply use CSS to edit everything about the appearance without having to implement the drawing algorithms myself.
Thats for example also the reason why the QT or JavaFX libraries for GUI development chose to implement CSS for styling of the GUI components, even though it is not even build on web technology.


Well, part that is opinion, and another part is how Delphi has implemented it.  Add to that, the FireMonkey framework is something that Delphi bought and then integrated, versus developed themselves.  As with anything else, it can improve with each new version.
Yes, the thing I think was the single bad design decision with Firemonkey was, to implement everything new from scratch. The advantage of using web technology is that already all of the hard stuff is made for you. HTML and CSS are already doing exactly what Firemonkey wants to do, they are a technology for building GUIs that are able to adept to any screen and resolution dynamically, utilize all the different forms of user input and allow for a high degree of configurability.
The web is the single most well tested technology on the planet. Around half of all humans have access to the internet, using HTML+CSS powered websites for potentially hours a day. All of this experince is considered by expert comitees developing and refining the webstandards over the past decades.
HTML and CSS engines are freely available under OpenSource licenses. Engines like Blink or V8 (as part of Chromium) are also some of the most well tested and optimized pieces of software in existance.

Firemonkey basically tried to implement the very same thing from scratch. Of course it will be worse, how couldn't it be. Don't get me wrong Firemonkey is actually quite good, you can see and feel all the developer hours that went into it. It's just that it is still worlds apart from the state where webtechnology is. Both from the implementation and optimization, but also from the usability.

Software requires time, development time and testing time to get better. When I started using Lazarus in version 0.xx it was much worse then it is now, simply due to more development effort, refinments and more users giving feedback. The same is true for Firemonkey it tries to do basically the same as the already existing web technology does, just that the web technology is 30 years ahead in the devlopment cycles.
One thing in programming is that one should not try to reinvent the wheel. IMHO Firemonkey could have been much better if they would have just said, rather than trying to implement everything themselve, to just use a browser for the whole rendering and stuff. They could have completely abstracted from the underlying technology, build all the Pascal component structure underneath like people know it from the VCL, but just rather than trying to write their own styling and rendering engine, use what has already proven itself and stood the test of time.

I very much agree with you.  I think this is where a bit of uneasiness about LAMW comes in, despite it being such a great initiative and project.  It's like solving one part of the equation, but not the other.  But, it's what is out there.  Better there is an Android solution, then none.

Preferably, there be a solution for both Android and iOS.  Except to me, and acknowledging the present situation, even if Lazarus had two totally different solutions then that would be better.  If there is Laz4Android, which is totally different from Laz4iOS, at least both exist.  Though even in that scenario, I do think there would be a significant level of cross-over and concepts.

Some years back, it looked like Lazarus users/independent developers were making iPhone apps and did a significant amount of work towards an iOS solution.  Oddly, whenever it looks like an iOS solution is about to come together (to a LAMW level), it seems to get abandoned.  Example, from Simon Choi, https://blog.naver.com/simonsayz/221209784815 (https://blog.naver.com/simonsayz/221209784815).
Sure having LAMW is nice, and defenetly better than not having it. Back when I used it I was quite amazed that this rather hacky solution was easier to use than the official android studio :D
But what I think is that at some point, if Lazarus wants to compete with other solutions, not just Delphi but also things like Xamarin, QT, React or others on the mobile market, there needs to be an integrated solution. And I think utilizing the widgetsets and sticking to the "write once compile anyhwere" approach of the existing lazarus ecosystem would be the best solution here.

Because to be honest, I really like using Lazarus, and if I have to write a GUI application for Windows or Linux it is usually the development environment of choice. But if I had to develop a mobile app, even if there was an Laz4iOS and both LAMW and Laz4IOS would both be of great quality, I would not chose lazarus, because even though I like it really, I would not want to do twice the effort for building the same app against two different frameworks, if there exist solutions out there which let me do it in one.
Imagine pitching this to a customer: "Yes, ok I am going to develop the Android and iOS app, but it will cost you twice as much because the technology I am using requires to build evrything from scratch for each system". If I where that customer, I would simply ask why you would use this technology over the alternatives that don't require twice the effort. And most customers would probably then rather hire someone using the technology that doesn't cost them twice as much for the same work
Title: Re: Mobile development - Android & iOS
Post by: loaded on December 05, 2021, 06:09:04 am
@loaded
To prevent confusion and misunderstandings, letting you know that his thread wasn't created by me. 

You don't need to worry, you can relax.
I know where and how the subject started. Thank you for your congratulations.

If I where that customer, I would simply ask why you would use this technology over the alternatives that don't require twice the effort. And most customers would probably then rather hire someone using the technology that doesn't cost them twice as much for the same work

According to my experience;
In general, customers are uninterested in technology *. Price/performance is important to them.
The rest is not important to them. The important thing is;
He looks at how you will get the ship to the port in storms.
I mean, your captaincy.

*There may be a misunderstanding about the term technology here. Technology used by the developer, not the technology used by the customer
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 05, 2021, 07:11:48 am
Sure having LAMW is nice, and defenetly better than not having it. Back when I used it I was quite amazed that this rather hacky solution was easier to use than the official android studio :D

...But if I had to develop a mobile app, even if there was an Laz4iOS and both LAMW and Laz4IOS would both be of great quality, I would not chose lazarus, because even though I like it really, I would not want to do twice the effort for building the same app against two different frameworks, if there exist solutions out there which let me do it in one.

Imagine pitching this to a customer: "Yes, ok I am going to develop the Android and iOS app, but it will cost you twice as much because the technology I am using requires to build evrything from scratch for each system". If I where that customer, I would simply ask why you would use this technology over the alternatives that don't require twice the effort. And most customers would probably then rather hire someone using the technology that doesn't cost them twice as much for the same work

Well, this kind of depends on the programmer.  There are many hobbyists, workers, and independent software developers that would be making the decision for themselves.  Additionally, the person may not be such a polyglot programmer (so much easier decision) or whoever they are working for leaves it up to them to decide.

It also wouldn't be "twice the effort", and would come down to various percentages.  A lot of the business logic would be the same.  If there was a Laz4iOS, I believe it would resemble Laz4Android as much as possible.  Just because the different teams would likely be collaborating with each other through e-mail or the forum.  In the hypothetical situation of a Lazarus user using both Lazarus Android Module Wizards and Lazarus iOS Module Wizards, the user would keep as much code as they could, the same.  Will that be 50% or 99%, who knows for sure.  But, even in the preferable situation that you described, where Lazarus had widgetsets that could target both Android and iOS, there is going to be some differences in coding to more specifically target features of the different OSes.

...You also have the same conflict in Delphi. Firemonkey is a completely different framework that is completely incompatible with the VCL. If you come from the VCL things like layouting or styling of Firemonkey applications are completely different. A web technology based framework for GUI development would be similarly not compatible with the LCL as Firemonkey is not compatible with the VCL...

I think that part of the FireMonkey problem was that it wasn't developed in-house.  FireMonkey had different ways and thinking from when it was bought, then the Delphi team had to "force" it to fit.  "Management has bought this mobile solution, so make it work."  It is way more likely for a Lazarus solution to be more thoroughly integrated to what presently exists and how people do things.

If the argument is that the mobile solution is going to be somewhat incompatible anyway, then that leads to the argument that separate Lazarus solutions for Android and iOS could be just about as tolerable.  More likely than not, there would be separate developers/teams/projects that would be focused on the different major mobile OSes of Android and iOS.  A certain degree of specialization seems unavoidable.
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 05, 2021, 09:35:05 am
I am seeking here for some oversight (supervision) in my efforts to find an oversight (omission to glean from the provided info). Could you help?

Noting that there are a number of people in this forum who use Google (or other) machine translation, I thought the homonym worth pointing out. I'd suggest that your quote above would be better put as

"I am seeking some guidance here in my effort to find an omission."

Oversight, as in  "executive summary", would until recently have been "overview". Or for that matter "summary" or possibly "abstract" although that can be another problematic word (you can either present an abstract, or abstract from a more detailed presentation).

Oversight, as in "supervision" is a neologism derived from "overseer", which I think is used in a couple of places in traditional Bible translations and was more recently common in certain exploitative colonial situations.

Oversight, as in "unintentional omission", is well-established.

Or at least, that's my position from a few score years as a British-English speaker :-)

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 07, 2021, 11:39:43 pm
Maybe, but that will only change if people volunteer. Answer questions, document, supply patches....

Obviously there are already existing people, who supplied what is already there. Not sure if they are all still active and the Android stuff, or if they all read the forum. Maybe some of them are on the mail list. Maybe some are temporarily or permanently busy with other things. Again, all volunteers. Each decide for themself, when and how much...

...All that may be true. But it is also chicken and egg...

Without advertising what is there, no one will come, and no new volunteers. And without volunteers, it will not progress or maybe just ever so slowly.

But yes, if some wikipage promises to much, then it should be thought to be corrected.
Find out if the author of that page is still active. Leave a note on the wiki's talk page, ask here on the forum, and also ask on the maillist(s). If they are still there, speak to them.

I agree with with most of your post.  Another thing that I learned is that sometimes developers don't realize that people are interested in their project because they aren't getting enough feedback.  I have experienced several such situations with volunteer developers.  Sometimes it can be good for users to let them know that their efforts are appreciated.  Even if the user isn't advanced or a developer, maybe there are various other little things they can do to help.
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 07, 2021, 11:53:58 pm
A proper Lazarus integration, such that it is compatible with other platforms in the "write once compile anywhere" principle would require a custom android widgetset. There was the effort on making the "custom drawn" widgetset available for android: https://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android

The custom drawn widgetset is from the idea pretty similar to Firemonkey, i.e. on how delphi supports cross compatibility.  I don't know if this was continued and if so what the current state is.

I was quite surprised in my recent research that a lot more programming languages than I thought have taken the custom drawn route for Android and iOS mobile apps.  And this approach has worked quite well for them.  This includes even Google, with some of their other lesser known pet languages.  This is to perhaps put more emphasis that we shouldn't take Delphi's implementation issues with FireMonkey as the usual case.  But to be fair, they are improving with each version.  It appears other programming languages have done similar, but done it right.

There is LCL-CustomDrawn-Android and LCL-CustomDrawn-Cocoa (among others), but not sure what is going on or the story with LCL-CustomDrawn-iPhone.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 08, 2021, 12:10:59 pm
The thing is, creating a native look and feel is actually quite hard, requires a lot of time and effort. Oracles JavaFX, one of biggest custom drawn interface library out there, does not have this to this day. The main problem is, as soon as the underlying OS is updated, you need to update your skins for that version.
Especially on android you have the problem that different manufacturers (like Samsung) provide their own styles to their android versions, that look different to vanilla android.
Maintaining such a thing takes a lot of time and effort. This is basically the whole buisness model of frameworks like QT

IMHO when doing custom drawn, there is only one way to do it right, if you don't have the resources to make and maintain the native look and feel (which tbh I don't think Lazarus has), don't focus on making it look native, but on making it easiely customizable. JavaFX for example simply lets you style your components with CSS, making it very easy to create new styles, take existing styles from other domains (e.g. the web) and sharing your styles with others. Firemonkey on the other hand made styling really complicated with their own language, no one knew before, and also very limited online resources.

The quality of experience for the user is a function of expectations and performance. If you make your app look as native as possible, the expectations are for it to behave as native, so any deviations from that will impact the quality of experience.
By making the app look different to the native appearance, the user will also not expect the native behavior (at least not to the degree as if it looks like it is native).
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 08, 2021, 12:45:00 pm
The thing is, creating a native look and feel is actually quite hard, requires a lot of time and effort.

And the Lazarus/LCL project has enough problems trying to get to grips with things like gtk3.

There are some who would argue that Android and iOS are so overwhelmingly important that desktop OSes will shortly be eclipsed. I'm not one of them.

There are others who would argue that the important thing is being able to implement apps based on an HTML/CSS GUI which is an idea that's been around since Netscape proclaimed itself the Universal Desktop in about '95. I don't think I'm one of those either, but it's possibly a bit more defensible when you take QML into account... however I've encountered problems on more than one occasion when I've come up against a large-scale program comprising multiple (Python) sub-projects held together by the Electron or Uranium frameworks... with nobody able to say how the ensemble should be debugged.

One possibility would be to completely decouple the Android-specific part of the LCL into a separate project, but there's already enough of a problem with occasional issues with LAMW being interpreted as a weakness in the main Lazarus IDE.

In short, I don't have an answer other than suggesting that the people who complain about deficiencies in any particular LCL variant should be encouraged to engage with the development and maintenance projects... and I have very little expectation that that would be productive.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Chronos on December 08, 2021, 03:00:40 pm
The problem is that more people use mobile and tablets now than desktops. The desktops are more suitable for real work but still most of the people simply have their smartphone with themselves all the time. So inability to target that audience by Lazarus is pretty huge deficiency. Sure, not every development environment support all modes like desktop, mobile, web and console. But with Lazarus we have that expectation "Build once, compile anywhere" which is simply not true for entire mobile segment.
It would be nice to support native look & feel for Android and iOS, but at least it would be good to have LCL support for those platforms. It is not possible to encapsulate Android visual controls with standard LCL controls? As LCL supports OSX and Linux Gtk/Qt, than it should be possible to do that also for Android and iOS or even for HTML5 controls. There can be some limitations like as VCL/LCL old DPI dependent coordinate system. Delphi overcame that with FMX and also use of  TPointF. LCL would need to move in the same direction to better support those new platforms and widgetsets. That would introduce huge incompatibility with existing software. So for now, it would be nice if at least somebody implement widgetset for Android so we can simply compile our desktop applications and they would look at least like on desktop. Sure, even desktop application visual interface can be made more flexible to better work with touch screens and small screens in general.

So the question is, why Lazarus doesn't support Android yet. And will support it in near future? If it is mostly matter of work needed or there are other obstacles. Sure similar problem is with other widgetsets like Gtk3 and Gtk4. How much Android support would cost? Would be $10000 enough? :)
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 08, 2021, 03:13:03 pm
And the Lazarus/LCL project has enough problems trying to get to grips with things like gtk3.

Qt5 and above, which do Android and iOS, are already embraced by Lazarus.  We are kind of talking core elements of why people love Lazarus and the LCL, "Write Once, Compile Anywhere".

Quote
There are some who would argue that Android and iOS are so overwhelmingly important that desktop OSes will shortly be eclipsed. I'm not one of them.

I agree that desktop OSes will be with us for many years to come, particularly because many people want bigger screens and to a lesser extent more storage.  Many people will buy laptops or plug their desktop computer (which are increasingly small form factor) into their TV. 

Android could arguably replace Windows (check out https://www.android-x86.org/ (https://www.android-x86.org/) and others) and to a lesser degree macOS, for the desktop.  A huge number of people already carry around Android phones and are very familiar with using them.  It's not that big of a leap for people to use Android laptops or plug their Android device up to/WiFi into/use the cloud for large external storage and also connect the Android to their flat screen TV. 

That Google hasn't made a stronger push to bring this about (Android on the desktop/laptop), has arguably to do with them fumbling around with the Chrome OS and Chromebooks (as if they don't already have access to enough personal information).  Android is open-source, and a very short jump to the Linux world  :o.  Where with Chrome OS, that's totally under Google's control.  But, Google may at some point change direction.

Many people are indicating that Apple appears to be merging iOS with macOS, or will outright replace macOS with iOS at some point not too far away.  More and more macOS features keep getting added to iOS.

Quote
There are others who would argue that the important thing is being able to implement apps based on an HTML/CSS GUI which is an idea that's been around since Netscape proclaimed itself the Universal Desktop in about '95. I don't think I'm one of those either...

Oh, we agree on this point.  :)

Quote
One possibility would be to completely decouple the Android-specific part of the LCL into a separate project, but there's already enough of a problem with occasional issues with LAMW being interpreted as a weakness in the main Lazarus IDE.

That would be a terrible thing to do.  Lazarus and the LCL has embraced Android for many years already, with many people already have built and are maintaining Android apps.  We are really just talking about the other side of the mobile equation, more strongly embrace iOS too or that there would be an equivalent project like Laz4Android, thus Laz4iOS.

Quote
In short, I don't have an answer other than suggesting that the people who complain about deficiencies in any particular LCL variant should be encouraged to engage with the development and maintenance projects... and I have very little expectation that that would be productive.

Not everyone can be a developer.  Usually, you are talking people who are exceptional and/or very experienced, that will walk that path.  Most people aren't professional programmers, and a lot of people only engage in programming as a hobby.  Climbing the ranks to become an advanced enough programmer, in addition to time and interest, is not the easiest thing for everyone.  So, it might be a matter of trying to more actively find or encourage those with the needed abilities and interest.
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 08, 2021, 03:24:57 pm
What I was wondering, as QT5 supports Mobile, wouldn't it be possible to use the already existing widgetset for mobile. But I am simply not knowledgable enough about QT and the corresponding widgetsets for that matter

To add to this point, at least Qt 5.6.2 is supported (https://wiki.lazarus.freepascal.org/Qt5_Interface (https://wiki.lazarus.freepascal.org/Qt5_Interface)).  But there is no clear indication of such a more direct possibility, using the Qt5 WidgetType/WidgetSet and then cross compiling. 

This seems to have been a fuzzy matter for quite a long time, as indications are maybe most Free Pascal/Lazarus users are Windows or Linux desktop users, and then Android owners or ignore mobile development.  Mac and iPhone owners would be in the better position to gauge this for iOS.  With Android, there is already LAMW, so this obscures going into other directions.  But, clearly Android applications can be built in a couple of different ways by Free Pascal/Lazarus.

Quote
The thing is, creating a native look and feel is actually quite hard, requires a lot of time and effort. Oracles JavaFX, one of biggest custom drawn interface library out there, does not have this to this day. The main problem is, as soon as the underlying OS is updated, you need to update your skins for that version.
Especially on android you have the problem that different manufacturers (like Samsung) provide their own styles to their android versions, that look different to vanilla android.
Maintaining such a thing takes a lot of time and effort. This is basically the whole buisness model of frameworks like QT

But that is the thing, Lazarus is already using Qt/Qt5.  So then if Qt5 and up does Android and iOS and Free Pascal can compile to the cpu used, then that debatably creates a greater expectation that Lazarus would more fully embrace mobile development.

Quote
IMHO when doing custom drawn, there is only one way to do it right, if you don't have the resources to make and maintain the native look and feel (which tbh I don't think Lazarus has), don't focus on making it look native, but on making it easiely customizable.

I agree with your point about focusing on customizable.  There is a strong argument about whether mobile users always expect or demand a "native look".  There are many cases and exceptions, where applications that didn't have a native look were embraced and successful.  This could also depend a lot on the type of application that it is as well.  It arguably comes down to how well that it's done.

In addition, by Lazarus already having LCL-CustomDrawn-Android, it then also creates the expectation to see LCL-CustomDrawn-iPhone.  It could be said that it comes off a bit weird to somewhat embrace Android, but not iOS. 
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 08, 2021, 03:31:09 pm
How much Android support would cost? Would be $10000 enough? :)

Are you suggesting that somebody might be able to offer a decent bounty?

Because I think a commitment of that type would go a long way towards keeping the core developers enthusiastic, and their enthusiasm would go a long way towards demonstrating to everybody else (i.e. including the likes of me) that it was a platform worth taking seriously.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 08, 2021, 03:36:29 pm
There are some who would argue that Android and iOS are so overwhelmingly important that desktop OSes will shortly be eclipsed. I'm not one of them.
They already are, mobile makes up around 55% of the market share. There are a lot of people who have a mobile device but no desktop computer, or have a desktop but only use it for very specialized things (e.g. just for working). So just in raw numbers, mobile devices already eclipsed desktops.
But more importantly is what kind of apps you are developing. If you write server software, then you will probably never have to interface with mobile platforms. On the other hand, if you write a Chat, you can easiely skip Desktop but must target Mobile (e.g. WhatsApp the most widely used chat application is not available for Desktop)

The desktop will stay, but it will be increasingly niche, only for certain domains, mobile has already taken the reign in the daily usage of most people

There are others who would argue that the important thing is being able to implement apps based on an HTML/CSS GUI which is an idea that's been around since Netscape proclaimed itself the Universal Desktop in about '95. I don't think I'm one of those either, but it's possibly a bit more defensible when you take QML into account... however I've encountered problems on more than one occasion when I've come up against a large-scale program comprising multiple (Python) sub-projects held together by the Electron or Uranium frameworks... with nobody able to say how the ensemble should be debugged.
Well back in the 90s web development was not really prevalent, today JavaScript one of the most widely used programming platforms, making up between 10%-20% of the market share (depending on which statistic you go by). The reason for this is simple, all modern systems provide browsers, some systems even exclusively (e.g. many Smart TV OS only allow webapps). So web development is the easiest way to target as many platforms as possible.
Should you use it, well it depends, web technology is really good for creating interactive GUI applications. This is pretty much all it is designed for, but it lacks at other things, e.g. while since a few years nodejs and electron have threading support, it is not thread safe, and in browser you have no threading support at all, making it quite a pain to use multiple threads. JS is best suited for singe threaded applications. Also because all their apps are running in a sandbox, using system APIs is quite cumbersome and for browser applications even impossible, so if you require a lot of interactions with the environment, JS is also possible not a great solution.

Web applications can be a great solution, especially due to the massive existing infrastructure (frameworks, platforms, etc.) and the reason I brought it up is, because it is a very archivable mobile solution with relatively little effort.
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 08, 2021, 03:49:47 pm
As a general point, I've found a tablet connected to a decent screen using HDMI and to a keyboard/mouse a fairly competent replacement for a PC. But when considered as a decoupled device I'm uncertain what a tablet or 'phone is used for: the impression I get is that it's almost always running a browser as a "terminal" to Facebook/Twitter/Google's "mainframes".

But, clearly Android applications can be built in a couple of different ways by Free Pascal/Lazarus.

...and I'd suggest that that's one of the problems: it's never been clear which of those ways should be preferred, and that's certainly contributed to my lack of practical engagement.

Quote
There is a strong argument about whether mobile users always expect or demand a "native look".  There are many cases and exceptions, where applications that didn't have a native look were embraced and successful.  This could also depend a lot on the type of application that it is as well.  It arguably comes down to how well that it's done.

Following on from my earlier comment, I think it's telling that a very substantial proportion of the surviving Firefox addons are actually custom backgrounds etc. The majority of things that used to be handled by custom code are either now built into the browser, provided as a temporary download by a central server, or diligently blocked by remote services because their owners are worried about their business model (or, in a minority of cases, legal exposure).

Then if we look at things from a corporate POV, I think that the vast majority of companies which have embraced a "bring your own device" approach assume that their business systems will be accessed via a browser, irrespective of platform, and might actually be hostile to having unapproved software running on the same device.

At which point, even if the market penetration of Android and iOS continues to increase, I have reservations as to whether there will ever be a non-browser "killer app" for them.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 08, 2021, 04:00:10 pm
Android could arguably replace Windows (check out https://www.android-x86.org/ (https://www.android-x86.org/) and others) and to a lesser degree macOS, for the desktop.  A huge number of people already carry around Android phones and are very familiar with using them.  It's not that big of a leap for people to use Android laptops or plug their Android device up to/WiFi into/use the cloud for large external storage and also connect the Android to their flat screen TV.
Nah, Windows is here to stay, it could be in some areas overtaken by Android, but in many domains there is no chance. One huge advatage of windows is that it is backwards compatible to the stone ages, so if you look for example into the critical infrastructure sector: Hospitals, Powerplants, etc. they are still using software from multiple decades ago and this is only possible because of Windows. Android is based on Linux, which is famous (well more the GLIBC rather than linux itself) to switch up abis to make it not backwards compatible.

That Google hasn't made a stronger push to bring this about (Android on the desktop/laptop), has arguably to do with them fumbling around with the Chrome OS and Chromebooks (as if they don't already have access to enough personal information).  Android is open-source, and a very short jump to the Linux world  :o.  Where with Chrome OS, that's totally under Google's control.  But, Google may at some point change direction.
I don't know what you are talking about, but Chrome OS is a massive success for google. Last year it overtook MacOS as the second most used OS for Desktops worldwide. Also it is kinda Open Source. The basic OS is Chromium OS, which is fully open source. Chrome OS is basically just Chromium with some addons and pre installed proprietary software (basically the integration into the google services is proprietary, but the whole OS is open source). It is like the difference between Chrome and Chromium.

That would be a terrible thing to do.  Lazarus and the LCL has embraced Android for many years already, with many people already have built and are maintaining Android apps.  We are really just talking about the other side of the mobile equation, more strongly embrace iOS too or that there would be an equivalent project like Laz4Android, thus Laz4iOS.
As already mentioned earlier, Laz4Android with LAMW is specifically tailored towards android. The whole architecture is build around android. Trying to build now an Laz4iOS that behaves similarly will only make problems down the line.
A good solution should provide a common interface that can easiely be mapped on both backends. Not an interface that was specifically tailored to one solution with the rest then having to be somehow fitted onto that. Because in the worst case, what can happen is that you will just end up with a simulator that just simulates android behavior so you can use LAMW, like Wine for Linux, which will only make everything much more complex.

Not everyone can be a developer.  Usually, you are talking people who are exceptional and/or very experienced, that will walk that path.  Most people aren't professional programmers, and a lot of people only engage in programming as a hobby.  Climbing the ranks to become an advanced enough programmer, in addition to time and interest, is not the easiest thing for everyone.  So, it might be a matter of trying to more actively find or encourage those with the needed abilities and interest.
I completely disagree on every level. A programming platform should make programming as easy as possible. The Problems a programmer has to solve are already hard enough on it's own, formalizing real world problems, finding algorithms to solve them and applying these solutions to the real world are in it self extremely hard. If aside from this you make the act of programming also really hard, all you do is gatekeep people who could potentially write really good and useful programs, just because they might not have the time or the will to go through additional hoops.
The best programming language would be one that takes an a specification or description of a program and turns it into a bug free fully fledged program. We won't have this any time soon, but we should at least try to come as close as possible to this ideal.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 08, 2021, 04:06:58 pm
I agree with your point about focusing on customizable.  There is a strong argument about whether mobile users always expect or demand a "native look".  There are many cases and exceptions, where applications that didn't have a native look were embraced and successful.  This could also depend a lot on the type of application that it is as well.  It arguably comes down to how well that it's done.

In addition, by Lazarus already having LCL-CustomDrawn-Android, it then also creates the expectation to see LCL-CustomDrawn-iPhone.  It could be said that it comes off a bit weird to somewhat embrace Android, but not iOS.
I don't think that you need to have a native look, if you have the capabilities to make a good custom look. But many developers are neither good at developing great UIs and a good User Experience (it has a reason why these two areas are dedicated jobs with quite a good salary). The thing about native look is, that it is easy. If you make a windows application and just use windows form elements, it will generally look and behave fine. If you make a custom look, and aren't very good at it, it will look terrible.
Because the other side of the expectations is, if you do something special, the user will typically also expect something special. If you have a custom style, it better be good, otherwise, why would you use a custom look.

So having the native look available will always give you an OKish experience without effort, while a good custom look always requires effort and skills, many developers might not have. I for example am not confident in creating a good looking UI by myself.
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 08, 2021, 04:33:17 pm
In short, I don't have an answer other than suggesting that the people who complain about deficiencies in any particular LCL variant should be encouraged to engage with the development and maintenance projects... and I have very little expectation that that would be productive.
Not everyone can be a developer.  Usually, you are talking people who are exceptional and/or very experienced, that will walk that path.  Most people aren't professional programmers, and a lot of people only engage in programming as a hobby.  Climbing the ranks to become an advanced enough programmer, in addition to time and interest, is not the easiest thing for everyone.  So, it might be a matter of trying to more actively find or encourage those with the needed abilities and interest.
I completely disagree on every level. A programming platform should make programming as easy as possible. The Problems a programmer has to solve are already hard enough on it's own, formalizing real world problems, finding algorithms to solve them and applying these solutions to the real world are in it self extremely hard. If aside from this you make the act of programming also really hard, all you do is gatekeep people who could potentially write really good and useful programs, just because they might not have the time or the will to go through additional hoops.
The best programming language would be one that takes an a specification or description of a program and turns it into a bug free fully fledged program. We won't have this any time soon, but we should at least try to come as close as possible to this ideal.

I've restored an extra level of context there. The problem is that in the current case we're talking about how to fill in gaps in the LCL etc., and unfortunately at that level programming /can't/ be made easy since apart from anything else customising the LCL for Android (and potentially iOS) will undoubtedly show up shortcomings in the interface API which will necessitate negotiation with the maintainers of the other variants.

Programming /should/ be easy, but as soon as you discount the platitudes of the early BASIC, Smalltalk and Logo enthusiasts it very rarely is.

The encouraging thing is that it can be made slightly easier by the robust type checking etc. inherent in Pascal (and more recently Rust etc.). But in order to convince people of that they need to be able to develop for their chosen platform... and a console-based "Hello, World!" doesn't cut the mustard any more.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 08, 2021, 04:49:00 pm
Ah ok so I misunderstood this, I thought this was about that the application of the LCL frameworks for android and/or ios should be targetet at experienced programmers. This makes sense

Quote
The encouraging thing is that it can be made slightly easier by the robust type checking etc. inherent in Pascal (and more recently Rust etc.). But in order to convince people of that they need to be able to develop for their chosen platform... and a console-based "Hello, World!" doesn't cut the mustard any more.
I think the most important part isn't the language itself, it's the tooling. I think one of the great features of Javascript, and why it is so popular, is because, basically you can just open up any editor, write 3 lines, double click it and it works.

Lazarus for Windows is also quite great, you just download the exe installer and everything works out of the box. But only if you develop on windows for windows. Even things like compiling for Linux on a Windows is pretty complicated
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 08, 2021, 08:16:23 pm
Ah ok so I misunderstood this, I thought this was about that the application of the LCL frameworks for android and/or ios should be targetet at experienced programmers. This makes sense

I've always been torn between whether or not it's wise to have a single language like Object Pascal which is proficient at both application- and system-level programming, or if a split as with VB and VC++ was preferable. Now that so many people demand automatically-managed memory I think I'm moving towards the split approach: Rust (as a specific example) appears to succeed at doing both safely but the cost is having assignment semantics which are rather non-ALGOL.

Quote
I think the most important part isn't the language itself, it's the tooling. I think one of the great features of Javascript, and why it is so popular, is because, basically you can just open up any editor, write 3 lines, double click it and it works.

Javascript is also remarkably popular as a language that benefits enormously from something more rigorous layered on top of it.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: dseligo on December 08, 2021, 09:34:06 pm
e.g. WhatsApp the most widely used chat application is not available for Desktop

Yes, it is available. And Viber also - probably all popular chat applications.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 08, 2021, 10:38:37 pm
The new version is still in beta and the old version is not a real app. It's a slim interface that connects to your phone. All the messaging functionality is performed by the App on the Phone and the Desktop client has no functionality on it's own. I don't count that as a real desktop version.

Also whatsapp still requires a phone, you can only use the desktop app in addition to an already existing mobile installation.
Title: Re: Mobile development - Android & iOS
Post by: marcov on December 08, 2021, 11:09:33 pm
Also whatsapp still requires a phone

Whatsapp basically uses your telephone number as your login. Changing that for a desktop app would be massive, but also makes it an exception, and IMHO a bad model for comparison.

I tried to get mobile development to get rolling several times in the company I work for, but in practice the customers really want it, but consider it a nice to have that they don't want to pay for. IOW it faltered already before the divisive discussion about platforms :)

That said, I have some doubts about single source GUI for mobile and desktop. The form factors and UI culture are simply quite different.
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 09, 2021, 12:06:49 am
I think the most important part isn't the language itself, it's the tooling. I think one of the great features of Javascript, and why it is so popular, is because, basically you can just open up any editor, write 3 lines, double click it and it works.

Lazarus for Windows is also quite great, you just download the exe installer and everything works out of the box. But only if you develop on windows for windows. Even things like compiling for Linux on a Windows is pretty complicated

It's needed, but don't think JavaScript is all that wonderful.  Let's not forget how widely popular that TypeScript has become, because of the perceived inadequacies of JavaScript.  Then of course you are not usually dealing with just JavaScript, but 2 other "almost languages", CSS and HTML.  Thus the dizzying array of constantly changing and new frameworks to try to tame the "3 headed monster".

Object Pascal can do things that JavaScript can't and offers various specific advantages by allowing the direct targeting of the OSes.  With Free Pascal/Lazarus, it's usually more a matter of what percentage of your code will be reusable among the OSes targeted.  For the desktop OSes, that's going to be extremely high, with only small alterations.  If the Object Pascal programmer wants HTML5 applications, there is the pas2js transpiler for Free Pascal/Lazarus, and some other Pascal dialects have similar (Smart Pascal).

It's arguably about what to do with creating mobile applications with Lazarus.  Android is partially embraced by Lazarus, so we have this "middle of the road" situation.  Why not cross the road, and fully embrace mobile development?

Yes, mobile development is going to be bit different, but there are some lesser known programming/scripting languages (free and commercial) that have figured it out to various degrees.  I'm talking about mobile development on the Windows OS, with IDEs for their language, creating applications for other OSes.  They even have built-in mobile device simulators/screen simulators on Windows, for both Android and iOS.

Our favorite IDE, Lazarus, is more than capable of doing such.  We have seen Delphi do it (in their own way) for years.  If anything, Lazarus has numerous advantages in how to implement it.  And it doesn't have to be anything particularly radical.  There appears to be various paths with Qt5 and above or custom-drawn. 

Even a general call for volunteer developers that have the skills to make it happen, could be enough to cross over enough where its not in limbo, but there is a way forward where people can read about it on wiki and in help documents.  It appears that various developers have quietly used Free Pascal/Lazarus for mobile development in the past, using various undisclosed/not widely known methods.  It's debatably about time to make such knowledge more publicly known or have projects that show the way, for a more healthy future.
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 09, 2021, 01:05:24 am
Thank you for entering the discussion.  Much respect, as I realize it's a bit tricky from your perspective.

...but in practice the customers really want it, but consider it a nice to have that they don't want to pay for...

Maybe refer to the post by Chronos on the 2nd page.  Clearly developers might want to PM him for clarification.

Quote
That said, I have some doubts about single source GUI for mobile and desktop. The form factors and UI culture are simply quite different.

I agree about the form factor and cultural elements involved, but would say there is possibly more at stake.  Mobile is becoming increasingly more important, where more people are going to continue to notice Lazarus hasn't embraced it, and a lot of people would be looking to create applications on both.  I don't want to be so "look at them" about it, but other languages and IDEs seem to increasingly be providing both mobile and desktop development options.  Among what's out there is of course Delphi, and Lazarus is almost automatically going to be compared with it.  Culture is definitely tricky, but at least when it comes to form factors and simulating mobile screens, it appears solvable.  Various IDEs have solutions and even their own simulators for developing on Windows, for both Android and iOS.

Looking at Lazarus, many can already see the seeds of potential mobile development.  Even if just only the custom drawn interface path, there is LCL-CustomDrawn-Android, so that there isn't LCL-CustomDrawn-iPhone seems a bit odd.  Moving in only that direction would seem helpful.

What I was wondering, as QT5 supports Mobile, wouldn't it be possible to use the already existing widgetset for mobile. But I am simply not knowledgable enough about QT and the corresponding widgetsets for that matter

Could you elaborate about Qt5 mobile platform support, as it could possibly pertain to Lazarus mobile development?
Title: Re: Mobile development - Android & iOS
Post by: trev on December 09, 2021, 03:52:28 am
When I retitled and split this thread off from the original, I should probably have added iPadOS to the title. A lot of acquaintances in my older age group have forsaken computers altogether and, while most have mobile phones, it is tablets that have been filling the gap.

It is unfortunate that Lazarus has little, if any, support for these mobile devices, but quite understandable given the volunteer nature of the beast. Even when someone takes up the challenge, there are few early adopters in the existing audience and, I'd guess, that results in such efforts being ultimately abandoned. Yes, it's the chicken and the egg dilemma.

Android development seems to be progressing reasonably with jmpessoa and his LAMW addon, though it could do with better promotion and Wiki documentation.

iOS/iPadOS development seems all but dead: one forum thread in 2019, two in 2020 and one this year.

The harvest is rich, but the workers are few.
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 09, 2021, 08:48:09 am
Android development seems to be progressing reasonably with jmpessoa and his LAMW addon, though it could do with better promotion and Wiki documentation.

Totally agree.  Jmpessoa and team have done a fantastic job for unofficial Android development with Lazarus.  It's because of the success on the Android side that it brings up the question as to what's going on with iOS.

Quote
iOS/iPadOS development seems all but dead: one forum thread in 2019, two in 2020 and one this year.

Maybe because there isn't any officially supported or at least obvious paths to iOS development, like there is on the Android side, that we don't see any talk of it.  It appears from past forum posts that when a more definitive way forward with Android development was shown, it then attracted interest.  "Oh OK, that's how we can do it."  "Hey, I tried your method of building Android apps and it works great." 

There are a number of unofficial and unsupported paths to iOS development with Free Pascal and/or Lazarus.  A former "team member" of jmpessoa, Simon Choi, has clearly shown it's very possible and has been so for awhile.  Some of his blog posts: https://m.blog.naver.com/simonsayz/220485321971 (https://m.blog.naver.com/simonsayz/220485321971), https://m.blog.naver.com/simonsayz/221209784815 (https://m.blog.naver.com/simonsayz/221209784815).  I think the issue was that it wasn't known or "rolled up" into something like LAMW, as what jmpessoa and his other team members did for Android.

There is also the Castle Game Engine (https://castle-engine.io/ (https://castle-engine.io/)), which people might want to notice has now got the attention of Delphi (so who knows what they may be up to).  It's possible to use it for development for both Android and iOS, through OpenGL, but clearly there is more with a game engine than particular developers might be looking for.  And I can't help but to wonder if Lazarus should have/still can do some type of collaboration with him.  What he has done does show another possible path.

If there is no official promotion of such capabilities by Lazarus, then it's arguably fair to say that many people will overlook what it can do.  Probably only the more frequent forum visitors or just through the sheer luck of an Internet search (and keep in mind that Google has its own languages and agenda) that users would come across some bit of information.  It's quite easy to overlook or not mention something that you believe the thing in question is not capable of.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 09, 2021, 10:52:46 am
Whatsapp basically uses your telephone number as your login. Changing that for a desktop app would be massive, but also makes it an exception, and IMHO a bad model for comparison.

I tried to get mobile development to get rolling several times in the company I work for, but in practice the customers really want it, but consider it a nice to have that they don't want to pay for. IOW it faltered already before the divisive discussion about platforms :)
It is highly dependent on the kind of app. For example Uber Eats, even though it has a website, requires you to create your account via their app. Gorillaz the grocery delivery service, is completely only on app. Another great example is Spotify, while it has a Desktop version, the App is much more used.
In many areas you need an app and the desktop version is optional. For example, no one needs a music player that doesn't work on their phone, where most people listen music to. Of course there are other areas where it's the other way around, but the thing is mobile is extremely important, and I think there is no arguing around fact that Lazarus is in dire need of better (and more importantly unified) support for mobile platforms

That said, I have some doubts about single source GUI for mobile and desktop. The form factors and UI culture are simply quite different.
Yes and no. It is of course very different, but there are a lot of things that can be automated. Windows UWP apps, Angular webapps, Xamarin and even FireMonkey already support this quite good with a high degree of automization.
The thing while this works so well is, because mobile apps already need to support different form factors. There is no fixed format for phones. With the new Samsung folding phones, you can have a nearly rectengular screen size. You  need to support tablets and phones in both vertical and horizontal mode, etc. This is actually a problem that already exists since decades in the web. There you need to support all kinds of different monitor sizes, 4:3, 16:9 16:10, 23:9, since the last decade also all the different phone and tablet sizes.
This is both highly supported through the architecture of HTML and CSS, but also dynamic frameworks like Angular are developed to target exactly this problem. Generally speaking, this is a problem that was already successful solved by many different frameworks. I don't see that as really a problem.

It's needed, but don't think JavaScript is all that wonderful.  Let's not forget how widely popular that TypeScript has become, because of the perceived inadequacies of JavaScript.  Then of course you are not usually dealing with just JavaScript, but 2 other "almost languages", CSS and HTML.  Thus the dizzying array of constantly changing and new frameworks to try to tame the "3 headed monster".
Javascript is a terrible language. It was created by one person in a week and afterwards always extended but could never be redesigned as it requires to be backwards compatible to the very first version. The new features are often actually quite nice, but that is the main problem with JS, it has a lot of terrible features and a lot of good features and as a developer you are responsible for only choosing the good features (what of course isn't that easy, especially for beginners). If you like to have a good laugh, watch the talk "Javascript the good, the bad and the ugly".

But that about CSS and HTML5 is not necessarily true. For example many modern web applications are today build with AngularJS. These are fully JS based websites, no single line of HTML is needed (still CSS for styling, but you can also just import existing styles), and is therefore much more comparable to QT or Xamarin GUI applications.

Could you elaborate about Qt5 mobile platform support, as it could possibly pertain to Lazarus mobile development?
I don't know much about how QT is integrated into the LCL, but on Desktop you can basically the QT-Creator to create C++ GUI applications to run on mobile. The QT Creator form editor is a run of the middle WYSIWYG form editor and the applications work on both desktop and mobile. It is probably the closest to how an LCL integration would look like for the user.
But I must admit the last time I used QT is also a few years ago
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 09, 2021, 12:47:43 pm
I've always been torn between whether or not it's wise to have a single language like Object Pascal which is proficient at both application- and system-level programming, or if a split as with VB and VC++ was preferable. Now that so many people demand automatically-managed memory I think I'm moving towards the split approach: Rust (as a specific example) appears to succeed at doing both safely but the cost is having assignment semantics which are rather non-ALGOL.

This is quite an interesting question. I myself think that most of the time manual memory management just introduces unnecessary complexity, especially considering that in most cases, performance (which is the main counter point to automatic memory management) does not really play a role. I often brought this up, but there was this great analysis by Mozilla when they rewrote their CSS engine in Rust, where they analyzed all the bugreports regarding that code, and found that of the 34 bugs tagged as critical security issues, 32 where due to errors in manual memory management (dangling pointers, use after free, etc). So it is clearly very hard to get it right, something everyone seems to have problems with, and when you get it wrong it is a very serious issue.
And I think on some level most pascal developers agree with this, because I've never seen anyone complain that C-Style strings with manual memory management are better then the reference counted pascal strings (same for arrays). And it also shows that it is not that hard to make this work

And this is why I think pascal is an a very weird situation. It tries to be a high level language and a low level language at the same time. We have reference counted strings and arrays, but classes need manual memory management, which is especially weird if you think about that classes already try to go the Javaesque way of hinding the fact that they are pointers in the first place.

A language that manages to incorporate high level and low level concepts simultaniously is C++. For example automated reference counting is done fully on top of already existing language means, by utilizing their stack based classes:
Code: C  [Select][+][-]
  1. auto ptr = std::make_shared<SomeType>(constructor_args);
  2. ptr->somemethod(...);
What also makes this neat in C++ is that you can overload the dereferencing operator, so you can create classes that for the user behave exactly like a pointer, but internally do other stuff like reference counting.
If management operators would be working correctly this could also be implemented (even though we don't have a dereferencing operator).
Another thing I really like in C++ is the usage of references to hide pointers. Similar to var parameters in pascal functions, but with the difference that this can be appied to any type, parameters, variables and even function return values:
Code: C  [Select][+][-]
  1. int &operator [](int index) { return self.items[index]; }
As this returns a reference, you can read and write to it, and also take the pointer. In pascal you would need a getter and setter for the indexed property, and this wouldn't allow you to get a pointer to the underlying memory, which would require another property. E.g. from the Tvector class emulating this behavior:
Code: Pascal  [Select][+][-]
  1.     property Items[i : SizeUInt]: T read getValue write setValue; default;
  2.     property Mutable[i : SizeUInt]: PT read getMutable;
This hides pointers while also still allowing access to them in the rare cases you need them.

But this comes at the cost of complexity C++ is not an easy language to learn and just behind this one line:
Code: Pascal  [Select][+][-]
  1. auto ptr = std::make_shared<SomeType>(constructor_args);
is a lot of complex code that requires a rather advanced understanding of C++.

Other modern languages that have been designed from scratch with high level development in mind, usually don't go this low level route anymore at all. Even languages like Swift that are still compiled "on the metal" languages like Pascal, show how through language design you can combat some of the larger problems and causes of bugs in programming. I really like swift in that regard, even though I don't use that language like at all (I haven't had a mac in years) but it has some really neat new ideas (like optionals at the language level), while also sticking to what has been proven (e.g. static typing). This is the advantage of having to design a language from scratch, something that for "grown" languages like C++ or Pascal is not really possible. But still interesting to consider and I can only recommend for people interested in this sort of stuff to take a look at the language guide: https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html


But with respect to the original question, if it is good to have such an in-between language between very low level C like and high level languages like Swift, I think that this can work out. C++ shows that it is possible, but Pascal is not C++. I think generally Pascal is used in areas more associated with high level languages than C++ and I think the language should reflect this. Because at the moment Pascal targets the use cases usually associated with very High level languages (e.g. RAT GUI development) while still being very low level in use.
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 09, 2021, 01:17:10 pm
I'll keep my comments brief because this wanders away from what is already a somewhat rambling topic.

We have reference counted strings and arrays, but classes need manual memory management, which is especially weird if you think about that classes already try to go the Javaesque way of hinding the fact that they are pointers in the first place.

In the general case, reference counting works well, but once one gets to the lower implementation levels it's possible to define code and structures which fool it necessitating a lot of finalisation code. So mandating it might usefully be one of the distinguishing marks of "Application Pascal", while "System Pascal" allows it to be bypassed and reimplemented by qualified users.

Quote
What also makes this neat in C++ is that you can overload the dereferencing operator, so you can create classes that for the user behave exactly like a pointer, but internally do other stuff like reference counting.

Strongly agreed. But then C++ goes and spoils it by automatic casting: I'd rather see that controlled by a trait system (e.g. a byte has a trait which makes it a compatible lvalue for any other 8-bit type, but an unsigned 8-bit integer does not).

Quote
If management operators would be working correctly this could also be implemented (even though we don't have a dereferencing operator).

Noting that there's a modeswitch for that. I asked about having ^ overloadable, and Jonas was strongly against it. But I believe it works well where there is no automatic casting, and in fact renders a separate reference type largely obsolete (the remaining cases could probably be handled by traits).

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: PascalDragon on December 09, 2021, 01:48:06 pm
In addition, by Lazarus already having LCL-CustomDrawn-Android, it then also creates the expectation to see LCL-CustomDrawn-iPhone.  It could be said that it comes off a bit weird to somewhat embrace Android, but not iOS.

Developing for iOS is more involved than Android as not only you need a macOS computer, but also an iOS device (both of which aren't necessarily cheap). For someone like me for example that would be quite an investment (as I use Linux/Windows and Android) thus I prefer to do that investment somewhere else instead.
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 09, 2021, 02:12:16 pm
Developing for iOS is more involved than Android as not only you need a macOS computer, but also an iOS device (both of which aren't necessarily cheap). For someone like me for example that would be quite an investment (as I use Linux/Windows and Android) thus I prefer to do that investment somewhere else instead.

Wasn't there also something at one point about Apple's policies being actively hostile to anything other than their designated tools?

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: marcov on December 09, 2021, 03:12:40 pm
Thank you for entering the discussion.  Much respect, as I realize it's a bit tricky from your perspective.

...but in practice the customers really want it, but consider it a nice to have that they don't want to pay for...

Maybe refer to the post by Chronos on the 2nd page.  Clearly developers might want to PM him for clarification.

I assume you mean this:

The problem is that more people use mobile and tablets now than desktops. The desktops are more suitable for real work but still most of the people simply have their smartphone with themselves all the time. So inability to target that audience by Lazarus is pretty huge deficiency. Sure, not every development environment support all modes like desktop, mobile, web and console. But with Lazarus we have that expectation "Build once, compile anywhere" which is simply not true for entire mobile segment.

I usually just ignore such statements.  This was all already debunked in the pre IPhone java phone period, and discussions around marketplaces.

There are several problems with this:
[
So basically the global marketplace where every device counts as a potential audience for a 3S (single language, single source, single GUI) apps simply doesn't seem to exist, except in polemics.

Quote
Quote
That said, I have some doubts about single source GUI for mobile and desktop. The form factors and UI culture are simply quite different.

I agree about the form factor and cultural elements involved, but would say there is possibly more at stake.  Mobile is becoming increasingly more important, where more people are going to continue to notice Lazarus hasn't embraced it, and a lot of people would be looking to create applications on both. 

It will be interesting to see what you and Chronos come up with then :)

We have had such discussions umpteen times before, but somehow people don't seem to understand that FPC and Lazarus don't have resources that they can redirect or focus. The developers are volunteers and do what they want.

And this volunteer (which is a bit in repose atm actually) has tried to up sell his customers to both cloud and tablet/phone apps for over a decade, and hasn't generated one single euro revenue from it. I tried to bundle as freebee with higher value SLA contracts, and even that didn't fly. And that was a Delphi licensee with the base technology already there.

People talk the enterprise way, but when it comes to selecting features and stomping up the cash, it suddenly goes in a different direction. Differentiate very carefully between them. As said look at your friends/customers etc phones, and count the number of apps from companies that you can realistically see as "competitors".

If you are in some extreme lucky situation that you actually find one, try to find out what it is made with.

Quote
I don't want to be so "look at them" about it, but other languages and IDEs seem to increasingly be providing both mobile and desktop development options. 

You are begging for a single GUI library solution here. Which of those IDES provide that? IOW which also leverage their prime native desktop solution on mobile ? Does MS support MFC on mobile? Does Delphi support VCL ?

Delphi does in theory with FM, but in reality most customers have dedicate FM GUIs for mobile and good old VCL on the desktop, simply because FM is buggy as hell. Or at least that is what I hear.

Quote
Among what's out there is of course Delphi, and Lazarus is almost automatically going to be compared with it.  Culture is definitely tricky, but at least when it comes to form factors and simulating mobile screens, it appears solvable.  Various IDEs have solutions and even their own simulators for developing on Windows, for both Android and iOS.

Quote
Looking at Lazarus, many can already see the seeds of potential mobile development.  Even if just only the custom drawn interface path, there is LCL-CustomDrawn-Android, so that there isn't LCL-CustomDrawn-iPhone seems a bit odd.  Moving in only that direction would seem helpful.

Are customdrawn apps acceptable on phones INYO? Good chance that they won't even be accepted into the IPhone store if there is only one little thing a bit off, look and feel wise. Delphi just fixes such issues continuously, financed  from your next year's subscription, but I think a FPC/Lazarus devel would burn out after two years. This simply is not sustainable.

I think there is a future for a good customdrawn backend for various solutions, as a zero order fallback solution for various reasons. But finding somebody to put in the time is the difficulty. I also don't expect such solutions to compete with IDEs sponsored by Fortune 500 companies and Embarcadero (  ;) ) any, any time soon.

(QT)

afaik mobile is based on QT quick, while lazarus does old fashioned QT


In summary, I don't see a practical route to something like that. We can't develop fast enough, and the solution will require permanent heavy duty maintenance to keep up with the yearly iterations. Moreover we already have a shortage of interested developers for even the rock bottom solution (customdrawn/lamw, the latter which is the labour of love of one developer).

I can be wrong of course. Maybe one of you has a 10 person team in his pocket just chomping at the bits to contribute :-)
Title: Re: Mobile development - Android & iOS
Post by: marcov on December 09, 2021, 03:25:01 pm
When I retitled and split this thread off from the original, I should probably have added iPadOS to the title. A lot of acquaintances in my older age group have forsaken computers altogether and, while most have mobile phones, it is tablets that have been filling the gap.

How many have custom applications made by SMB on them other than maybe games?
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 09, 2021, 03:37:25 pm
How many have custom applications made by SMB on them other than maybe games?

I think that's the really important thing, or possibly rephrased to include larger-scale corporates known to be using Delphi.

My own 'phones have the UK's COVID tracker app, GPS and smartwatch interfaces, and some network testing stuff... and that's about it as far as graphical apps are concerned.

I can certainly imagine using a tablet rather than a laptop for on-site device access... but even then the lack of a physical keyboard would make it less than attractive. Apart from that my use is mainly using SSH or VNC to access remote systems if I'm away from my office.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 09, 2021, 06:35:08 pm
Developing for iOS is more involved than Android as not only you need a macOS computer, but also an iOS device (both of which aren't necessarily cheap). For someone like me for example that would be quite an investment (as I use Linux/Windows and Android) thus I prefer to do that investment somewhere else instead.

Understand the situation.  Difficult to develop for hardware that one doesn't possess.  So, are you also saying that yourself or possibly other developers might need macOS and iOS devices provided or donated by the Lazarus community in order to actively support mobile development for iOS?  It appeared that Chronos made an offer (page 2), that maybe should be discussed with him by PM.

Nah, Windows is here to stay, it could be in some areas overtaken by Android, but in many domains there is no chance. One huge advatage of windows is that it is backwards compatible to the stone ages, so if you look for example into the critical infrastructure sector: Hospitals, Powerplants, etc. they are still using software from multiple decades ago and this is only possible because of Windows. Android is based on Linux, which is famous (well more the GLIBC rather than linux itself) to switch up abis to make it not backwards compatible.

While I agree that Windows will be with us for many years to come, a lot has to do with Microsoft's hold on being used in the business world (thanks to Microsoft Office).  But, let's not forget that Microsoft Office is in the cloud and are apps that can run on Android and iOS.  I do think the percentage of Windows OS dominance on the desktop and/or for general use will dwindle.  When it comes to personal computing, a lot of people are relying on their phone and have become used to Android and iOS apps.

Let's also not forget that Windows 11 can run Android apps.  Microsoft knows what's up, and wouldn't be doing such unless necessary.  By the way, for those that get pulled into Google's Chrome OS, the lure of running Android apps is a strong part of it.  I do think that at some point, with so many people already having Android phones and being used to it, a push will happen to move over to Android.  I know many people that simply own an Android phone for all their personal computing.  They touch Windows because their company gave them a laptop or tablet with it, and must use for work.

Even in the context of the work laptop or tablet, there is a strong push to put everything on the cloud (company secrets and security be damned).  In the cloud context, the hardware and OS could easily be some cheap Android, Linux, or even Chrome OS.  "Windows", as we know it, could become more like using another app or seen as something you have to log into because "forced to" for work or certain jobs.

Which of those IDES provide that? IOW which also leverage their prime native desktop solution on mobile ?

I didn't want to get into naming such, because don't want to promote others (and I prefer Object Pascal).  Various game engines provide the ability to develop apps on the desktop for Android and iOS.  An example is Solar2D (that has their own built-in simulator) in the Lua world (which comes with the limitations of scripting), which can be somewhat compared to the Castle Game Engine for Object Pascal.  Solar2D does have the advantages of at one time being commercial, before becoming open source.  Various game engines lend themselves towards also being useful for creating apps which are not just games.  Of course the baggage of a game engine would not be ideal for many developers, but that's a depends type of thing.  Another example is B4X, a Basic and Java hybrid, that somewhat compares to Delphi and Lazarus.  They provide a solution for both desktop and mobile development, but both Delphi and Lazarus are superior for desktop app creation in comparison.  They are a mix of freeware and payware.  Arguably, another downside to their approach is it's more of a soft transition into the Java world, whether the user realizes it or not.

I'm not saying that Lazarus should have a single comprehensive solution for both desktop and mobile development, but rather I'm making the case that it would be better that it did have a more advertised solution for iOS development or embrace mobile development.  Would like to see that there is some kind of recognized iOS solution, which would help public perception of Lazarus, and those that like Pascal and want to add mobile development along with doing so for desktops.

As I gave examples from Simon Choi's blog, iOS development with Free Pascal and Lazarus is clearly possible (in addition to game engines like Castle), but this is like something "under the table".  As it is, we have a recognized unofficial Android solution (LAMW/Laz4Android), so it looks quite "half way".  In addition, the comparison between Delphi and Lazarus is almost unavoidable, so there is no hiding that people will look at mobile along with desktop.  Lazarus has been and is associated with the expression, "write once, compile anywhere".
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 09, 2021, 07:11:26 pm
You are begging for a single GUI library solution here. Which of those IDES provide that? IOW which also leverage their prime native desktop solution on mobile ? Does MS support MFC on mobile? Does Delphi support VCL ?
Xamarin. Started of as a framework for supporting GUI applications using .Net Core for Windows, Linux and (I think) OSX, and later was expanded to also include mobile apps. Today it is part of Microsofts Visual Studio. And it is actually pretty successfull.

I didn't want to get into naming such, because don't want to promote others (and I prefer Object Pascal).  Various game engines provide the ability to develop apps on the desktop for Android and iOS.  An example is Solar2D (that has their own built-in simulator) in the Lua world (which comes with the limitations of scripting), which can be somewhat compared to the Castle Game Engine for Object Pascal.  Solar2D does have the advantages of at one time being commercial, before becoming open source.  Various game engines lend themselves towards also being useful for creating apps which are not just games.  Of course the baggage of a game engine would not be ideal for many developers, but that's a depends type of thing.  Another example is B4X, a Basic and Java hybrid, that somewhat compares to Delphi and Lazarus.  They provide a solution for both desktop and mobile development, but both Delphi and Lazarus are superior for desktop app creation in comparison.  They are a mix of freeware and payware.  Arguably, another downside to their approach is it's more of a soft transition into the Java world, whether the user realizes it or not.

As you are talking about game engines, another project on my never ending list of things I want to do somewhen when I have free time is to create a godot wrapper for pascal.
Bascially the godot game engine supports to write the game scripts in any language one likes by compiling it to a dynamic library which can be loaded by the game engine.
The FPC supports creating dynamic libraries for all major systems includion Android (this is for example how LAMW works by compiling your pascal code to a library that is loaded by the java interface) and I think also for iOS.
So this would be possible to use pascal to create cross platform games with godot.
Title: Re: Mobile development - Android & iOS
Post by: marcov on December 09, 2021, 07:34:27 pm
You are begging for a single GUI library solution here. Which of those IDES provide that? IOW which also leverage their prime native desktop solution on mobile ? Does MS support MFC on mobile? Does Delphi support VCL ?
Xamarin. Started of as a framework for supporting GUI applications using .Net Core for Windows, Linux and (I think) OSX, and later was expanded to also include mobile apps. Today it is part of Microsofts Visual Studio. And it is actually pretty successfull.

Xamarin is a rebranding of Monodevelop, it targeted Linux before Windows. One can discuss if it is a backport or not, but regardless of how you view it, Mono has had 15+ years of corporate stewardship (Suse/Novell and then Microsoft iirc).

If that is what it takes, we might as well stop now  ;)

But if you are nitpicking, it is not a major target that got extended to Mobile. (that would be .NET WPF). This is more a FMX, set up for portability and then backported to windows.

Various game engines lend themselves towards also being useful for creating apps which are not just games. 

What is their penetration? Is it on your grandma's phone? Does the butcher around the corner use it? Where is the audience ?

Quote
As you are talking about game engines, another project on my never ending list of things I want to do somewhen when I have free time is to create a godot wrapper for pascal.

I wasn't talking about game engines. I was asking for desktop projects that had an established native application platform, and then extended to e.g. mobile based on the same code base. (iow no different GUI library or other paradigm changed that forced to recode, otherwise we might as well argue that LAMW is it)
Title: Re: Mobile development - Android & iOS
Post by: marcov on December 09, 2021, 07:36:30 pm
How many have custom applications made by SMB on them other than maybe games?

I think that's the really important thing, or possibly rephrased to include larger-scale corporates known to be using Delphi.

That is one thing to take away from that beast of a post. The other key one is that hybrid approaches might not be well accepted in e.g. stores in the first place.

Finally the third truth is that even if you agree on the target(e.g. VCL apps on mobile), the route to it is a problem too. If it takes too long, the mobile world might already fundamentally changed before it is ready.

And then there is of course the final blow to any feature discussion: Who is going to do it?
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 09, 2021, 07:49:54 pm
Finally the third truth is that even if you agree on the target(e.g. VCL apps on mobile), the route to it is a problem too. If it takes too long, the mobile world might already fundamentally changed before it is ready.

That's interesting- and scary. Slightly earlier in the thread somebody suggested that Windows had largely stagnated with stable APIs etc.: will the mobile APIs similarly stabilise, or are there quite simply too many people working on them with too many different approaches for that to ever happen?

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 09, 2021, 07:59:25 pm
Xamarin is a rebranding of Monodevelop, it targeted Linux before Windows. One can discuss if it is a backport or not, but regardless of how you view it, Mono has had 15+ years of corporate stewardship (Suse/Novell and then Microsoft iirc).
Not quite Monodevelop used GTK# for Forms. It then added the Xamarin GUI framework as an alternative to GTK#. This was the framework I was talking about, not the IDE. Later the IDE was rebranded Xamarin and later again it was bought my MS and incorporated into VS.

And the framework wasn't so long lived. This was the hot new stuff when I was using .Net I don't remember exactly when but probably so 2012ish or so and it only took a few years until they started with their mobile solution and it took of quite fast.
Title: Re: Mobile development - Android & iOS
Post by: marcov on December 09, 2021, 08:52:20 pm
Finally the third truth is that even if you agree on the target(e.g. VCL apps on mobile), the route to it is a problem too. If it takes too long, the mobile world might already fundamentally changed before it is ready.

That's interesting- and scary. Slightly earlier in the thread somebody suggested that Windows had largely stagnated with stable APIs etc.

Stagnated sounds like it is a bad thing. IMHO it is something to strive for.

Quote
will the mobile APIs similarly stabilise, or are there quite simply too many people working on them with too many different approaches for that to ever happen?

I think there is simply no motivation to do so. That is also why e.g. Linux never developed stable applications APIs, as most applications are in servers, and Linux desktop is mostly for the hobbyist and a few power users and academics.

APIs are used as vehicles for platforms, which are as quickly abandoned  or mutated for the next best thing as they were created. I don't see any change coming short term in this, the driving force to bring about such change is simply not there, and life cycles are still shortening.
Title: Re: Mobile development - Android & iOS
Post by: Chronos on December 09, 2021, 10:05:48 pm
In summary, I don't see a practical route to something like that. We can't develop fast enough, and the solution will require permanent heavy duty maintenance to keep up with the yearly iterations. Moreover we already have a shortage of interested developers for even the rock bottom solution (customdrawn/lamw, the latter which is the labour of love of one developer).

I can be wrong of course. Maybe one of you has a 10 person team in his pocket just chomping at the bits to contribute :-)

Well then, perhaps you don't see it because you are blind to new approaches :) I think we don't really need those kind of comments here. I saw them over years too many times. Sure, everything is hard, too time consuming or even impossible. We already know that. Let's discuss how to overcome those obstacles and weight various strategies to solve the problem. Let it be just open discussion with new ideas or revised old ideas. Everybody tried to tell to Elon Musk that it is impossible to start a new car company or to start new rocket factory. https://www.youtube.com/watch?v=k9zTr2MAFRg

Back to the topic. Mobile platform is used more than desktop now and your numbers may vary but that is the fact https://gs.statcounter.com/platform-market-share/desktop-mobile-tablet Sure it depends if one is interested in mobile "market" or not. As I use my Android device daily, I really want to use my own applications or other open source applications which are available for desktop also on my phone. Sure, we can discuss many years about GUI differences between desktop, mobile and web. Every technology has own specifics and pros and cons. I even want to target Smart TV as a platform. We have Android TV at our home and I can't simply create an application for that TV using Lazarus/FPC. There are some alternative ways. I tried to use LAMW before and that is not the way how we want to develop application for all those platforms. At least not in direct and unified way. With Delphi FMX you can create mobile and desktop app with single code base. There will always be some platform specific things but normally it should be pretty easily possible. Delphi is kind of expensive and doesn't run on Linux so it is not an option for me.

And even it that would not be single application for those platforms, still Lazarus as IDE should offer ways to create mobile, desktop, web, console, tv, car, e.g. as separate applications. Just imagine an dialog window called "New project" where you can select needed GUI layout or possibly select generic dynamic layout. This ideal thinking is more like from top to bottom. That is the premise. To have development environment to allow develop an application/service/library/tool for any platform and GUI layout. That is where we can get in some distant future.

Back to reality. How can Android application be currently created? By quick check of existing Android related wiki pages https://wiki.freepascal.org/Portal:Android I can say that it is quite a mess. A lot of long and some outdated tutorials with many manual steps and auxiliary GUI tools to do a simple thing. To build GUI application. Can it be as simple as creation of a new project and hitting F9 to run in Android emulator? Or without emulator at least to simply compile and create Android package apk. Also you may need trunk FPC or Lazarus, anything can break and will probably break. Upgrade to newer Lazarus and FPC will probably break everything and one will need to do that again. Does it look like only to me as a big waste of time? Would it be better to start implementing partial Android/mobile support directly into IDE? Perhaps as an experimental feature which can be activated from somewhere. Sure, I can answer this by myself, this would take too much effort and there are no volunteers, so whatever.

Ok, Lazarus IDE can't support Android directly so what are other options apart from LAMW and other obscure ways described on wiki?

I understand that there are many other Lazarus weak areas like to this date not implemented single window docked IDE like Delphi has (AnchorDocking is just a poor guy alternative). Also Gtk3, Gtk4, Qt5 or whatever new toolkit version not fully supported. This is never ending effort to catch up with upcoming technologies and ever changing world. But this topic is about Mobile development and in this regard Lazarus is lacking.

We are just community of users so we can try to solve things in our way. We are glad for all work done on Lazarus and we thank to all involved core developers for their effort.
To all, feel free to post your constructive opinion and ideas how to solve this issue.
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 09, 2021, 10:28:28 pm
I think Chronos has summed the situation up fairly well. If nothing else, the community needs definite feedback from the Lazarus team as to what they consider to be the leading or at least viable approaches to the problem.

And the wiki urgently needs to be cleaned up to reflect that consensus.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: trev on December 09, 2021, 11:14:49 pm
When I retitled and split this thread off from the original, I should probably have added iPadOS to the title. A lot of acquaintances in my older age group have forsaken computers altogether and, while most have mobile phones, it is tablets that have been filling the gap.

How many have custom applications made by SMB on them other than maybe games?

If I inventory my iPad added apps: Kindle, Google Maps, Weather (SMB), TramTracker (SMB) , TV Catchup x5 (SMB?), Termius (SMB), Flight Radar (SMB), Google Earth, Local Library eBook service (was Zinio, then RB digital, now Libby), Ping (SMB), Zoom, AdBlock (SMB), ONO (UNO card game - SMB).
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 10, 2021, 02:06:48 am
Everybody tried to tell to Elon Musk that it is impossible to start a new car company or to start new rocket factory. https://www.youtube.com/watch?v=k9zTr2MAFRg
A bit off topic, but Musk didn't start any of these companies, he bought them.

But let's go to the meat of your post:

  • Implement Delphi compatible FMX framework for FPC. After all, Delphi needed to solve the same problem. VCL was too Windows oriented and they could either break VCL compatibility to extended it to be usable across new platforms or to create(or buy) completely new more modern GUI framework. For sake of existing customers they decided to go with new framework. So in case of Lazarus and LCL this decision still needs to be done.
If you make it delphi compatible, you repeat the same mistakes Delphi made. I already said why I think Firemonkey is not a good solution, but to reiterate just one point. Most modern frameworks use CSS for styling like QT, JavaFX or Xamarin. CSS is powerful, well designed (by an expert comittee) and refined over multiple decades, and it is well known. There are much more resources available than for Firemonkey. If you need a special style, chances are there already exist CSS style sheets for that somewhere on the web.
Firemonkey is not that well designed, pretty hard to learn and has a community not nearly as large as CSS. Don't try to reinvent the wheel. To go to your Musk analogy, the SpaceX Falcon 9 does not really use new concepts. The concept of a reusable rocket that does a belly flop to land on it's back is an approach already developed by NASA a few decades ago, and simply combines it with modern engineering techniques, materials and computational power that wasn't available back then to make it feasable.
Take good existing ideas and embrace them, don't try to make your own thing if there are already solutions out there.

  • Develop desktop app in Lazarus and mobile variant for Android and iOS in Delphi. How to sync GUI between those two environments? That is the tricky part. Perhaps one can create some Lazarus LCL to Delphi FMX converters. Or create LCL backend to target FMX as widgetset.
Then you can ask yourself the question, if I am already paying 150€/month to use delphi, why should I use Lazarus in the first place? One reason that I think is why many people use Lazarus is because they believe Delphi is not worth that money.
  • Another way to solve this would be to create some cross-compiler or better say transpiler to convert pascal code into code of other platforms which support Android/iOS. It may be Java, Kotlin, C++ or something else. This may not be just about language but also about GUI frameworks. That would be pretty complex and time consuming task but it is possible.
There is already Pas2JS which you can use with Cordova to create cross platform apps. Also LAMW works in a similar way, it basically auto-generates a Java GUI which communicates with a pascal backend. So all the GUI stuff is autogenerated Java.
  • Create complete new more modern Object Pascal/Delphi compiler to target multiple platforms. Indeed, not and easy task. But still one of way to achieve that. Over the years there were many Pascal compilers developed and new are still created to some degree. One example would be https://wiki.freepascal.org/Projects_using_Lazarus_-_Developer_utilities#PicPas which supports only limited pascal syntax and no GUI design support, but it is still pascal compiler. The list of other compilers https://pascal.fandom.com/wiki/List_of_compilers_and_interpreters
You misunderstand the problem the compiler (the FPC) already does fully support iOS and Android development. It's a library problem, that there is no GUI library available. There is absolutely no reason why a new compiler would be needed.
  • Use Linux phone instead of Android. Linux phones are still slow, not fully functional, not widely available and they are expensive. But this may change in future. https://www.pine64.org/pinephonepro/
I actually used different Linux systems phones multiple times. I even bought used phones specifically for testing out different systems. They are completely unusable at the moment. I've found the best usability was to have another phone you can use to ssh into them to use the Linux phone.
This is a completely non solution, because maybe then you are able to develop for your phone, but that phone not being usable also makes your apps unusable

Generally, I think we should try to get a solution to this problem. I know that most people might not have the time or proficiency to do any development in these areas, but one solution might be to utilize the already existing Free Pascal and Lazarus foundation to collect donations for the implementation of such a project.
For example in your list above you mentioned using a transpiler. Well there is actually currently a project for integrating electron app development into Lazarus using pas2js: https://foundation.freepascal.org/projects/thread-pool-implementation
Electron works well on all major platforms, including mobile, so this is an effort theoretically anyone could support even without the corresponding skills and time.

Personally when participating in this discussion I looked a bit into the widgetset system and how such a thing would be implemented. And I had a new idea, which I just added to my pile of project ideas, to create an LCL widgetset based on a browser interface. Where the Pascal app connects to a javascript client in the browser via websockets and gets notified about events over this channel and can instruct the javascript to update the browser.
With a first glance at how widgetsets are implemented this does not seem so complex, at least creating a small proof of concept whith only a limited number of controls and supported events.
Such a solution could be deployed as an android or iOS app using a browser frontend and the Pascal app compiled as dynamic library in the backend. Maybe, when I have some free time at the end of this year, I might come around to try and do this.
Title: Re: Mobile development - Android & iOS
Post by: malcome on December 10, 2021, 03:19:55 am
Will you challenge to fight the Flutter created by Google?
I want the hot reload like Flutter! That is awesome.
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 10, 2021, 04:47:02 am
Will you challenge to fight the Flutter created by Google?

I alluded to this in a previous post, as to what Google was doing with some of their "pet" languages, but the "cat is out of the bag" on this.  Flutter is another one, that can do desktop and mobile development.  They appear to have taken the custom drawn approach, and that's worked for them.

If you make it delphi compatible, you repeat the same mistakes Delphi made. I already said why I think Firemonkey is not a good solution...

Google's Flutter took a different route, and it's working for them. 

As for Delphi's FireMonkey, have to strongly disagree with your assessment.  FireMonkey has been arguably a success for Delphi or at least it can be acknowledged as a good move by them to use as a mobile solution.  It put them very much into the mix of mobile app creation.  Delphi's true issue with FireMonkey is they bought it from somebody else, versus creating it in-house, thus they had to shoehorn it into their existing product.  The Lazarus team have the advantage of "20/20 hindsight", so can correct mistakes that FireMonkey has made, in addition to if they went that route then it would be their in-house solution that they developed.  What they would create, would likely more smoothly fit the Lazarus IDE and ways of doing things.

Delphi is part of the larger Pascal community.  It will be mostly Pascal users and supporters that will likely be using Lazarus, so will be wanting the Pascal language to be in the forefront of possible solutions on mobile platforms.

Quote
There is already Pas2JS which you can use with Cordova to create cross platform apps. Also LAMW works in a similar way, it basically auto-generates a Java GUI which communicates with a pascal backend. So all the GUI stuff is autogenerated Java.

Here, I'm in agreement with you that creating Pascal to "other language" transpilers are a viable solution.  But, an essential point about this is that Pascal is the 1st class citizen, and that the transpiler is for leveraging existing knowledge and code to extend capabilities.

Cordova and PhoneGap are not attractive to many, which is why Smart Pascal has arguably stumbled.  It's not ideal to be relying on 3rd party solutions to get us the end goal of creating a mobile app versus more directly using Pascal and Lazarus to achieve that goal.  Other solutions in various programing languages/IDEs (Lua, Flutter, C#, B4X, Delphi, etc...) are providing solutions with their language and IDE to get on mobile platforms.

Quote
...create an LCL widgetset based on a browser interface. Where the Pascal app connects to a javascript client in the browser via websockets and gets notified about events over this channel and can instruct the javascript to update the browser...

Arguably, the JavaScript/HTML/CSS/browser route is best suited for web developers heavily involved and invested in that world.  And, there is an avenue for creating HTML5 applications already, which is Pas2JS or Smart Pascal.  That there is more that can be done with Pas2JS, I very much agree.  Not against web technologies, just saying that it's a different perspective for a desktop programming language to specifically make use of it when adding to what they are doing, versus being a web developer of that world where JavaScript is the primary language and are seeking to extend it's reach from browsers to desktop and mobile.

It could be said that a more "Pascal way" would be to target the OS directly for mobile app creation.  Keep in mind that this philosophy, and being closer to the metal, can extend to other lesser known OSes, hardware, robotics, etc...  It would be more aligned to the already existing ways to create desktop Lazarus applications for Windows, Linux, and macOS.  You are then leveraging the existing IDE and know how to create an app for Android and iOS.  When the Free Pascal and Lazarus community are bringing newbies and beginners in, it's to teach them Object Pascal and what they can do with it, not to undermine or pollute that path with other vastly different languages, contradictory approaches, or force them to rely on 3rd party solutions that has nothing to do with and no connection to Lazarus.
Title: Re: Mobile development - Android & iOS
Post by: Mr.Madguy on December 10, 2021, 07:30:48 am
Oddly, nick1965's complaint about trying to use Lazarus for Android has a small bit of legitimacy.  Don't get me wrong, in no way am I excusing being rude or a user not taking the time to read help documentation (including wiki).  The angle that I'm talking about has to deal with expectations, and arguably the Lazarus team should be aware of such.  Ignoring that people would want to develop mobile applications for Android and iOS is strange.  Delphi has positioned itself where it's not just for the desktop, but also for mobile.  People who would be looking at Lazarus as a potential alternative, would obviously be considering this when making comparisons and decisions.
I don't want to blame anybody, but unfortunately this isn't about FPC/Lazarus only, but about whole open source. It's hobby for maintainers and they think about their own goals only - they don't accept requests from other people. And that's, what paid companies usually do - they want to satisfy as many clients, as possible. If you need something - you should do it yourself. I personally don't like it and also think, that it's real reason, why open source stagnates. Because it's obvious, that it would be much easier for maintainer, who already has lots of experience in developing this project, to implement required changes. And it would be counter-productive for me to learn everything about project from scratch to implement my own changes. Yeah, old version of Delphi has some limitations and even bugs. But it isn't worth it for me to start learning everything about FPC/Lazarus development in order to add several missing features to it. Not everybody, who needs to just hammer a nail, should know everything about making hammers.

Current FPC problems:
1) Closures. They're callbacks with arbitrary data, bound to them. Overall if one wants to pass arbitrary data to callback - he needs to declare structure or object and pass pointer to it to callback. Or implement it via interface. But it just lot of extra work, that makes code less readable. Closures solve this problem. They're actually just syntax sugar around "procedure/function of interface". My project has over 11k test cases. Massive amount of work has been required to implement them. Therefore their code should have been as minimal, as possible. Rewriting this code using ordinal callbacks or interfaces would result in 2..3x project code bloating.
2) Project groups. They aren't about bath compiling only. They provide shared compiling, project options and debugging. They're very useful, when one has solid project, but it's split into several modules.
3) Runtime packages. They are similar to C++ runtime. Delphi/Lazarus project are so huge exactly because each module contains it's own copy of all packages, it requires. Example: size of my project without runtime packages - 55Mb, with runtime packages - 36Mb, including 15Mb of shared packages, i.e. project itself - is just 11Mb. More modules project has - bigger difference is.

Not FPC problem, but Delphi problem, that encourages me to migrate to Lazarus:

Problems with implementing several interfaces via same object without using crutches like aggregated and delegated objects, that bloat code and waste memory. I use interfaces to avoid multiple inheritance problem, that would be "natural" solution. I really hate to use crutches to avoid language limitation. Programming language should be like IRL language. Everything should be expressed naturally. Unnatural constructions break your brain and waste your time. That's why script languages are becoming more and more popular today, despite of being slow and wasting memory.

This one is allowed in Delphi:
Code: Pascal  [Select][+][-]
  1.   TMyInterface = interface
  2.     procedure DoSomething(I:Integer);overload;
  3.     procedure DoSomething(S:String);overload;
  4.   end;
  5.  
  6.   TMyObject = class(TInterfacedObject, TMyInterface)
  7.     procedure DoSomething(I:Integer);overload;
  8.     procedure DoSomething(S:String);overload;
  9.   end;  
  10.  
If I remember correctly, this one isn't allowed:
Code: Pascal  [Select][+][-]
  1.   TMyInterface = interface
  2.     procedure DoSomething(I:Integer);overload;
  3.     procedure DoSomething(S:String);overload;
  4.   end;
  5.  
  6.   TMyInterface1 = interface(TMyInterface)
  7.   end;
  8.  
  9.   TMyInterface2 = interface(TMyInterface)
  10.   end;
  11.  
  12.   TMyObject = class(TInterfacedObject, TMyInterface1, TMyInterface2)
  13.     procedure DoSomething1(I:Integer);overload;
  14.     procedure DoSomething1(S:String);overload;
  15.     procedure TMyInterface1.DoSomething = DoSomething1;
  16.     procedure DoSomething2(I:Integer);overload;
  17.     procedure DoSomething2(S:String);overload;
  18.     procedure TMyInterface2.DoSomething = DoSomething2;
  19.   end;  
  20.  
And even if I don't use overloading, some bugs sometimes happen in Delphi, when it complains about missing method implementations, if project is recompiled - not rebuilt.

I would also implement some other features, related to multiple inheritance and virtual runtime object assembling, but they aren't necessary for now.
Title: Re: Mobile development - Android & iOS
Post by: marcov on December 10, 2021, 10:31:38 am
Well then, perhaps you don't see it because you are blind to new approaches :)

Citing global mobile numbers are not new approaches. We have heard that kind of drivel since 2005-2008. 

Let's discuss how to overcome those obstacles and weight various strategies to solve the problem.

We can discuss forever of course about how something realistic would go. I personally think shared GUI with desktop is a dead horse.  Too complicated, too many things holding you back if you have to anticipate on fast moving mobile platforms.

Keep in focused and as narrow in scope as possible to be able to "quickly'  (as in years rather than decade+) have something, while minimize the effort to keep it working. (all energy put into maintenance can't be used for new features/targets etc)

Quote
Let it be just open discussion with new ideas or revised old ideas. Everybody tried to tell to Elon Musk that it is impossible to start a new car company or to start new rocket factory. https://www.youtube.com/watch?v=k9zTr2MAFRg

That's the spirit and good out of the box thinking!  If you are comparable to Elon Musk, the problem is solved!  Just buy Embarcadero,.. At a rumoured mere 60million it is a steal and probably will be cheaper than most of Musk's adventures.

Quote
Back to the topic. Mobile platform is used more than desktop now and your numbers may vary but that is the fact https://gs.statcounter.com/platform-market-share/desktop-mobile-tablet Sure it depends if one is interested in mobile "market" or not. As I use my Android device daily, I really want to use my own applications or other open source applications which are available for desktop also on my phone.

But how representative are you for the numbers counted in that stat counter. I'd be surprised if it is 0.1% to be honest.

Quote
Sure, we can discuss many years about GUI differences between desktop, mobile and web. Every technology has own specifics and pros and cons. I even want to target Smart TV as a platform.

If it is a fantasising contest, don't forget the smart watches!

Quote
With Delphi FMX you can create mobile and desktop app with single code base. There will always be some platform specific things but normally it should be pretty easily possible. Delphi is kind of expensive and doesn't run on Linux so it is not an option for me.

But FMX was designed with that step in mind. I assume the same for Xamarin, which was in my post I talked about platforms that were expanded to mobile when the original target was already established.

Quote
And even it that would not be single application for those platforms, still Lazarus as IDE should offer ways to create mobile, desktop, web, console, tv, car, e.g. as separate applications. Just imagine an dialog window called "New project" where you can select needed GUI layout or possibly select generic dynamic layout. This ideal thinking is more like from top to bottom. That is the premise. To have development environment to allow develop an application/service/library/tool for any platform and GUI layout. That is where we can get in some distant future.

Yeah, adding menu options, THAT is the hard part. Seriously, the IDE integration and designer can be done if the proof of concept library is there. You need to start from the ground up. The first step is getting access to the target, but since LAMW does, that is  done.

The next step is not IDE work, but building a cross-mobile library and to further build and ease access to these mobile targets. (as in: conceptually ie. on the commandline). Like making it easier to get the relevant stuff (vendor libraries, like Android SDK) installed, managed multiple targets (fat binaries) etc.

Crosscompiling to iOS is afaik complicated from non Apple systems since Apple doesn't really encourage it.

Quote
Back to reality. How can Android application be currently created? By quick check of existing Android related wiki pages https://wiki.freepascal.org/Portal:Android I can say that it is quite a mess. A lot of long and some outdated tutorials with many manual steps and auxiliary GUI tools to do a simple thing. To build GUI application. Can it be as simple as creation of a new project and hitting F9 to run in Android emulator? Or without emulator at least to simply compile and create Android package apk. Also you may need trunk FPC or Lazarus, anything can break and will probably break. Upgrade to newer Lazarus and FPC will probably break everything and one will need to do that again. Does it look like only to me as a big waste of time? Would it be better to start implementing partial Android/mobile support directly into IDE? Perhaps as an experimental feature which can be activated from somewhere. Sure, I can answer this by myself, this would take too much effort and there are no volunteers, so whatever.

There currently is only the LAMW guy and a circle of occasional contributors around him. But yeah, simply starting to investigate and building out that target would be a logical first step. For any of the suggest solutions.

But simply using and documenting the stuff that is there is a first step, to get more intermediate users to access the target. Then maybe some investigation to how a cross-mobile library would look like.

Quote
Ok, Lazarus IDE can't support Android directly so what are other options apart from LAMW and other obscure ways described on wiki?

Commandline compiling. I did try once for my i386

Quote
Implement Delphi compatible FMX framework for FPC. After all, Delphi needed to solve the same problem. VCL was too Windows oriented and they could either break VCL compatibility to extended it to be usable across new platforms or to create(or buy) completely new more modern GUI framework. For sake of existing customers they decided to go with new framework. So in case of Lazarus and LCL this decision still needs to be done.

There are several problems with that.

That was the point of my last mail. Keep it realistic, both the audience and ambitions. It took decades to duplicate the VCL to a somewhat acceptable level.

Quote
Develop desktop app in Lazarus and mobile variant for Android and iOS in Delphi. How to sync GUI between those two environments? That is the tricky part. Perhaps one can create some Lazarus LCL to Delphi FMX converters. Or create LCL backend to target FMX as widgetset.

If you must buy Delphi, why bother with Lazarus at all? Just do the desktop app in Delphi/FMX

Quote
  • Another way to solve this would be to create some cross-compiler or better say transpiler to convert pascal code into code of other platforms which support Android/iOS. It may be Java, Kotlin, C++ or something else. This may not be just about language but also about GUI frameworks. That would be pretty complex and time consuming task but it is possible.
I don't really think language is that much of a problem. The problem is creating a layer over multiple very different systems. (iOS, Android and Desktop and then some various incarnations (TV/tablet/phone).

That said, android can be done natively (ARM or i386 machinecode, perhaps RiscV in time), but also via ppcjvm, and to some lesser degree pas2js.

Quote
  • Create complete new more modern Object Pascal/Delphi compiler to target multiple platforms. Indeed, not and easy task. But still one of way to achieve that. Over the years there were many Pascal compilers developed and new are still created to some degree. One example would be https://wiki.freepascal.org/Projects_using_Lazarus_-_Developer_utilities#PicPas which supports only limited pascal syntax and no GUI design support, but it is still pascal compiler. The list of other compilers https://pascal.fandom.com/wiki/List_of_compilers_and_interpreters

So now we going from unrealistic to unicorn territory.

Quote
  • Stop using Pascal and use different better tool to create mobile/desktop application. One interesting open source project is Haxe https://haxe.org/use-cases/ which can also target desktop and mobile platforms. Although still not ideal. There are so many technologies which tries to solve that multi-platform problem. Mobile apps can be developed with C#/.NET, Python, JavaScript and many others. I am not aware of any what would fulfill all my needs. So I am still using Lazarus.

Since you are still here let's assume that that is not an option.

Quote
  • Use Linux phone instead of Android. Linux phones are still slow, not fully functional, not widely available and they are expensive. But this may change in future. https://www.pine64.org/pinephonepro/

First you cite global sales in the billions, and then you want to use those to justify an extreme niche target that probably will never fully come to fruition  I'm still waiting for Linux on the desktop to dominate. Let's hold off dreaming of it dominating Phone hardware ;-)

Quote
I understand that there are many other Lazarus weak areas like to this date not implemented single window docked IDE like Delphi has (AnchorDocking is just a poor guy alternative). Also Gtk3, Gtk4, Qt5 or whatever new toolkit version not fully supported. This is never ending effort to catch up with upcoming technologies and ever changing world. But this topic is about Mobile development and in this regard Lazarus is lacking.

Open door.

But the question what is sane to pursue?  Even if we forget about who will do it, all you name here are pretty far out, and would require complete teams, not one or two interested parttime volunteers.

The only realistic direction  that I see would be to start something to just bridge Android/iOS based on some general FMX principles (without compatibility, too much hassle) or LCL customdrawn. (more headstart, but somewhat outdated). Or fully new with more CSS like approach, like Warfley advocates. (I'm no fan of that, but don't know enough about the praciticalities of such approach)

[/list][/list]
Title: Re: Mobile development - Android & iOS
Post by: marcov on December 10, 2021, 10:39:02 am
n, if I am already paying 150€/month to use delphi,

(does that figure include the mobile option, or is that extra?)
 
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 10, 2021, 10:49:38 am
(does that figure include the mobile option, or is that extra?)
Windows macOS and Mobile. Only Linux requires the bigger package and its around 330€/month.
Title: Re: Mobile development - Android & iOS
Post by: marcov on December 10, 2021, 10:54:31 am
(does that figure include the mobile option, or is that extra?)
Windows macOS and Mobile. Only Linux requires the bigger package and its around 330€/month.

At work I'm still Windows only on Seattle without subscription, but Embarcadero is constantly threatening to no longer allow more activations, so probably sooner or later I'll have to go on subscription.
Title: Re: Mobile development - Android & iOS
Post by: dseligo on December 10, 2021, 10:59:36 am
The new version is still in beta and the old version is not a real app. It's a slim interface that connects to your phone. All the messaging functionality is performed by the App on the Phone and the Desktop client has no functionality on it's own. I don't count that as a real desktop version.

Also whatsapp still requires a phone, you can only use the desktop app in addition to an already existing mobile installation.

Well, maybe it's in beta, and it's old version, and it's not a real app, and it's a slim interface, and ... all the rest you've said.
But you also said earlier that WhatsApp is not available on desktop, yet I use it and I found it very useful. And I don't know if it is a real desktop version or not, but it works (and it does that probably for millions of users).
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 10, 2021, 11:27:41 am
Well, maybe it's in beta, and it's old version, and it's not a real app, and it's a slim interface, and ... all the rest you've said.
But you also said earlier that WhatsApp is not available on desktop, yet I use it and I found it very useful. And I don't know if it is a real desktop version or not, but it works (and it does that probably for millions of users).
It isn't a desktop version. It's an interface to your smartphone. Sure it is useful, but whatsapp is still running on your phone. If you turn off your phone your desktop app stops working. You aren't using a desktop version of whatsapp, you are using your phone just through a remote control.
It's like saying I have docker on my phone because I can SSH into my server to execute docker container
Title: Re: Mobile development - Android & iOS
Post by: Mr.Madguy on December 10, 2021, 01:47:52 pm
It isn't a desktop version. It's an interface to your smartphone. Sure it is useful, but whatsapp is still running on your phone. If you turn off your phone your desktop app stops working. You aren't using a desktop version of whatsapp, you are using your phone just through a remote control.
It's like saying I have docker on my phone because I can SSH into my server to execute docker container
I'm not 100% sure, as I haven't checked it myself, but according to some recent news WhatsApp should have full desktop version.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 10, 2021, 02:02:16 pm
I'm not 100% sure, as I haven't checked it myself, but according to some recent news WhatsApp should have full desktop version.
Yes there is one, but it is still in beta. The desktop client has the capabilities, but you need to opt in to the beta to use it (can be done from the whatsapp app).
But this is still not a standalone app on its own, you still need a phone app to authorize the desktop apps. When you disable your phone app, change your phone or simply just reinstall the app on your phone this will also invalidate all the desktop apps. So the desktop app is always just an addon to the mobile app and not a standalone app that can be used on it's own
Title: Re: Mobile development - Android & iOS
Post by: PascalDragon on December 10, 2021, 02:17:52 pm
Developing for iOS is more involved than Android as not only you need a macOS computer, but also an iOS device (both of which aren't necessarily cheap). For someone like me for example that would be quite an investment (as I use Linux/Windows and Android) thus I prefer to do that investment somewhere else instead.

Understand the situation.  Difficult to develop for hardware that one doesn't possess.  So, are you also saying that yourself or possibly other developers might need macOS and iOS devices provided or donated by the Lazarus community in order to actively support mobile development for iOS?  It appeared that Chronos made an offer (page 2), that maybe should be discussed with him by PM.

Ha! No. I have too many topics on my plate already.

While I agree that Windows will be with us for many years to come, a lot has to do with Microsoft's hold on being used in the business world (thanks to Microsoft Office).  But, let's not forget that Microsoft Office is in the cloud and are apps that can run on Android and iOS.  I do think the percentage of Windows OS dominance on the desktop and/or for general use will dwindle.  When it comes to personal computing, a lot of people are relying on their phone and have become used to Android and iOS apps.

You forget one important market: gaming. High end games are available on either the gaming consoles or for Windows (and sometimes macOS), but not for phones. Take for example the various big MMOs like World of Warcraft or Elder Scrolls Online: they only work on PC and Mac (at least WoW works on Mac, don't know about ESO). That is an area that won't disappear so quickly. Also: app development itself. It requires a desktop system (Windows, Linux, macOS, etc.) and can't be done on Android or iOS (yes, I'm aware that there are some possibilities especially on Android, but that's not the point here; big IDEs like Visual Studio, Delphi, Lazarus, XCode, etc. only exist on desktop).

Ok, Lazarus IDE can't support Android directly so what are other options apart from LAMW and other obscure ways described on wiki?
  • Implement Delphi compatible FMX framework for FPC. After all, Delphi needed to solve the same problem. VCL was too Windows oriented and they could either break VCL compatibility to extended it to be usable across new platforms or to create(or buy) completely new more modern GUI framework. For sake of existing customers they decided to go with new framework. So in case of Lazarus and LCL this decision still needs to be done.
  • Develop desktop app in Lazarus and mobile variant for Android and iOS in Delphi. How to sync GUI between those two environments? That is the tricky part. Perhaps one can create some Lazarus LCL to Delphi FMX converters. Or create LCL backend to target FMX as widgetset.
  • Another way to solve this would be to create some cross-compiler or better say transpiler to convert pascal code into code of other platforms which support Android/iOS. It may be Java, Kotlin, C++ or something else. This may not be just about language but also about GUI frameworks. That would be pretty complex and time consuming task but it is possible.

These are not in the scope of the Lazarus project.

  • Create complete new more modern Object Pascal/Delphi compiler to target multiple platforms. Indeed, not and easy task. But still one of way to achieve that. Over the years there were many Pascal compilers developed and new are still created to some degree. One example would be https://wiki.freepascal.org/Projects_using_Lazarus_-_Developer_utilities#PicPas which supports only limited pascal syntax and no GUI design support, but it is still pascal compiler. The list of other compilers https://pascal.fandom.com/wiki/List_of_compilers_and_interpreters

FPC already supports multiple platforms including Android and iOS. So there is nothing that needs to be done regarding the compiler. It's library support that is missing (and in nearly all cases it's always library support that's the problem), in this case it's "LCL-Android" and "LCL-iOS" widgetsets.

I understand that there are many other Lazarus weak areas like to this date not implemented single window docked IDE like Delphi has (AnchorDocking is just a poor guy alternative).

AnchorDocking is the definite docking solution of Lazarus. There is nothing else, because nothing else is required. Sure, there are some bugs still, but other than this nothing more is needed. And it's simply not default, because there are many people that prefer the multi window approach.

Also Gtk3, Gtk4, Qt5 or whatever new toolkit version not fully supported. This is never ending effort to catch up with upcoming technologies and ever changing world. But this topic is about Mobile development and in this regard Lazarus is lacking.

Newsflash: “upcoming technologies and ever changing world” also applies to mobile development.

Generally, I think we should try to get a solution to this problem. I know that most people might not have the time or proficiency to do any development in these areas, but one solution might be to utilize the already existing Free Pascal and Lazarus foundation to collect donations for the implementation of such a project.
For example in your list above you mentioned using a transpiler. Well there is actually currently a project for integrating electron app development into Lazarus using pas2js: https://foundation.freepascal.org/projects/thread-pool-implementation
Electron works well on all major platforms, including mobile, so this is an effort theoretically anyone could support even without the corresponding skills and time.

I take it you mean this (https://foundation.freepascal.org/projects/electron-application-support) instead of the Thread Pool project? ;)
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 10, 2021, 02:41:48 pm
FPC already supports multiple platforms including Android and iOS. So there is nothing that needs to be done regarding the compiler. It's library support that is missing (and in nearly all cases it's always library support that's the problem), in this case it's "LCL-Android" and "LCL-iOS" widgetsets.

I don't think that anybody can realistically blame the compiler for the situation, unless there's some specific requirement to use e.g. a particular build tool and that's in some way incompatible with the FPC philosophy... which is unlikely.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 10, 2021, 02:58:18 pm
As for Delphi's FireMonkey, have to strongly disagree with your assessment.  FireMonkey has been arguably a success for Delphi or at least it can be acknowledged as a good move by them to use as a mobile solution.  It put them very much into the mix of mobile app creation.  Delphi's true issue with FireMonkey is they bought it from somebody else, versus creating it in-house, thus they had to shoehorn it into their existing product.  The Lazarus team have the advantage of "20/20 hindsight", so can correct mistakes that FireMonkey has made, in addition to if they went that route then it would be their in-house solution that they developed.  What they would create, would likely more smoothly fit the Lazarus IDE and ways of doing things.
Yes it was a success for Delphi, but we must be realistic here, a success for Delphi is when people stop using it at a slightly slower rate. That doesn't mean that Firemonkey is a good solution. But what do you think how many people start learning Pascal just to use firemonkey? Well if you go by language popularity measures like the pypl index, Pascal doesn't even make it into the top 30 of most popular languages anymore so this number can't be that high.
So Firemonkey is a success for Delphi because it allows the existing Delphi developers to stick to Delphi (and probably a lot of already existing code) rather than having to switch to a new solution.
But if you are new to App development, the chances that you would choose Firemonkey over alternatives like React are basically 0.
If you look at top lists on what are the most popular languages for developing apps, you see Javascript on rank 1 usually followed by the native languages (Java/Kotlin or swift) and then the other cross languages like C# or C++ with QT. Delphi isn't even considered for most people (sure this also has something to do with the terrible buisness model of embarcadero, which is about twice as expensive as all the competitors, who usually also have a free version).

If I had to develop a mobile App, even if I was given Delphi for free, I wouldn't use it. I would rather use things like React Native, even though I have very little experience with it, because I know how terrible Firemonkey is.

Arguably, the JavaScript/HTML/CSS/browser route is best suited for web developers heavily involved and invested in that world.  And, there is an avenue for creating HTML5 applications already, which is Pas2JS or Smart Pascal.  That there is more that can be done with Pas2JS, I very much agree.  Not against web technologies, just saying that it's a different perspective for a desktop programming language to specifically make use of it when adding to what they are doing, versus being a web developer of that world where JavaScript is the primary language and are seeking to extend it's reach from browsers to desktop and mobile.
The usage of a widgetset is very different from how Pas2JS works. First Pas2JS is different from native objectpascal, simply due to the fact that it mapps onto javascript. For example the Pas2JS classes map onto Javascript classes. But Javascript classes are not classes but dynamic dictionairies so the Pas2JS classes also need to reflect this.
You can't simply translate normal pascal code to Pas2JS, at least nothing that is more than just raw algorithmic code.

The idea behind my solution is that as the pascal user you don't interact with the browser at all. You write native code for your platform and only the forms get displayed on the browser. This has for example the advantage that all the already existing pascal code would work out of the box. For example you could implement  networking with indy, which is not possible in Pas2JS because browser only support HTTP andwebsockets, but because it is native, it could simply use the native socket API.
On the other hand, this would always require a native app to run the pascal code, so unlike pas2js it would not run in the browser.

Pas2JS is it's own solution and not realy a part of the fpc-lazarus ecosystem. What I am talking about is a fpc-lazarus solution that uses the webbrowser simply as rendering engine.

Such a solution would require as much knowledge by the developer about web technology like HTML or Javascript, as you need today knowledge of the QT framework to use Lazarus on Linux (which is absolutely none)
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 10, 2021, 11:50:57 pm
Well if you go by language popularity measures like the pypl index, Pascal doesn't even make it into the top 30 of most popular languages anymore so this number can't be that high.

I wouldn't trust the PYPL data, it doesn't look right or there is bias involved.  The creator appears to have not known that Delphi was a dialect of Object Pascal, until this year.  Let me repeat that, he had this thing up for years, but didn't know such a basic thing.  Then when he was cornered about it and "forced" to combine Delphi and Pascal, clearly all of his historical data is screwed and needs to be recalculated.  That's when Delphi/Pascal (that got combined), which should have got a bump and correction for historical data, suddenly disappeared off his index.  And I think there is just nearly no way in hell that Ada is ranked 17 and kicking the butt of Delphi, Free Pascal, and all the other dialects of Pascal combined (Oxygene, PascalABC, Smart Pascal, etc...).

Just for fun, do a search of Ada on YouTube for tutorials, a very obvious thing to do.  Even if you just search for PascalABC (don't discriminate against Russian), you will be lit up with way more video tutorials than anything for Ada.  And by the way, PYPL's definition of what a tutorial is comes off as vague and confused, thus subject to being interpreted to whatever.

I would trust the TIOBE index way more (where Object Pascal is ranked #16 this month and above Go, Kotlin, Rust...). Which is not saying much, because of how easy it is for the owners to "tip the scale" with their bias or agenda, while getting views.  At least when the TIOBE index owner was confronted that Delphi was a dialect of Object Pascal, he did some grumbling about it, but reconsidered it and adjusted his Index.  Even so, check out TIOBE's "Very Long Term History".  Even though it has the top 15 languages since 1986, some how Pascal is not on there.  Let's think deeply about that for a minute.  He's showing Ada up there, which is not even presently ranked in his top 20, but not Delphi/Object Pascal.  From the late 1970's to 1990's, Pascal was definitely on the map as a top 5 language.  Turbo Pascal and Delphi made a hell of a run by themselves, where they didn't fall off until the early 2000's.  And Object Pascal is still a viable contender when the dialects are combined.

Yet TIOBE doesn't even acknowledge Pascal/Object Pascal in their "historical data", and probably because they messed up the language definitions so badly, where they don't know various compilers and IDEs were dialects of Pascal.

https://youtu.be/Og847HVwRSI (https://youtu.be/Og847HVwRSI)
(Most Popular Programming Languages 1965 - 2019, multiple indexes)

https://youtu.be/M0vBoBqqjr0 (https://youtu.be/M0vBoBqqjr0)
(Most Popular Programming Languages 1965 - 2021, GitHub source)

Quote
So Firemonkey is a success for Delphi because it allows the existing Delphi developers to stick to Delphi (and probably a lot of already existing code) rather than having to switch to a new solution.

Why wouldn't this be true for Lazarus developers?  You are talking about a similar issue of programmers that may have existing Pascal code and expertise, and want to leverage that for mobile app development.  LAMW/Laz4Android is pretty much doing that, though taking a different route to get there.

Quote
But if you are new to App development, the chances that you would choose Firemonkey over alternatives like React are basically 0.

A person new to creating Apps would not automatically fall into using React.  If you are say computer repair or IT personnel, your goal can be to create applications to automate processes on the OS and existing applications.  No way would such a person touch or probably even think about React as their first choice.  They would look at tools for creating utility applications that solve their issues.  Along that trend would also be workers of or owners of small businesses that are creating such applications to make their jobs easier.  They aren't necessarily touching the Web or JavaScript first, but the computer hardware, desktop OS, existing desktop applications, etc... 

I think some things about this are also getting mixed up.  JavaScript is very popular, because it's the default language of browsers and the Web.  It's a forced standard, that until recently, was very hard to escape from.  As a Web developer, tools like React, Vue, etc... would be tools for them because they want to leverage their skills in web development and technologies to bring that to the desktop and mobile.  Their world is the Web, and when confronted on how to solve their "desktop and mobile problem", they are coming in from that direction and perspective.

A desktop developer or just a user on a desktop is coming in from a different perspective.  "I got the desktop app issue solved, so what to do about mobile?"  In that context, technologies like FireMonkey very much makes sense.  And your opinion about FireMonkey is not necessarily shared by others, as clearly there will be people that think it's great or good enough for their purposes.

From the perspective of Lazarus, it's used a lot for creating desktop applications, so the users are coming from a similar perspective as Delphi users in the wider Pascal community.  It's going to be about a more convenient and easier path to make mobile development just some additional steps to what they are presently doing and leverage their Pascal knowledge.

Quote
...Pas2JS is it's own solution and not realy a part of the fpc-lazarus ecosystem. What I am talking about is a fpc-lazarus solution that uses the webbrowser simply as rendering engine...

...Such a solution would require as much knowledge by the developer about web technology like HTML or Javascript, as you need today knowledge of the QT framework to use Lazarus on Linux (which is absolutely none)

Thanks for clarifying more specifically what you are aiming for.  You will get no argument from me on the merits of it, as it does seem viable.  I would just say that in the various directions that Lazarus users could go to do mobile development, your idea will have to prove itself in comparison.  It would be an advantage to have a way forward that could be applied for both Android and iOS.  Ultimately, it will be for the Lazarus community to decide.
Title: Re: Mobile development - Android & iOS
Post by: Handoko on December 11, 2021, 02:51:30 am
And I think there is just nearly no way in hell that Ada is ranked 17 and kicking the butt of Delphi, Free Pascal, and all the other dialects of Pascal combined (Oxygene, PascalABC, Smart Pascal, etc...).

Using Google Trends:
https://trends.google.com/trends/explore?date=today%205-y&q=%2Fm%2F05y49,%2Fm%2F0n6y,%2Fm%2F019p2

It said BASIC > Pascal > Ada. BASIC (yellow line in the graph below) is slowly losing its popularity. Pascal (blue) is trying to keep its position. And Ada (red) is dying.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 11, 2021, 03:21:16 am
I would trust the TIOBE index way more (where Object Pascal is ranked #16 this month and above Go, Kotlin, Rust...). Which is not saying much, because of how easy it is for the owners to "tip the scale" with their bias or agenda, while getting views.  At least when the TIOBE index owner was confronted that Delphi was a dialect of Object Pascal, he did some grumbling about it, but reconsidered it and adjusted his Index.  Even so, check out TIOBE's "Very Long Term History".  Even though it has the top 15 languages since 1986, some how Pascal is not on there.  Let's think deeply about that for a minute.  He's showing Ada up there, which is not even presently ranked in his top 20, but not Delphi/Object Pascal.  From the late 1970's to 1990's, Pascal was definitely on the map as a top 5 language.  And Turbo Pascal and Delphi made a hell of run by themselves, where they didn't fall off until the early 2000's.

Yet TIOBE doesn't even acknowledge Pascal/Object Pascal in their "historical data", and probably because they messed up the language definitions so badly, where they don't know various compilers and IDEs were dialects of Pascal.
Yes the PyPL index has some issues with respect to the definition of the languages, another example is combining C and C++ is a bit icky because these languages are, while related, rather different and see very different use cases. But the TIOBE index is much worse as a measurement, because it simply does not measure what it aims to measure. TIOBE only tracks searches for "XXX Programming Language", which is not representative with language usage at all. To give you one example, this month I googled "APL programming language", "ML Programming language" and "Go Programming language". But guess what, I don't use any of them, never have and probably never will be. I googled this exactly because I didn't know anything about them and wanted the most superficial introduction about the basic paradigms (i.e. the wikipedia article). What I haven't googled was "Python programming language", "C++ Programming Language" or "Pascal Programming Language" even though these three languages was what I was actually using this month, but still for the TIOBE index I count as an APL, ML and Go developer but not as a Python C++ or Pascal developer.

So the TIOBE index is completely unusable as a metric of language popularity, like at all. And this is not just on an theoretical level, it can be easiely verified against other measures of language popularity. According to the TIOBE index C is still the second most popular programming language and JavaScript only makes it on place 7, this does not match any other statistic out there. If you look at GitHut, which tracks the share of github repositories per language: https://githut.info/ Javascript is on first place and C is on 8ths. If you look at direct surveys to developers like the ones performed by statista each year (https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/) also reflects this with Javascript coming in 1st and C comes in 13ths. This also matches the PyPL index where Javascript is 3rd and C and C++ is 5ths.
So when comparing different estimates for language popularity with vastly different methods, generate quite similar results. Not only for C and Javascript, but generally these different findings show similar results.
The TIOBE index on the other hand is something that I was not able to verify against any other methodology. It is conceptually flawd as explained earlier and this is empirically measurable when compared to other approaches to measuring language popularity.

The inadequacy of the TIOBE index is actually what sparked the creation of the PYPL index, as it basically follows the same methodology, but rather than counting every search for "XXX programming language" they count "XXX tutorial" or "XXX programming tutorial". I don't think that this is a perfect metric either, I don't think it really measures the language popularity, but more the share of what new programmers are trying to learn (and therefore not measures already exisitng long term developers) but it is much better than the TIOBE index, and can be, to a certain degree, validated against other sources, something the TIOBE index spectecularly fails at.

I usually don't like to bring this up, because it always feels like people here are often gripping onto the TIOBE rank as if it is the only thing that keeps their interest in pascal validated, but except for this one index, which uses a clearly flawed methodology, I have not been able to find any other metric by which Pascal makes it even close to the top 20 of most popular languages. There are flaws in any such statistic, but TIOBE is just completely unusable for assessing the popularity of a language. And I don't like it either that Pascal has basically completely lost all of it's relevance in the modern programming world, but just closing your eyes and sticking to the only one statistic that does not show this, does not help either, especially if that statistic is so terrible like the TIOBE index is.

Fact is, for most developers, if you haven't been already using Pascal, either through prior work, education, etc. you will probably not end up using Pascal. And when we want to keep Pascal relevant, we should ask ourselves, what happend and why are the other languages so much more popular. And pretending like the situation isn't so bad, because one flawed statistic shows that it isn't so unpopular doesn't help at all.

Why wouldn't this be true for Lazarus developers?  You are talking about a similar issue of programmers that may have existing Pascal code and expertise, and want to leverage that for mobile app development.  LAMW/Laz4Android is pretty much doing that, though taking a different route to get there.
Because I think that this is not enough. We should strive for a solution that is actually good compared to other alternatives in different languages. Firemonkeys success is that it is good enough for keeping existing developers, but why be satisfied with this? Why not try to archive something that stands out and might attract new developers.
One reason why I started using Lazarus is because back when I started using it (the early 2010s), there simply was no satisfying cross plattform environment for creating GUI applications. I've started with learning Visual Basic and .Net GUI applications for Windows (and also C# as this is basically the same as VB.Net with different syntax), and later learned a little bit Delphi. Then a little bit later I started experimenting with Linux, and wanted a cross platform GUI development language like I knew from Visual Studio or Delphi. While there was this MonoDevelop with GTK#, which just has started incorporating Windows and MacOS (before it was a Linux only solution), but still was really buggy and complicated to setup on Windows. There was C++ with QT but it also was really complicated  (both C++ as a language and then also the usage of QT for building the GUI applications). When I discovered Lazarus I  was really amazed. The installation was basically just double clicking an installer (or three dpkgs on Linux) and it just worked. I already knew a bit of Delphi, and also Pascal was quite similar to Visual Basic so it was easy to get into it and start with it.

I chose Lazarus not because I was searching for a Pascal solution and Lazarus was good enough, but because I was searching a general solution and found that Pascal and Lazarus where the best solution I've seen so far. And thats what I want to get back. Not just good enough, but something that when people see it think: "That looks great I want to learn this". And I think this edge is something that Lazarus has lost over the past decade. I still think it's great, but with all the other solutions now available allowing for the same things Lazarus can, I don't think today I would make the same decision as back then, and I think thats a shame.


A person new to creating Apps would not automatically fall into using React. [...]
I just used React as an example, but this can be exchanged for any of the other solutions, let it be QT5/QT6 (which today can be easiely used with not only C++ but also Python or Javascript), Xamarin, you name it.

I just don't see how anyone who is not already a Pascal developer would start using Delphi for creating Firemonkey applications if their goal is to create mobile applications. If you search the net for "Cross platform gui framework" or "Mobile App development" or "Cross plattform app development" or anything similar you will get a lot of articles describing different platforms frameworks and languages, but I haven't found a single mention of Firemonkey.
This is not sustainable for the community long term. A lot of the people in this forum are here because thy already used TP or Delphi in the past. But how should this  look in 10 or 20 years? If all we focus on is serving already existing Pascal developers, there is no future.

The buisness model of Delphi is to stick to long term developers. Delphi still supports very old Delphi code and makes migrating from one version to the other very seamless. This works for Delphi as it targets mostly the professional world with large long living projects. The focus of Delphi is very narrow, and it can easiely be seen by the complete lack of options for small developers (the starter edition is a complete joke compared to VS community or similar alternatives for other languages), and this is the role Lazarus fills. And while this strategy is working quite well for Delphi, I have serious doubts that this would work for Lazarus.
Lazarus is not an Enterprise solution like Delphi is. It has a different user base and should therefore also try to cater to that userbase. Delphi compatibility has been one of the great strengths of Lazarus and FreePascal, and while I think on the language level this is still quite good, I don't think that Lazarus as an IDE and the LCL as a framework should follow the buisness decisions of Embarcadero.
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 11, 2021, 09:06:48 am
The only realistic direction  that I see would be to start something to just bridge Android/iOS based on some general FMX principles (without compatibility, too much hassle) or LCL customdrawn. (more headstart, but somewhat outdated). Or fully new with more CSS like approach, like Warfley advocates. (I'm no fan of that, but don't know enough about the praciticalities of such approach)

Although frameworks such as Electron and Uranium can end up being a bloated, undebuggable mess.

One of the strong points of Lazarus has always been well-integrated debugging. In that area it exceeds Delphi since even if it omits some details it works consistently across platforms.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 11, 2021, 09:18:46 am
Pas2JS is it's own solution and not realy a part of the fpc-lazarus ecosystem. What I am talking about is a fpc-lazarus solution that uses the webbrowser simply as rendering engine.

Although as I've said, that can result in a bloated mess. Using web markup has proven to be very successful in its original domain, to the detriment of e.g. WAP, but I'm not sure whether it's really desirable where dataflow doesn't have to be serialised.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 11, 2021, 10:39:49 am
Another of the "under the table" ways of creating apps for both Android and iOS, which has been around for quite a while, is ZenGL.  This is something that a newbie/beginner would likely have to dig around to find.  Like with Castle, this goes into the issue of using a game engine.

If you check out the old ZenGL site (https://zengl.org/ (https://zengl.org/)) and go to "Extra", you will find ZenGUI (https://zengl.org/extra/zengui/screen01.png (https://zengl.org/extra/zengui/screen01.png)).  It's a decent example of what could be done going down the OpenGL route, for both Android and iOS. 

The users Seenkao and Skalogryz, have revived development and put it on GitHub (https://github.com/Seenkao/New-ZenGL (https://github.com/Seenkao/New-ZenGL), https://github.com/skalogryz/zengl (https://github.com/skalogryz/zengl)), but the effort appears a bit fractured when it comes to supporting iOS and Android equally.

The old website for ZenGL, also shows steps to compile to iOS and Android.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 13, 2021, 10:33:20 am
Using Google Trends:
https://trends.google.com/trends/explore?date=today%205-y&q=%2Fm%2F05y49,%2Fm%2F0n6y,%2Fm%2F019p2

It said BASIC > Pascal > Ada. BASIC (yellow line in the graph below) is slowly losing its popularity. Pascal (blue) is trying to keep its position. And Ada (red) is dying.
Have you taken the time to also google for pascal? If I search for pascal in google, using an incognito tab, so it is unpersonalized (only considers my location in germany) I get on the first page 3 results regarding the physical unit of pressure, one page about german company called pascal, 3 pages about the mathematician Blaise Pascal, one page about the common german name Pascal, the general wikipedia article (where it links all articles that are tagged as pascal) and the wiktionary site.
The first mention of the programming language is on page 3 meaning there are 20 other entries google takes as more relevant than the programming language for someone using the term pascal.

So at least here in germany, it seems that of all those google searches that go into that google trend nearly none regard the programming language, if google only thinks the it is so irrelevant that it only comes up on page 3. Note that Turbo Pascal is mentioned on page 2, but this is not the programming language, but thats a theater actors collective called Turbo Pascal from berlin (note I live a the opposite site of germany, so this isn't even relevant due to locality). So a local actors collective is more relevant for people searching the term "pascal" than the programming language Turbo Pascal.

For Basic it's kinda similar, as this is a commonly used english word, a lot of the results are translations, then there are shops in germany called basic as well as an online shop. But at least the wikipedia article for basic the programming language makes it onto the first page.

So the google trends you showed say absolutely nothing about the popularity of these languages, because the people searching for Pascal or Basic are probably not searching for the programming language, but for something else, as these terms are widely used elsewhere. The physical unit pascal is probably orders of magnitude more often searched than the programming language, simply because it is part of any school physics class curriculum in the world.
Title: Re: Mobile development - Android & iOS
Post by: Handoko on December 13, 2021, 11:03:51 am
I do not know how accurate Google Trend is nor how they calculate the value. But in case if missed it I want to let you know, I did not simply use the keyword Basic nor Pascal. But Basic programming language and Pascal programming language.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 13, 2021, 12:34:03 pm
Ok, I've overlooked this. But this then basically is what the TIOBE index measures, and as already said, it is very flawed, because it can not distinquish between people searching for a language because they want to learn it, or if it is because they want to only know some superficial information about it. One reason why Basic and Pascal have such a high result there could be because their historical relevance. When you learn the history of programming languages, you will come into contact with them, the same way I've looked into Cobol and Fortran, even though I will never use these languages.

As already stated, the TIOBE index is inherently flawed and it's results can not be verified against any other metric of language popularity. It is simply not a useful measure for this
Title: Re: Mobile development - Android & iOS
Post by: MarkMLl on December 13, 2021, 12:57:53 pm
Ok, I've overlooked this. But this then basically is what the TIOBE index measures, and as already said, it is very flawed, because it can not distinquish between people searching for a language because they want to learn it, or if it is because they want to only know some superficial information about it. One reason why Basic and Pascal have such a high result there could be because their historical relevance. When you learn the history of programming languages, you will come into contact with them, the same way I've looked into Cobol and Fortran, even though I will never use these languages.

As already stated, the TIOBE index is inherently flawed and it's results can not be verified against any other metric of language popularity. It is simply not a useful measure for this

I urge everybody concerned to not let this thread become yet another language comparison, or to let the local BASIC enthusiast coopt it.

I agree that just about every attempt at a metric risks producing misleading results, and as an example would suggest that OS/2 and IBM's DB2 dropped out of public view (i.e. how many magazine articles mentioned them etc.) in the early 1990s even though they were still heavily used commercially and as such were not only financially significant but still had significant "mindshare"- provided that you knew where to look.

Ada, COBOL and for that matter FORTRAN and even LISP are still heavily used in their niches: you only have to consider https://www.cnbc.com/2020/04/06/new-jersey-seeks-cobol-programmers-to-fix-unemployment-system.html for an example, not to mention regular horror stories of somebody in a bank fouling up a big batch-mode job or (going back a bit further) the embarrasing failure of a defense project because the LISP programmers had never heard of Wireshark.

I'd suggest that classical BASIC is rather less heavily used, because it was identified as somewhat ropey comparatively early on and there was substantial pressure to exclude it from business-critical systems. One of the beneficiaries of that trend was Delphi (as an alternative to QuickBASIC and Visual Basic), hence the Object Pascal community as a whole.

Irrespective of the amount of visible mindshare that Pascal still commands, the fact that Embarcadero is still able to keep itself in business by milking its golden egg indicates that there are still enterprise-grade Pascal systems being maintained, whether or not they are being written ab initio. As such, it is in this community's interest to have a viable path for the people involved in that maintenance to "leverage" their talent onto Android and possibly iOS, which makes the subject of this topic worth pursuing: irrespective of the apparent statistics.

MarkMLl
Title: Re: Mobile development - Android & iOS
Post by: Seenkao on December 13, 2021, 01:50:38 pm
Всем привет!
The users Seenkao and Skalogryz, have revived development and put it on GitHub (https://github.com/Seenkao/New-ZenGL (https://github.com/Seenkao/New-ZenGL), https://github.com/skalogryz/zengl (https://github.com/skalogryz/zengl)), but the effort appears a bit fractured when it comes to supporting iOS and Android equally.

На данное время я не смогу воссоздать цепь iOS. Вылезает множество разных проблем и под разные системы. На данное время я нацелен больше на Android, а так же на замену/уход от внешних библиотек или их компиляцию для Android64. Так же я намереваюсь расширить OpenGL до возможности полного его использования. Это не значит, что ZenGL изменится. Просто у пользователя ZenGL появится возможность полностью использовать OpenGL вплоть до 4.6, GLES вплоть до версии 3.2, не заставляя пользователя создавать окно OpenGL самому. ZenGL сделает это за него.

Так же попутно стараюсь документировать функции, чтобы было и удобнее их использовать и более понятно в использовании.

Лишь когда я закончу со всеми выползающими мелочами, я смогу посмотреть в сторону iOS. И посмотрю что я смогу сделать в этом направлении.

Google translate:
At this time, I will not be able to recreate the iOS chain. Crawls out a lot of different problems and for different systems. At this time, I am aiming more at Android, as well as at replacing/avoiding external libraries or compiling them for Android64. I also intend to extend OpenGL to be fully usable. This does not mean that ZenGL will change. It's just that the ZenGL user will be able to fully use OpenGL up to 4.6, GLES up to version 3.2, without forcing the user to create the OpenGL window himself. ZenGL will do it for him.

I also try to document functions along the way, so that it is more convenient to use them and more understandable to use.

Only when I'm done with all the little things that creep out, I can look towards iOS. And I'll see what I can do in this direction.


По поводу каких-то поисковых систем... я не думаю что это хороший метод поиска того, что нужно. Большинство поисковых систем нацелены на то, чтоб выискивать выгоду. В первую очередь для себя. И мало заботиться о пользователе. В следствии чего, мы можем наблюдать картину, что ищем мы одно, а поиск выдаёт совершенно другое. При этом нужное мы можем найти лишь на 10-й - 20-й странице, или не найти вовсе.

Google translate:
For some search engines ... I don't think this is a good method of finding what you want. Most search engines are focused on looking for benefits. First of all for yourself. And there is little to worry about the user. As a result, we can observe a picture that we are looking for one thing, and the search gives out something completely different. At the same time, we can find what we need only on the 10th - 20th page, or not at all.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 13, 2021, 02:00:24 pm
Irrespective of the amount of visible mindshare that Pascal still commands, the fact that Embarcadero is still able to keep itself in business by milking its golden egg indicates that there are still enterprise-grade Pascal systems being maintained, whether or not they are being written ab initio. As such, it is in this community's interest to have a viable path for the people involved in that maintenance to "leverage" their talent onto Android and possibly iOS, which makes the subject of this topic worth pursuing: irrespective of the apparent statistics.

MarkMLl

As I said in one of my previous answers, yes Delphi is doing good with their buisnessmodel of targeting enterprise applications, but I don't think that this area is where Lazarus can (and should) compete.
I think Lazarus should aim for a more general audience, and should be attractive not just as an option for existing Pascal programmers but also for new developers looking for a solution for cross platform development. I decided to go away from .Net and start using Pascal with Lazarus because it had the best cross plattform GUI development tools when I started using it. But with all the competition available nowadays that Lazarus not only does not stand out anymore, but lacks pretty much all other major development environments, and this is something that ought to be changed, and mobile development is the biggest area where Lazarus is lacking
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 13, 2021, 02:46:12 pm
Ok, I've overlooked this. But this then basically is what the TIOBE index measures, and as already said, it is very flawed, because it can not distinquish between people searching for a language because they want to learn it, or if it is because they want to only know some superficial information about it. One reason why Basic and Pascal have such a high result there could be because their historical relevance. When you learn the history of programming languages, you will come into contact with them, the same way I've looked into Cobol and Fortran, even though I will never use these languages.

As already stated, the TIOBE index is inherently flawed and it's results can not be verified against any other metric of language popularity. It is simply not a useful measure for this

TIOBE is not any less flawed than PYPL in my eyes.  As mentioned, both are under the whims of their creators (to adjust rankings as they please), who have both demonstrated odd manipulations and interpretations of definitions.

By all metrics that I have ever seen, Pascal/Object Pascal was a top 10 programming language from the late 1970s to the early 2000s.  That Pascal/Object Pascal would presently be in the 15th to 20th range among programming language is logically consistent with its past.  Contrary to the opposing view, Pascal/Object Pascal is not going to all of the sudden disappear.  There is still a ton of code, websites, books, teaching materials, it being used in the schools of numerous countries throughout the world, and Delphi is still in existence and viable.

I think that many people are trying to compare Pascal against the present top 10 languages, so that if it's not ranked in that range, it's an utter failure or has completely disappeared from the world.  That various websites try to constantly (year after year) proclaim that it's "dead", is extremely suspicious and smells.  Pascal/Object Pascal appears to threaten the business interests of various entities backing C, C++, C#, and Java.  Not to mention the tremendous animosity between various C backers against Pascal, from near the very beginning, who falsely claim it's inferior and wish for its death.

You have to also keep in mind that there are so many programming languages at present, that it's extremely hard for any of them to get traction, to get near the top 50, much less the top 10.  People are not embracing Julia, Go, Rust, Kotlin, Lua, Haskell, etc... at any greater level than Object Pascal.  And I find it quite strange that there isn't an abundance of weird websites constantly saying, "Hey, Haskell is dead!!!  Don't learn it!!!  2015... no, 2017... no, 2022 is the final year of Haskell and it most surely will be extinct!!!"
Title: Re: Mobile development - Android & iOS
Post by: Blade on December 13, 2021, 02:57:16 pm
At this time, I will not be able to recreate the iOS chain. Crawls out a lot of different problems and for different systems. At this time, I am aiming more at Android, as well as at replacing/avoiding external libraries or compiling them for Android64. I also intend to extend OpenGL to be fully usable. This does not mean that ZenGL will change. It's just that the ZenGL user will be able to fully use OpenGL up to 4.6, GLES up to version 3.2, without forcing the user to create the OpenGL window himself. ZenGL will do it for him.

I also try to document functions along the way, so that it is more convenient to use them and more understandable to use.

Only when I'm done with all the little things that creep out, I can look towards iOS. And I'll see what I can do in this direction.

Thank you for giving us this info and continually updating ZenGL.  However, I do think it's unfortunate that it couldn't be updated for use on iOS, to the same level as Android.
Title: Re: Mobile development - Android & iOS
Post by: PascalDragon on December 13, 2021, 03:19:13 pm
Pas2JS is it's own solution and not realy a part of the fpc-lazarus ecosystem. What I am talking about is a fpc-lazarus solution that uses the webbrowser simply as rendering engine.

I don't agree here. Pas2JS can be just as much a part of the FPC/Lazarus ecosystem. TMS showed with their TMS Web Core that a very VCL-like usage is possible with Pas2JS and it's possible to apply the same approach to Lazarus (see here (https://wiki.freepascal.org/pas2js_widgetsets)). While for example the Web Component Library (https://github.com/pascaldragon/Pas2JS_Widget) is still a work-in-progress I have successfully developed a web application for the company I work at that consists of a FpWeb backend and a Pas2JS frontend with the later being developed in the usual Lazarus RAD approach.
Title: Re: Mobile development - Android & iOS
Post by: Warfley on December 13, 2021, 03:39:12 pm
By all metrics that I have ever seen, Pascal/Object Pascal was a top 10 programming language from the late 1970s to the early 2000s.  That Pascal/Object Pascal would presently be in the 15th to 20th range among programming language is logically consistent with its past.  Contrary to the opposing view, Pascal/Object Pascal is not going to all of the sudden disappear.  There is still a ton of code, websites, books, teaching materials, it being used in the schools of numerous countries throughout the world, and Delphi is still in existence and viable.
I don't think pascal will disappear at all, if cobol has proven anything than that technologies never die. The question is what happens with a language that once was very popular, and is this what we want from pascal.

First option is like cobol that the language goes into "maintanance mode", i.e. people only use it to maintain and continue already existing code. This is for example the fate of cobol. Pretty much no one is going to start a big new project in cobol, but due to prevalence it once had, there are a lot of systems that need maintainance, and this is why cobol will probably stick with us for at least the next 20 years. This is the very least we can expect of Pascal, especially as backwards compatibility is a big concern for the development of both Delphi and FreePascal.

The second option is that it becomes a niche language, like Fortran, which is the de-facto standard in the high performance computing area, but does not really find any usage somewhere else. Currently I don't see this for Pascal, because up until now Pascal was a general purpose language, and I don't see any special area where it is exceptional at. There once was the cross plattform GUI development, but as I said, there are now other options available. Maybe for Desktop only GUIs like it is often required for some enterprise applications like management software, but here are also a lot of other players, mainly Java with Swing and (if you stick to windows, which is a reasonable assumption for many companies) .Net. Also this niche is where Delphi sits, and I don't see how Lazarus could compete there with Delphi (enterprise software development companies usually want to have someone to shout at when it doesn't work, which doesn't work as good in an open source project).

Lastly is the possibility of innovation, to keep up with the "new hot stuff", continually evolve and stay relevant in the ever shifting development market. This is what for example C++ does. C++ has gone through many iterations and the language has changed, in many cases fundamentally. C++ code from the early 00s is completely different from modern C++ code, every few years with a new standard, a lot of new things are introduced, some are successful, others don't see much usage and some are even dead on arrival and don't even make it into most compilers. This keeps C++ always modern and is arguably a reason why it is keeping it's place as a very popular language, while C on the other hand is steadily declining into it's niche (of very bare metal development).
Other languages like Python or Swift even go so far to make a complete cut, in 08 or so, the Python comittee decided that python wasn't up-to-date anymore, which is when they decided to create python3 which completely breaks compatibility with the old python2, to basically start from scratch. Swift did something similar in version 3.

So the question is what the goal is. I personally think Pascal and Lazarus are best suited as general purpose languages, so I would preferr the third option, because I really like the language and would love to have it be as widely applicable as possible. Thats why I really like to experiment with new features, modern paradigms and co.
But honestly, I think I am in the minority here, a lot of people seem to be very satisfied with the fact that you can still write code as 20 years ago (which is completely fine, this is a completely valid goal to have) which consequently means that the language needs to go either the option1 or option2 route.
Title: Re: Mobile development - Android & iOS
Post by: trev on December 13, 2021, 11:45:50 pm
Unfortunately this thread has now degenerated to the point that I can't split the content unrelated to Mobile development, so I'm reluctantly locking it. The other option was to start deleting unrelated posts, but some were mixed and I'm not about to start editing posts.

In any event, I think the original topic had probably run its course. There was some good commentary on Mobile development but, as ever, actions speak louder than words.
TinyPortal © 2005-2018