Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-09

Cross platform mobile development

11 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ryan Joseph

Coming from the background of a Pascal programmer (on Mac specifically) does anyone have any ideas as to what the best cross platform development environment/language is right now for mobile apps? I’d like to do some learning and maybe start some projects but I’m not sure if there are any that could be made to work with FPC or if not something more similar than not. iOS from Free Pascal works but Java is more complicated from what I’ve been learning.

Thanks.

Regards,
Ryan Joseph

Reply by email

Unknown author
to Ryan Joseph

Hi Ryan,

   Just so happens this is what I've been immersed in the last few months. I have an idea for an app I'm working on - like you I have Pascal experience, but unlike you I have no Apple experience, so I've been trying to find the best way for me to code for Apple as well.

   I did make some enquiries about ways to use Pascal, and was told there are ways to do it, but it still comes down to using some Java interfaces. Didn't pursue that much as other ways of doing it came to my attention which looked more straight-forward...

   The first I looked at was Phonegap. This works on hybrid technology of HTML/CSS/XML. You can compile in the cloud for platforms other than whatever you have, though you do still need to have at least an Apple developer certificate to compile for Apple (this is an issue for me, and one I'm still trying to resolve. Been trying to get OSX going on my PC in a VM, but no success yet - I didn't find out until AFTER I got my new computer that you need to have OSX to get certificates to test on iOS. :-( There are other options like Mac In The Cloud, but you wouldn't need those of course, just to enrol in the developer program).

   Finally got a working Hello World on Phonegap, when I found out about Xamarin, and this is where I'm heading at the moment. It is based on C#, so gives a more-native experience for the user than hybrid technology, and using Xamarin forms for the front-end you can have close to 100% code-share across platforms. I have Hello World working on Android, but still working on my OSX issue in order to test the Apple version (Visual Studio gives you the option of connecting to a networked Mac for credentials/testing of Apple side, and looking into this at the moment. This is where Mac In The Cloud could help if I can't get OSX working on my computer and can't find a friend to help out here).

   Let me know if you have any specific questions about Phonegap or Xamarin (or let me know if you find a good Pascal-based solution :-) ).

regards,
   Donald.

Earlier message 20 lines
----- Original Message ----- From: "FPC-Pascal users discussions" To:"FPC-Pascal users discussions" Cc: Sent:Tue, 6 Sep 2016 15:54:04 -0600 Subject:[fpc-pascal] Cross platform mobile development Coming from the background of a Pascal programmer (on Mac specifically) does anyone have any ideas as to what the best cross platform development environment/language is right now for mobile apps? I’d like to do some learning and maybe start some projects but I’m not sure if there are any that could be made to work with FPC or if not something more similar than not. iOS from Free Pascal works but Java is more complicated from what I’ve been learning. Thanks. Regards, Ryan Joseph

Reply by email

leledumbo
to Ryan Joseph: Coming from the background of a Pascal programmer (on Mac specifically) does anyone have…
Coming from the background of a Pascal programmer (on Mac specifically)

does anyone have any ideas as to what the best cross platform development environment/language is right now for mobile apps? I’d like to do some learning and maybe start some projects but I’m not sure if there are any that could be made to work with FPC or if not something more similar than not. iOS from Free Pascal works but Java is more complicated from what I’ve been learning.

I'd say none is the best for now. The hype though, is to use JavaScript with React Native by facebook. The downside are:
- It's JavaScript, and you're not generating it, but handcoding it
- The components are not totally abstracted for both Android and iOS, there are still specific ones for each platform
- Compilation (or compaction) takes significant and noticable amount of time that you can go for coffee/tea/poop before it's finally done

If you only target Android, though, for now LazAndroidModuleWizard still provides the best experience. It's still our lovely Pascal with its turbo compilation speed, light final APK size (not lighter from handcoded Java for sure, but still light) and fast RAD drag n drop development. Actually, the lower lever library that LazAndroidModuleWizard uses is written by simonsayz which also writes the same library for iOS. It's a bit unfortunate that the componentization and packaging does not abstract both libraries as LCL does at desktop level.

For your convenience:
Package: https://github.com/jmpessoa/lazandroidmodulewizard Android: http://blog.naver.com/simonsayz/220480419289 iOS: http://blog.naver.com/simonsayz/220485321971

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Cross-platform-mobile-development-tp5726292p5726296.html Sent from the Free Pascal - General mailing list .

Reply by email

Mark Morgan Lloyd
to leledumbo
leledumbo wrote
If you only target Android, though, for now LazAndroidModuleWizard stillprovides the best experience. It's still our lovely Pascal with its turbocompilation speed, light final APK size (not lighter from handcoded Java forsure, but still light) and fast RAD drag n drop development. Actually, thelower lever library that LazAndroidModuleWizard uses is written by simonsayzwhich also writes the same library for iOS. It's a bit unfortunate that thecomponentization and packaging does not abstract both libraries as LCL doesat desktop level.

Out of curiosity, is this ARM-specific or does it also work with e.g. Intel-based tablets or desktop implementations of Android?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

leledumbo
to Mark Morgan Lloyd
Out of curiosity, is this ARM-specific or does it also work with e.g.

Intel-based tablets or desktop implementations of Android?

I haven't tried myself (I have x86 based Android tablet, though), but the option is there:
lamw-setup-dialog.png
<http://free-pascal-general.1045716.n5.nabble.com/file/n5726298/lamw-setup-dialog.png>

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Cross-platform-mobile-development-tp5726292p5726298.html Sent from the Free Pascal - General mailing list .

Reply by email

Ryan Joseph
Show quoted text 13 lines
On Sep 7, 2016, at 4:00 AM, wrote: ? ?Finally got a working Hello World on Phonegap, when I found out about Xamarin, and this is where I'm heading at the moment. It is based on C#, so gives a more-native experience for the user than hybrid technology, and using Xamarin forms for the front-end you can have close to 100% code-share across platforms. I have Hello World working on Android, but still working on my OSX issue in order to test the Apple version (Visual Studio gives you the option of connecting to a networked Mac for credentials/testing of Apple side, and looking into this at the moment. This is where Mac In The Cloud could help if I can't get OSX working on my computer and can't find a friend to help out here).

I looked at a Xamarin tutorial and it looks pretty interesting if you’re willing to move to C# (not so bad for Pascal guys perhaps?). I’m comfortable enough doing iOS because we have a really excellent ObjectivePascal dialect which works more or less natively but I haven’t really gone full into learning how to make Android bindings work for anything more than a OpenGL game and it’s so daunting I’m thinking of going a Xamarin route.

Does Xamarin forms have a system where you can write one UI and compile to multiple mobile platforms? The tutorial I saw had the people working specially on iOS or Android even though I can do native iOS development in FPC so it wasn’t that useful. I think the forms do this but I haven’t found out yet.

Thanks.

Regards,
Ryan Joseph

Reply by email

Ryan Joseph
Show quoted text 15 lines
On Sep 7, 2016, at 4:00 AM, wrote: If you only target Android, though, for now LazAndroidModuleWizard still provides the best experience. It's still our lovely Pascal with its turbo compilation speed, light final APK size (not lighter from handcoded Java for sure, but still light) and fast RAD drag n drop development. Actually, the lower lever library that LazAndroidModuleWizard uses is written by simonsayz which also writes the same library for iOS. It's a bit unfortunate that the componentization and packaging does not abstract both libraries as LCL does at desktop level. For your convenience: Package: https://github.com/jmpessoa/lazandroidmodulewizard Android: http://blog.naver.com/simonsayz/220480419289 iOS: http://blog.naver.com/simonsayz/220485321971

I did enough research in Android for FPC to know I could do a simple OpenGL game using the JNI but it didn’t look very complete and I never could get the compiler built on my Mac. Is there enough of the Android NDK (I think it’s called) ported to Pascal so that it’s useful?

Doing something like Xamarin looks easiest because Android seems like it’s going to be hard to get working as well as iOS.

Regards,
Ryan Joseph

Reply by email

Michalis Kamburelis
to Ryan Joseph

2016-09-07 18:41 GMT+02:00 Ryan Joseph :

I did enough research in Android for FPC to know I could do a simple OpenGL game using the JNI but it didn’t look very complete and I never could get the compiler built on my Mac. Is there enough of the Android NDK (I think it’s called) ported to Pascal so that it’s useful?

Android SDK + NDK and OpenGL ES work flawlessly with Pascal:)That's what we use in Castle Game Engine to have a cross-platform game engine for desktops (Windows, Linux, MacOSX...), and mobile (Android, iOS). See http://castle-engine.sourceforge.net/engine.php . We're actually making large Android games with it, http://cat-astrophe-games.com/ :)

