Forum > Operating Systems

Mobile dev.: Lazarus or Xamarin?

(1/4) > >>

tk:
Hi all!
Since I am still quite a rookie with regard to mobile dev. (only made cosmetic modifications to an existing Android app in Java) I would like to ask if Lazarus is already mature enough to start developing mobile app in:

1. The app should be simple visualization for our controllers (4 screens + some configuration of the HTTP/UDP connection,no dbs,simple ui,simple charts).
2. Existing codebase in Pascal should be reused (implements our communication protocols etc.)
3. Single source code (small UI differences acceptable).
4. Must run in Android,iOS (WP is not desired, but would be an advantage).
5. Easy IDE setup, app deployment and maintenance.

To me, most viable way now is to use Xamarin (should be free now at least for simple apps), but problem is point 2. That's why I would like to use Lazarus or any other suitable pascalish IDE except Delphi (main reason why not to use Delphi anymore is its price). True, maybe I can use shared lib for point 2, haven't searched for this much.

Thank you for ideas/comments/experience.

Phil:

--- Quote from: tk on October 15, 2016, 08:06:26 pm ---True, maybe I can use shared lib for point 2, haven't searched for this much.

--- End quote ---

A dynamic library is a good way to preserve the value of your investment in existing Pascal code.

You can use a dynamic library with iOS apps now if you put it in a framework (not difficult to do).

For iOS development you need an IDE with good integration with Xcode. Lazarus is not that tool, so Xamarin Studio or RemObjects' Fire IDE would be better choices.

Here are my notes on dynamic libraries:

https://macpgmr.github.io/MacXPlatform/PascalDynLibs.html

felipemdc:
I have an app in the Google Play store using the "dynamic library" method, connecting Pascal to Java via JNI. There is some info on how to do this here: http://wiki.freepascal.org/Android_Programming

I think it is the best method. The Android User Interface will need to be in Java when using this method, but despite this minor problem, it works very well. The "brain" of the app is in Pascal, and I develop/debug this brain using a test Windows GUI built with Lazarus.

Leledumbo:
For now, go with what others said: dynamic library. We don't have yet a GUI library that abstracts both Android and iOS (and WP if that counts), let alone easy IDE setup.

tk:
Thank you all I will go this way.

The question is how to import the dyn lib and use it from Xamarin etc.. I've already studied the pascaldynlibs, thanks Phil. I've already tried the demos from swig (see this my post: http://forum.lazarus.freepascal.org/index.php/topic,34306.msg224434.html#msg224434).

To me, swig would be ok but the problem is that it does not work with Pascal but C++. First I thought it only takes a C++ header file and creates the wrappers in another languages but running the demo has shown to me that it also generates some C++ stuff, ie. the C++ class unwrappers. As if I could forget. They're needed in the dyn lib part, which in the swig case is always a C++ library.

But how to get this swig generated code back to Pascal, to build the dyn lib with FPC? Seems to be too much work already to me.

My idea is to make an own generator in Object Pascal (compilable in Delphi/FPC) based on a simple IDL (XML based, not like rather specific syntax of Microsoft or Borland IDLs for COM) that interfaces directly to Pascal (makes unwrappers/wrappers) and another languages (wrappers for C#,C++,...), maybe later also unwrappers for those languages. I would then make it available for all (maybe as part of my KControls).

My question is: Isn't it a duplicite work? Has already somebody sth. similar?

Thanks

Navigation

[0] Message Index

[#] Next page

Go to full version