Lazarus

Programming => General => Topic started by: Blestan on July 21, 2016, 11:55:03 am

Title: Status of Mobile Dev
Post by: Blestan on July 21, 2016, 11:55:03 am
hi!
I have to make a choice for a app i must write.
...going native (java, swift, objective C) or make hybrid with phonegap.
As a Pascal developer for many many years ( since 1986 ) i want to use fpc (delphi is out of question because of the prices) to build the app ... but my fears are about the current status of the mobile capabilities of fpc - expect that iOS is not supported ...are major android device options supported - geolocation, camera, gallery, contacts etc ...
please give me some reasonable advice
Blestan
Title: Re: Status of Mobile Dev
Post by: markus_ja on July 21, 2016, 12:40:37 pm
Are you aware of SmartMobileStudio http://smartmobilestudio.com ?
You can use Object Pascal to write JS/HTML5 Apps.
Title: Re: Status of Mobile Dev
Post by: Blestan on July 21, 2016, 12:44:21 pm
yes.. and i played with it several times for the past 2-3 years ... but this is not a sollution ... this is just a pas to js compiler .. at the end you finish with a bloated css/js files that you submit to pahonegap build ... it basically html/css/js hybrid app
it good only if you dont want to learn new paradigms and you are fanatic about writing pascal code.
Title: Re: Status of Mobile Dev
Post by: Leledumbo on July 21, 2016, 01:17:13 pm
please give me some reasonable advice
Get your hands dirty on it. One thing for sure, there's no yet unified GUI library for both Android and iOS (don't even think about Ubuntu mobile, Plasma mobile, Tizen, etc.). Interest in (development of) iOS side is kinda low (request is not bad, but millions of requester doesn't make any single dedicated contributor), while Android is just fine and growing at least in LazAndroidModuleWizard and FPC-JVM.
Title: Re: Status of Mobile Dev
Post by: Thaddy on July 21, 2016, 01:21:51 pm
- expect that iOS is not supported ...
That expectation is wrong: it is supported ;)
Title: Re: Status of Mobile Dev
Post by: Blestan on July 21, 2016, 02:08:07 pm
i supposed that someone will say that - ios is supported - like a target maybe .... but it s not useful ... can you tell me how to create a single prototype app? with even simple controls? come on!
... it's in early pre-alfa stage ... like swift in available on android ... just a proof of concept
Title: Re: Status of Mobile Dev
Post by: Phil on July 21, 2016, 02:35:03 pm
For the foreseeable future, I think the only realistic approach to using FPC on iOS is to create a hybrid app: Swift UI and Pascal non-UI "core", either in a dynamic library or as a server-side app. FPC fully supports iOS library creation, both 32-bit and 64-bit code.

As an example of this kind of hybrid app, see the SwiftCast app in Part 3 and look at its source in Xcode:

https://dl.dropboxusercontent.com/u/28343282/MacXPlatform/PascalDynLibs.html

If this makes sense to you, then you'll be fine doing an iOS app this way.

While SwiftCast is a Mac app, the approach is almost exactly the same for iOS. One minor difference is that the Pascal library on iOS needs to be in a framework rather than just the single .dylib library file. But creating the framework is trivial.

I think we should accept Swift on iOS the same way we accept JavaScript when creating a Web app's client UI.

-Phil
Title: Re: Status of Mobile Dev
Post by: Blestan on July 21, 2016, 03:46:28 pm
ok ... the situation is far from production ready for any platform ...
for the prototype i will go with hybrid UI but with pascal json server for the data ...
mobile angular ui or framework7 backed by a custom made rest server.
aside i will try the components for android (Laz4android) and the custom drawn  widget set ...
last question - on android are device hardware option supported - i mean geolocation and camera for example?
Title: Re: Status of Mobile Dev
Post by: Thaddy on July 21, 2016, 04:55:51 pm
Yes of course. Just like for iOS the full Android api is  accessible through FPC.
But you are a screen drawer (that's the bad meaning in the different meanings of control-freak) and not a programmer because you want everything pre-cooked and readily served.

It is still too hot in my garden, but I do have icecubes. Hence the measured response.
Title: Re: Status of Mobile Dev
Post by: Blestan on July 21, 2016, 06:08:11 pm
hahhaah .cheeers man ;) in my garden is now cool ;) 35C .... with cuba libre is even cooler... btw im a programer but mostly on non gui ... i prefer to deal with "system" projects.... servers, parsers, db ... etc...
but now i have to deal with mobile gui... and after a week of investigations i call tell that this is a complete mess ... not in fpc world but as a whole.. i will try to put some efforts in android for lazarus and custom drawn... my first task is to port the material theme to CD controls
Title: Re: Status of Mobile Dev
Post by: skalogryz on July 21, 2016, 06:27:25 pm
Recently went into production with an iOS game.
Yeah, it is not using any iOS ui, but still...
Title: Re: Status of Mobile Dev
Post by: jmpessoa on July 21, 2016, 06:52:53 pm