We have a special "built tool" that takes care of compiling and creating Android APK for your project (it calls FPC, and Android SDK / NDK tools underneath). See
https://github.com/castle-engine/castle-engine/wiki/Build-Tool and https://github.com/castle-engine/castle-engine/wiki/Android . Things are not so easy for iOS *yet* (that is, creation of iOS application from Pascal is not 100% abstracted by the tool yet), but I'm confident we'll get there in next release:)

The only downside for "normal" applications is that the GUI does not look native. We draw everything ourselves (or you can embed the engine control within a Lazarus form, and then use Lazarus GUI for it). This is not a problem for games, that traditionally have their own GUI, themed to look like the game.

Regards,
Michalis

Reply by email

Unknown author
to Ryan Joseph: I looked at a Xamarin tutorial and it looks pretty interesting if you’re willing to…
 I looked at a Xamarin tutorial and it looks pretty interesting if

you’re willing to move to C# (not so bad for Pascal guys perhaps?).

   Yep, I think so. For Phonegap I would need to learn CSS and PHP (plus get up to speed on the latest HTML), whereas learning C#, since I already know C/C++/Pascal, and being compiled rather than interpreted, is a path I'm much more comfortable with.

 Does Xamarin forms have a system where you can write one UI and

compile to multiple mobile platforms?

   Yep, that is exactly what it is for! :-) (as distinct from using just Xamarin, without Xamarin forms) The amount of native coding you do for each platform depends on how happy you are with it's appearance/performance on that platform, or if you need a platform-specific feature. You can have 100% code-sharing if you're happy with how it performs/appears cross-platform in the first place. And if you do want to do some platform-specific coding, you can have conditional compilation.

   I'm currently doing this course
