* * *

Author Topic: best way?  (Read 872 times)

katronix

  • New member
  • *
  • Posts: 43
best way?
« on: August 11, 2018, 05:19:02 am »
Hi all, I'm in the process of making a podcast app, more to see if I can do it than anything. Eventually, I'd love to be able to make something cross-platform (Linux, Windows 32/64, Android).

So my question is right now is there any 1 way to download files from the net within a Lazarus app that will work everywhere?

Though I suppose if not, I could have compilation if statements to control what code is used.

Thank you

Handoko

  • Hero Member
  • *****
  • Posts: 2609
  • My goal: build my own game engine using Lazarus
Re: best way?
« Reply #1 on: August 11, 2018, 05:41:42 am »
Yes, Lazarus is capable for developing cross-platform application. Cross compiling to Linux and Windows are easy. But Android is hard, mostly because the toolchain to produce Android app is very complicated. But it worth to learn.

On the post in the link below, I wrote a list of possible ways to create Android app using Lazarus:
http://forum.lazarus.freepascal.org/index.php/topic,38777.msg264428.html#msg264428

You should try LAMW first, it has most the features and well-supported:
http://wiki.lazarus.freepascal.org/LAMW
« Last Edit: August 11, 2018, 05:58:08 am by Handoko »

katronix

  • New member
  • *
  • Posts: 43
Re: best way?
« Reply #2 on: August 11, 2018, 06:21:04 am »
What about being able to download files? that was my main question.

jmpessoa

  • Hero Member
  • *****
  • Posts: 1183
Re: best way?
« Reply #3 on: August 11, 2018, 07:03:27 am »

Yes, You can!

You just need to check which Pascal library is capable of being compiled for various environments...
[maybe "Synapse" and/or  some core Free Pascal "FCL"]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

engkin

  • Hero Member
  • *****
  • Posts: 2109
Re: best way?
« Reply #4 on: August 11, 2018, 07:15:50 am »
What about being able to download files? that was my main question.
fphttpclient

Thaddy

  • Hero Member
  • *****
  • Posts: 6903
Re: best way?
« Reply #5 on: August 11, 2018, 09:23:45 am »
What about being able to download files? that was my main question.
fphttpclient
Indeed. In another post I wrote some examples this week, including one with fphttpclient: http://forum.lazarus.freepascal.org/index.php/topic,42132.msg293506.html#msg293506

Note I am not sure for Android. I do not know if for https the dependency on openssl can be satisfied, but that  can be mitigated.

To be complete: Remy added an example for Indy. Together they give you multiple options, all of which are good and all of which also allow for http redirects.
The most convenient option is indeed fphttpclient from fcl-web, which is a standard fpc package and has no dependencies except for a properly installed openssl.

Since this is a recurring question I will put all these examples on  the wiki.
« Last Edit: August 11, 2018, 09:34:18 am by Thaddy »
Ada's daddy wrote this:"Fools are my theme, let satire be my song."

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus