Recent

Author Topic: Lazarus in Ubuntu Phone  (Read 5927 times)

Ericktux

  • Sr. Member
  • ****
  • Posts: 345
Lazarus in Ubuntu Phone
« on: June 03, 2016, 10:01:48 pm »
Hi my friends, i share a video interesting, in where develop a app for ubuntu phone, from lazarus.
https://www.youtube.com/watch?v=j__WaGH4aig

greetings.   :)

Handoko

  • Hero Member
  • *****
  • Posts: 5159
  • My goal: build my own game engine using Lazarus
Re: Lazarus in Ubuntu Phone
« Reply #1 on: June 04, 2016, 07:30:40 am »
Glad to see Lazarus/FPC can generate program that run on Ubuntu Phone. Is the programming as usual, or do we need some adaptations to make it works on Ubuntu Phone devices?

I'm learning to use Lazarus to create Android App, it's very complicated.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Lazarus in Ubuntu Phone
« Reply #2 on: June 08, 2016, 12:50:57 pm »
Thanks for sharing. :)  But it is a vertical video...  ;D
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

kris

  • Jr. Member
  • **
  • Posts: 59
Re: Lazarus in Ubuntu Phone
« Reply #3 on: September 21, 2016, 12:14:56 pm »
Hi guys, the video is actually made by me.
So far I was able to install and use fpc compiler directly on the phone itself, as well as inside libertine container.
I can also install lazarus inside libertine, but the compilation fails with various error messages. Also, I could not compile newer compiler from sources from SVN, again various errors.

I am using fpc+lazarus inside my custom container made with debootstrap, it is internally running ubuntu 14.04. I simplified a lot since when that video was made. I used to start headless x server, and connect into it over vnc. Had to run light window manager on it.
These days are over, now it's really much easier on my current setup:
1. I ssh into my phone from my ubuntu desktop with X forwarding.
2. I chroot into my container with X forwarding still working (via .Xauthority/magic cookie)
3. U start my X apps just normally on my desktop, because I have working X forwarding.

Currently I have 2 sets of fpc+lazarus there inside my container:
1. The default from the repo (apt-get install fpc fpc-sources lazarus)
    Free Pascal Compiler version 2.6.2-8 [2014/01/22] for arm
    Lazarus 1.0.10+dfsg-1
2. Additional setup precompiled for Raspberry Pi (http://www.getlazarus.org/setup/?download#raspberry_pi)
   FreePascal 3.0.0
   Lazarus 1.7

both work great and I can design, compile and run programs directly on my phone.

After I make X app, I just copy it from inside my container, into the libertine. Then I create .desktop launcher for it, and after that I can simply start it on my phone's screen via XApps scope. So far so good, working actually very smooth.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Lazarus in Ubuntu Phone
« Reply #4 on: September 21, 2016, 12:56:01 pm »
Welcome to the forums, kris.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Lazarus in Ubuntu Phone
« Reply #5 on: September 21, 2016, 02:54:56 pm »
Hello Chris, because I want to buy a tablet ubuntu to develop some business applications with Lazarus wanted to know if you had had the chance to test the connection to the database. For example you can with ZEOS connecting to a mysql db or firebird or postgres?

Thank you
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

kris

  • Jr. Member
  • **
  • Posts: 59
Re: Lazarus in Ubuntu Phone
« Reply #6 on: September 22, 2016, 04:41:19 am »
first of all, I invite you all to check more in this topic (some screenshots): http://forum.lazarus.freepascal.org/index.php/topic,32090.0.html

xinyiman, hi, no, I did not test db connections, but I tested network connections with Synapse, and works perfectly normal. Thus, I do expect all the db to work normally as well.
I want to mind you thoug - once you create app with lazarus and compile on the phone, it will be an app for X server. The Ubuntu phone does not have X server itself, because it is instead using Mir. So what does that mean for an average Joe? Well, it means that, in order to run your app on the phone, as far as of current state of things, you want to install Libertine on the phone, and then also install XApps scope.

Libertine is a container for all the x software. Unfortunately, currently, I was not able to get Lazarus/FPC to work under Libertine. I am using my own container for this purpose. Workflow is as follow:
1. I create lazarus app in my own container. (user doesn need it, only for developer)
2. I give the app do user, who needs to install it inside his/her Libertine container.
3. I provide user with .desktop launcher so that XApps scope can enlist the app with its icon on the phone. Now user will be able to use the app on the phone.

Known limitations:
The way x apps run on the phone is via so called xmir. It has few particularities, among, the biggest one, any form will become client to the entire screen. Event if you designed it to a custom size - it will stretch to the entire screen. You need to keep that in mind when designing your app.
Also, you won't really benefit from multi windowed designs, unless you design it for a scenario where you can only ever see one form at a time. Which anyways, seems to be the standard way for all the mobile platforms these days anyways.
Finally, the Lazarus, AFAIK, does not provide things like Scale property known from FireMonkey, so the app will go really tiny in terms of fonts and control size on a high DPI screens, like all the modern phones have. You will want to make sure that you enlarge your fonts and control sizes to make up for this. What looks big on the desktop screen, will look tiny on the phone. Unless off course, on your desktop you are also using high DPI screen.

Additional info: currently, and until Lazarus/FPC works inside Libertine, your only shot is to use it in your own custom made container, and via SSH with X forwarding. That means, you will need Linux desktop environment to go with it if you want to develop. I am using Ubuntu on all my devices and computers, so works like a charm.

kris

  • Jr. Member
  • **
  • Posts: 59
Re: Lazarus in Ubuntu Phone
« Reply #7 on: September 25, 2016, 09:48:06 am »
Today I finally got to documenting Free Pascal development for Ubuntu Phone. The first article is about writing console mode applications. Next one will cover GUI development with Lazarus. I am very excited as I also managed to solve the problem with OSK (on-screen keyboard) inside a GTK app running directly on the phone (not via Libertine). Stay tuned.

today's first article available here:
https://kriscode.blogspot.tw/2016/09/freepascal-development-for-ubuntu-phone.html

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Lazarus in Ubuntu Phone
« Reply #8 on: September 27, 2016, 02:06:50 pm »
Cool. Keep up the good work.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

kris

  • Jr. Member
  • **
  • Posts: 59
Re: Lazarus in Ubuntu Phone
« Reply #9 on: October 04, 2016, 09:57:43 am »
my newest blog post on Lazarus development for Ubuntu Phone
(...)
Now the absolute mind-blowing part: what is the default, standard, encouraged and promoted way to make apps for Ubuntu Phone? well, it is the Ubuntu SDK off course. Have you seen it maybe? Perhaps tried? well, I have. And let me tell you this about it:

1. IDE is nowhere as good as Lazarus IDE
2. You can't run it (the IDE) ON your Ubuntu Phone
3. Once you've written an app, you can't also compile it for Windows, MacOS and bunch of other operating systems just like that
4. PERIOD.

So that is why Free Pascal and that is why Lazarus. Write once, compile everywhere. Enjoy!
(...)
http://kriscode.blogspot.tw/2016/10/lazarus-development-for-ubuntu-phone.html


 

TinyPortal © 2005-2018