- https://www.udemy.com/how-to-use-xamarin-forms-beginner-to-advanced
- and I can recommend it. I have had a few questions already, and the instructor has always responded within 24 hours so far (some instructors don't respond at all!).
-------------------------
Email sent using Optus Webmail

Reply by email

Unknown author
to Ryan Joseph: I looked at a Xamarin tutorial and it looks pretty interesting if you’re willing to…
 but I haven’t really gone full into learning how to make Android

bindings work

   Oh and you should also check out some version of MVVMcross (there's at least two I've heard of so far) while you're checking out Xamarin. You put all your business-logic into that layer, and anything platform-specific in the other layers.

-------------------------
Email sent using Optus Webmail

Reply by email

leledumbo
to Ryan Joseph: I did enough research in Android for FPC to know I could do a simple OpenGL game using…
I did enough research in Android for FPC to know I could do a simple OpenGL

game using the JNI but it didn’t look very complete and I never could get the compiler built on my Mac. Is there enough of the Android NDK (I think it’s called) ported to Pascal so that it’s useful?

I don't have Mac, but practically it shouldn't be too much different from Linux, which is I am on. We don't port NDK, we use it. To be precise, as for other platforms (when cross compiling), only the assembler, linker and system libraries are used. Everything else are simply waste of space.

LAMW has 2 OpenGL ES demos (v1 and v2) to try:
https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/demos/Eclipse/AppDemo1/jni/unit10.pas https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/demos/Eclipse/AppDemo1/jni/unit11.pas

they're integrated in AppDemo1, though. Not separate projects. Don't get tricked with Eclipse in the path name, you can build just fine with Ant only (or the provided build script:
https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/demos/Eclipse/AppDemo1/build.sh). Of course, you'll need to adjust paths inside. Your own projects will already have it configured correctly, though.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Cross-platform-mobile-development-tp5726292p5726308.html Sent from the Free Pascal - General mailing list .

Reply by email