@Blestan:

Quote
...on android are device hardware option supported - i mean geolocation and camera for example..

Yes, LAMW: Android Module Wizard support all these... [components and "demos"]

ref.  https://github.com/jmpessoa/lazandroidmodulewizard



Title: Re: Status of Mobile Dev
Post by: Handoko on July 21, 2016, 08:24:35 pm
ok ... the situation is far from production ready for any platform ...
for the prototype i will go with hybrid UI but with pascal json server for the data ...
mobile angular ui or framework7 backed by a custom made rest server.
aside i will try the components for android (Laz4android) and the custom drawn  widget set ...
last question - on android are device hardware option supported - i mean geolocation and camera for example?

Hello Blestan. I'm a newbie in this Lazarus Android area. I can't tell you much how well or not the recent development of Android support. But here I can share what I found in LAMW:

Components provided by LAMW for Android development in the component tabs are:
jMenu, jContextMenu, jTextView, jEditText, jButton, jCheckBox, jRadioButton, jRadioGroup, jProgressBar, jRatingBar, jSeekBar, jSpinner, jAutoTextView, jGridView, jListView, jScrollView, jHorizontalScrollView, jActionBarTab, jPanel, jCustomDialog, jChronometer, jDigitalClock, jAnalogClock, jSwitchButton, jToggleButton, jImageBtn, jWebView, jImageView, jImageList, jDrawingView, jSurfaceView, jBitmap, jView, jCanvas, jCanvasES1, jCanvasES2, jDatePickerDialog, jDialogYN, jDialogProgress, jNotifactionManager, jIntentManager, jBroadcastReciver, jSensorManager, jContactManager, jMediaRecorder, jMediaPlayer, jDownloadManager, jDownloadService, jAlarmManager, jSMS, jCamera, jLocation, jPrefernces, jTextFileManager, jImageFileManager, jShareFile, jHttpClient, jSMTPClient, jTCPSocketClient, jTimer, jAsyncTask, jBluetooth, jBluetoothClientSocket, jBluetoothServerSocket, jSqliteDataAccess, jSqliteCursor, jShellCommand, jDumpJavaMethods, jMyHello  %)

I'm not a cult fanatic who will try to convert you.  >:D Oppositely, I will tell you don't use Lazarus/FPC to build commercial projects. At least for now.

I started to learn how to use Lazarus to develop Android apps a year ago. Many months of experiments wasted without any progress. So started to think what went wrong. I changed my strategy. I read the documentations thoroughly, I visit the forum frequently to hear people sharing their experiences about Android development, and I learned how to cross compile.

Now, I get the result. I'm now able to write OpenGL ES 2 animation apk that can run on Android both ARM and Intel targets. Isn't it great  :D. Yep, but I found several bugs that I'm sure that's not my fault. I still haven't submit any bug reports, because those issues are hard to explain.

 :'( So, it is sad to tell you don't use Lazarus/FPC if you're going to build commercial Android apps. I still use and learn it, because I'm having fun playing it. It can be your toy, but not your tool.

And you've been told, there is no unified GUI library. Several options are available.

Laz4android + Custom Drawn is great. This combo was my first choice. Unfortunately the development seems stopped and there has a bug I can't tolerate. After months of waiting, I gave up and tried Lazarus Android Module Wizard alias LAMW. Sorry to say :-[, both are buggy. But LAMW was and is still improving. The documentation is okay, but no tutorial. Luckily it's packed with lots of demos to show how to use each of the components.

I heared some people succeed to use JVM to build Android apps. There is also attempts to use SDL to generate codes that can compile easily on both PC and Android. Bravo! Although my first try failed, but seems very promising.

 :-X ssst ... don't use Lazarus/FPC to build commercial apps.
I've warned you.
Title: Re: Status of Mobile Dev
Post by: Phil on July 21, 2016, 10:47:37 pm
Here are my notes from several years ago working with both PhoneGap and FPC JVM:

