Recent

Author Topic: Developing for Android with Pascal and Eclipse  (Read 27050 times)

Phil

  • Hero Member
  • *****
  • Posts: 2737
Developing for Android with Pascal and Eclipse
« on: November 05, 2012, 03:35:25 am »
I've written up some notes on integrating FPC's JVM compiler with Eclipse to do Android development.

http://web.fastermac.net/~MacPgmr/pba/PbaStatus.html

Once set up, you should be able to do Android development with only one notable difference from normal Eclipse-based development: you'll write for the Android Java API using Pascal instead of Java. How nifty is that?

Let me know if you spot any mistakes in what I've written or if I've left out anything important. For example, is this enough information to get started? Is a non-trivial example needed, perhaps one that uses a SQLite database? Etc.

Thanks.

-Phil

denver

  • Jr. Member
  • **
  • Posts: 67
Re: Developing for Android with Pascal and Eclipse
« Reply #1 on: November 05, 2012, 01:35:27 pm »
Thanks Phil !  We really need a more detail guide ( step by step )  for developing Android using Free Pascal.
I will take a deep look of your note tonight.

Giu

  • Full Member
  • ***
  • Posts: 131
Re: Developing for Android with Pascal and Eclipse
« Reply #2 on: November 05, 2012, 07:08:38 pm »
OMG Phill, you are giving me a lot of work reading this 2 days  >:D  ;D

Very interesting work. Following it.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Developing for Android with Pascal and Eclipse
« Reply #3 on: November 06, 2012, 03:16:39 am »
Thanks Phil !  We really need a more detail guide ( step by step )  for developing Android using Free Pascal.

You should be able to utilize any decent Eclipse / Java tutorial since the only real difference for us is that we're using Pascal instead of Java - most things related to Eclipse, the Android Java API, etc. should apply to Pascal the same as to Java.

I had intended to read this tutorial myself but forgot, but I see it has a lot of nice screenshots for setting up the Android SDK if you've never done that before. This guy really put some work into it and it's up to date:

http://www.vogella.com/articles/Android/article.html

Thanks.

-Phil

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Developing for Android with Pascal and Eclipse
« Reply #4 on: November 06, 2012, 03:25:03 am »
OMG Phill, you are giving me a lot of work reading this 2 days  >:D  ;D


If you've been away from Lazarus and Free Pascal for a while, you'll probably notice that there's a lot of new stuff in the wings in the trunk source for both, for example the JVM compiler, which follows on the heals of FPC 2.6's Objective Pascal dialect for working with Objective-C frameworks on OS X and iOS.

Just take it slow and absorb by osmosis.

Thanks.

-Phil

mdalacu

  • Full Member
  • ***
  • Posts: 233
    • dmSimpleApps
Re: Developing for Android with Pascal and Eclipse
« Reply #5 on: November 06, 2012, 08:28:02 am »
This are great news! For anyone to start quickly it would be perfect if someone could provide an VirtualBox image with Ubuntu and everything configured.
If we are using pascal for Android is there any speed penalty in code execution that we must be aware of?
Thank you very much for this! ;D

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: Developing for Android with Pascal and Eclipse
« Reply #6 on: November 06, 2012, 12:16:34 pm »
Wow, looks great :o . I would like to see similar tips for NetBeans :)

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Developing for Android with Pascal and Eclipse
« Reply #7 on: November 06, 2012, 07:49:45 pm »
Wow, looks great :o . I would like to see similar tips for NetBeans :)

I have no experience with NetBeans IDE. Do you see any advantages to NetBeans for Android development over the recommended IDE, which is Eclipse? Or are you speaking more broadly about NetBeans for desktop Java development?

Thanks.

-Phil



Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: Developing for Android with Pascal and Eclipse
« Reply #8 on: November 06, 2012, 10:27:22 pm »
I have used Eclipse for a long time. Why I moved to NetBeans?

Advantages:
  • Have plugin for android too
  • NetBeans is very lightweight compared to Eclipse
  • Better views (everything is clear)
  • Better debugging (like in lazarus. In eclipse you need change view)
  • Better android source tree management. Eclipse offten was able to strange behavior, for example it had problems with refreshing resources (like icons, strings resources etc)
  • Finally I moved to NetBeanse when Eclipse crashed after updating android SDK

Disadvantages:
  • NetBeans doesn't have (yet) android GUI designer

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Developing for Android with Pascal and Eclipse
« Reply #9 on: November 07, 2012, 01:05:21 am »
Quote
NetBeans is very lightweight compared to Eclipse
Are you sure you didn't write it reversed? :o

sandeep_c24

  • Full Member
  • ***
  • Posts: 114
Re: Developing for Android with Pascal and Eclipse
« Reply #10 on: November 07, 2012, 05:18:40 am »
The one thing that always stops me from trying these new things with Lazarus/FPC is the missing installers for different compilers. It would be great if someone could just build the required compilers or libs and we just download and use/try them.

Cheers

Sandeep

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Developing for Android with Pascal and Eclipse
« Reply #11 on: November 08, 2012, 04:48:20 am »
The one thing that always stops me from trying these new things with Lazarus/FPC is the missing installers for different compilers. It would be great if someone could just build the required compilers or libs and we just download and use/try them.

Technology like FPC's JVM compiler is not yet in a stable release. For now, you'll need to build the compiler yourself, but it doesn't affect your installed stable version of FPC (if that's a concern). I would suggest trying to build it and see if it isn't easier than you think.

If you look at the Android SDK, it also assumes that you sort of "build" it by downloading and adding in various pieces - it doesn't come in one comprehensive install. That's an approach that is probably becoming more common, not less, so we need to adapt I suppose.

Thanks.

-Phil

Giu

  • Full Member
  • ***
  • Posts: 131
Re: Developing for Android with Pascal and Eclipse
« Reply #12 on: November 08, 2012, 10:33:56 pm »
Quote
NetBeans is very lightweight compared to Eclipse
Are you sure you didn't write it reversed? :o

It happens to me too that seems Neatbeans more lightweight than eclipse. I prefer it. As he sais, more clear to my eyes developing.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Developing for Android with Pascal and Eclipse
« Reply #13 on: November 09, 2012, 12:05:45 pm »
Quote
It happens to me too that seems Neatbeans more lightweight than eclipse. I prefer it. As he sais, more clear to my eyes developing.
Well, actually I don't even have them installed on my machine (and they will NEVER be :P), I only use them when I'm forced to. Seems like you need to tailor (a lot) either to a very specific needs to make them really lightweight (and even so, none would beat Lazarus). It's a choice anyway.

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: Developing for Android with Pascal and Eclipse
« Reply #14 on: November 09, 2012, 02:12:45 pm »
I only use them when I'm forced to
Me too, but when I must, I choice NetBeans. Of course none beat Lazarus :P. But I always fail when I try to configure cross-compiler for android. Wiki articles about lazarus for android are so much defragmented, linux image with configured lazarus is outdated and CodeTyphon has some issues with compile arm-android element on linux host.
So I'm waiting for a day when friendly solution will be ready. But even if this day become, I have doubts about writting android apps in lazarus. I'm afraid that I get stuck in the middle of the project, because for example I will can not use some android api in pascal.
« Last Edit: November 09, 2012, 02:14:25 pm by Dibo »

 

TinyPortal © 2005-2018