Recent

Author Topic: best way?  (Read 3128 times)

katronix

  • Jr. Member
  • **
  • Posts: 54
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: 5130
  • 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

  • Jr. Member
  • **
  • Posts: 54
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: 2297
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: 3112
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: 14201
  • Probably until I exterminate Putin.
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 »
Specialize a type, not a var.

 

TinyPortal © 2005-2018