https://dl.dropboxusercontent.com/u/28343282/qxotica/QxoticaTechNote1.html

https://dl.dropboxusercontent.com/u/28343282/pba/PbaStatus.html

The link to pba source in the 2nd page is broken. Here's the updated link:

https://dl.dropboxusercontent.com/u/28343282/pba/pba.zip

Also, the 1st page is part of a larger project:

https://sourceforge.net/projects/qxotica/

-Phil
Title: Re: Status of Mobile Dev
Post by: Leledumbo on July 22, 2016, 12:49:03 am
i supposed that someone will say that - ios is supported - like a target maybe .... but it s not useful ... can you tell me how to create a single prototype app? with even simple controls? come on!
... it's in early pre-alfa stage ... like swift in available on android ... just a proof of concept
http://blog.naver.com/simonsayz/220498531474
There was integration package with form designer, but it's totally gone now. If you can use some wayback machine, search for pas4ios.
Title: Re: Status of Mobile Dev
Post by: Phil on July 22, 2016, 01:01:38 am
There was integration package with form designer, but it's totally gone now. If you can use some wayback machine, search for pas4ios.

I found these links:

http://forum.lazarus.freepascal.org/index.php?topic=26506.0

https://www.youtube.com/watch?v=wT699sfCuqc

https://www.youtube.com/user/pas4mobile

Although, quite frankly, I don't even recall seeing anything about pas4ios. I think this project came and went so fast that if you looked away for a week or two you might have missed it.

Title: Re: Status of Mobile Dev
Post by: skalogryz on July 22, 2016, 05:01:58 am
i'm using iPhoneLazExt (http://wiki.freepascal.org/iPhone_Laz_Extension)
Title: Re: Status of Mobile Dev
Post by: Phil on July 23, 2016, 06:23:41 pm
Interest in (development of) iOS side is kinda low (request is not bad, but millions of requester doesn't make any single dedicated contributor)...

I'm wondering if you have that backwards. There were a number of fairly ambitious projects for doing iOS development with FPC. There's Dmitry's above-mentioned iPhone_Laz_Extension, which is still actively developed. And there are at least a couple of abandoned efforts, starting with iOS Designer:

http://wiki.lazarus.freepascal.org/iOS_Designer

And I would be remiss if I didn't mentioned my own abandoned article series from 5 years ago (although it seems much longer) that showed how to integrate FPC with Xcode for both OS X and iOS development:

https://dl.dropboxusercontent.com/u/28343282/ObjP/ObjP_Intro.html

I think the problem with all of these projects, other than not being complete enough or seamless enough for some, is that very few people ever used them. Developers of add-ons like this feed on the energy of demand for more and more of what they're doing. I don't think that demand was ever there.

There was a window of opportunity for iOS development with FPC about 5 years ago, right around the time that Delphi XE2 came out with support for iOS. But that window is now firmly closed. Most developers for iOS have moved on and embraced Xcode or Xamarin Studio. They're no longer here.

The question in my mind is whether anyone will ever again invest the kind of effort it would take to develop a complete FPC solution for iOS. My guess is no. Certainly a unified GUI for Lazarus mobile development will never happen.

-Phil
Title: Re: Status of Mobile Dev
Post by: Leledumbo on July 23, 2016, 11:48:19 pm
Interest in (development of) iOS side is kinda low (request is not bad, but millions of requester doesn't make any single dedicated contributor)...

I'm wondering if you have that backwards. There were a number of fairly ambitious projects for doing iOS development with FPC. There's Dmitry's above-mentioned iPhone_Laz_Extension, which is still actively developed. And there are at least a couple of abandoned efforts, starting with iOS Designer:

http://wiki.lazarus.freepascal.org/iOS_Designer

And I would be remiss if I didn't mentioned my own abandoned article series from 5 years ago (although it seems much longer) that showed how to integrate FPC with Xcode for both OS X and iOS development:

https://dl.dropboxusercontent.com/u/28343282/ObjP/ObjP_Intro.html
The bold speaks itself. The Android side (remember I was comparing with Android) also struggles, but haven't give up. I'm still marketing LazAndroidModuleWizard (occassionally looking at its code which gets better day by day) and it seems quite successful. It's quite easy to setup nowadays since everything can be done from within the IDE and is getting closer to newbie friendly development. Somebody also seems to fall in love with FPC JVM and regularly posted what he made with it. So the Android route looks brighter than iOS...
TinyPortal © 2005-2018