Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Pascal on Android: I made it work!

  1. #1

    Pascal on Android: I made it work!

    Hey guys,

    After a long time of silence, I decided to do some pascal development again. I bought an ASUS EEE pad transformer recently, and I would like to see if I can create some games/apps for it.

    I allready fiddled with JAVA, which is the main tool for creating apps for android. The tools google delivers are really easy to use IMHO, so for any non-performance-critical apps JAVA is just fine. However, when it comes to games, I'd like to benefit from the extra performance that a compiled language can deliver.

    So today checked out these tutorials to get started:

    http://wiki.freepascal.org/Setup_Cross_Compile_For_ARM
    http://wiki.lazarus.freepascal.org/Android_Interface

    There are easier ways. In retrospect, I didn't HAVE to build everything from source lol . On the other hand, I now have FPC 2.7.1 and Lazarus 0.9.31 (the brand new ones, I believe) to play with.

    I must say that it was quite a struggle. It took me over 5 hours, but in the end, I got that sample working (2nd URL). To be honest, the UI was too small and didn't work that well, but it's still pascal code under the hood. Moreover, I won't be using pascal for any android UI's, because there isn't much support yet, and doing that part in JAVA is more effective.

    But what's next? Does anybody know whether SDL works? And if not, how do I go about accessing audio/touch/accelometer functionality?

    Thanks
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2
    Congratulations mate! I will have to try some of this myself as I have an Android tablet

    cheers,
    Paul

  3. #3
    hmm...it seems that I need Android 3.x on my device first, so I don't think I will bother going this route then (I only have 2.3.x ATM).

    I will have a play with RemObjects' Project Cooper (Oxygene for Java (and Android)) and see if I can get something running that way instead, even though I have to get used to the syntax first LOL

    cheers,
    Paul

  4. #4
    hmm...it seems that I need Android 3.x on my device first, so I don't think I will bother going this route then (I only have 2.3.x ATM).
    I don't really see the problem with this. What happened?
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  5. #5
    Quote Originally Posted by chronozphere View Post
    I don't really see the problem with this. What happened?
    The problem is that I don't have a 3.x version of Android available for my device yet, only 2.3.x. This means I would have to wait to try this method out till after I can get a later version installed.

    cheers,
    Paul

  6. #6
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Does anybody know whether SDL works?
    I believe that is possible, I recall a discussion about this earlier on in the year, I'll run a forum search and see if I can pull anything up, HOWEVER - if sdl is slow on a PC and that has many GhZ and many gigs of RAM (despite less pixels to shift) unless your on the new A(5 is it?) which have 2 cores I can't see it being the best idea. My suggestion would be to either look into OpenGlES and write a compact little unit or to look into ZenGl, I know Andru's been putting in some magic stuff there and it runs on just about anything that has a transistor in it.

    Aside from all that, theres a FPC 2.7.X out?! We're still on 2.5.5 in the APT repos... I'll have to check out my debs manually then. Oh, and one last thing: does the new lazarus interface still have those one million and one pesky windows floating about?
    Last edited by code_glitch; 28-10-2011 at 02:28 PM.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  7. #7
    Quote Originally Posted by paul_nicholls View Post
    The problem is that I don't have a 3.x version of Android available for my device yet, only 2.3.x. This means I would have to wait to try this method out till after I can get a later version installed.

    cheers,
    Paul
    Why not develop for 2.3? Nothing wrong with that. It's all possible.

    Well, I will use SDL in conjunction with OpenGLES. However, it seems that SDL Audio doesn't completely work on android yet, so I might just go for pure OpenGLES with another sound library (any suggestion that works for android?). Maybe I should just wrap the JAVA audio API via JNI, but that's no fun at all.

    And FPC 2.7.1 was build from the most recent development snapshot, so it's not the stable one. You can get it here: http://www.freepascal.org/develop.var The APT repo's (guess you are using an ubuntu/debian derivative) aren't updated frequently. I had to get debs or build things from source quite often to be honest.
    Lazarus hasn't changed that much. The only difference I have found yet, is that you can't rebuild the LCL anymore via the menu's, because it's now a package (which is automatically rebuild for your target when neccesary ^^)
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  8. #8
    How about the rumored "low level" APIs, C APIs into Android? Does that exist, how much of the Java garbage can be bypassed?

  9. #9
    Quote Originally Posted by Ingemar View Post
    How about the rumored "low level" APIs, C APIs into Android?
    They are available, but there are no Pascal header translations for that - at least not that I know of. Also, the C APIs aren't really for usual GUI app development, they are designed for OpenGL apps or other low-level stuff.
    Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
    Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)

    Programmer: A device for converting coffein into software.

  10. #10
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    @Stoney: Couldn't we just use the low level stuff and then dump the lazarus UI stuff onto that instead of Java as we currently do?

    Historically, anything based on proper code is faster than Java... How many headers would have to be translated to get a minimal system up and running?
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •