Recent

Author Topic: Android?  (Read 58316 times)

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Android?
« on: March 11, 2009, 03:55:46 pm »
From the Android wikipedia entry: "Applications written in C and other languages can be compiled to ARM native code and run."

I don't own an Android-based device and I was just wondering if anyone here ever tried using the Lazarus cross-arm-wince compiler add-on to create ARM binaries that run on Android (w/ Wine?). It would be great if were possible to generate native code for Android in Lazarus as Android is Linux-based (I know, it's Linux not WinCE), open-source, and uses standards by the Open Handset Alliance. 

Or maybe a similar "cross-arm-linux add-on" would be required to develop applications for Android in Lazarus. Update: I found these instructions for FPC/Linux/arm/Zaurus.

Somebody figured out how to use Scratchpad to build ARM binaries for Android.

Here is an interesting comment from an article at linux.com: "Nokia's preloaded apps encourage you to create -- shoot video, share photos, blog, etc. -- while the Apple platform encourages you to consume -- buy music, buy games, buy apps. Thus far, the Android platform is encouraging users to develop." So does Lazarus/FPC, it looks like a perfect match to me. :)
« Last Edit: March 13, 2009, 03:41:17 pm by Troodon »
Lazarus/FPC on Linux

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Android?
« Reply #1 on: March 12, 2009, 04:34:33 pm »
You can already use Free Pascal to build arm-linux applications, to use Lazarus you would only need to see which GUI library is available with android. Maybe Gtk, maybe Qt, maybe None. If none, then it will be harder.

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Android?
« Reply #2 on: March 13, 2009, 03:00:47 pm »
to use Lazarus you would only need to see which GUI library is available with android. Maybe Gtk, maybe Qt

"It's official you can run X-Windows and your choice of GUI (Gnome, KDE, IceWM etc) on an Android device!". (Posting update here.)

The graphics section at developer.android.com indicates that 2D and OpenGL libraries are available for the Java SDK but I couldn't find any information on the GUI for non-X11 native programs. Apparently, the X11 cursor can be controlled using the touch-screen in Android.
« Last Edit: March 14, 2009, 06:12:58 am by Troodon »
Lazarus/FPC on Linux

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Android?
« Reply #3 on: March 16, 2009, 06:11:17 pm »
Hm, I guess I was looking in the wrong direction... what was I thinking?

http://wiki.freepascal.org/iPhone/iPod_development

"January 17, 2009 --  The FPC team is happy to announce the first widely distributed beta of the FPC iPhone SDK Integration Kit, which allows you to compile Pascal code for the iPhone and iPod Touch. It supports both the Simulator and the real devices, and includes an Xcode template with an OpenGL ES demo. It requires an Intel Mac with FPC 2.2.2 (or a later FPC 2.2.x) and the iPhone SDK 2.x installed. Please visit the wiki page for more information and the download link. "

Lazarus/FPC on Linux

Mike J

  • Jr. Member
  • **
  • Posts: 54
  • Computer Programmer/www.NewsRx.com
    • ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ ᏗᏕᎶᏆᏍᏗ (Cherokee Language Lessons)
Re: Android?
« Reply #4 on: November 19, 2009, 02:41:57 am »
Any progress towards being able to compile programs for the Android yet?  8)
ᏙᎯ

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Android?
« Reply #5 on: November 20, 2009, 12:06:37 am »
Any progress towards being able to compile programs for the Android yet?  8)

AFAIK no one is working on it at the moment. I would suggest posting a bounty if you need this technology in the near future.

Mike J

  • Jr. Member
  • **
  • Posts: 54
  • Computer Programmer/www.NewsRx.com
    • ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ ᏗᏕᎶᏆᏍᏗ (Cherokee Language Lessons)
Re: Android?
« Reply #6 on: November 27, 2009, 07:44:00 pm »
Starting bounty has been posted.

http://wiki.lazarus.freepascal.org/Bounties#Cross-Compile_to_Android_on_Ubuntu_X64

Anyone want to join in?
ᏙᎯ

TurboRascal

  • Hero Member
  • *****
  • Posts: 672
  • "Good sysadmin. Bad programmer."™
Re: Android?
« Reply #7 on: November 29, 2009, 06:03:38 am »
Seems to me the GUI is still a major problem here. It's mentioned above that the only GUI widgetsets which could be available are Win32 (via Wine) and usual widgetsets for the X11... No access to the native widgetset is available?

I guess that full porting would also require porting LCL for the native widgetset... or at least porting fpGUI to it.
Regards, ArNy the Turbo Rascal
-
"The secret is to give them what they need, not what they want." - Scotty, STTNG:Relics

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Android?
« Reply #8 on: December 05, 2009, 02:56:01 am »
I have some simple FPC 2.2.2 ARM Linux distros here:
  http://www.turbocontrol.com/monitor.htm

But those distros produce OABI apps whereas I think that the Android OS probably needs EABI.   FPC 2.2.4 or later supports EABI but there is no supplied FPC 2.2.4 ARM Linux compiler and I haven't spent the time to compile one myself.  See this page for more OABI/EABI information:
  http://wiki.debian.org/ArmEabiPort

I wish there was a FPC 2.2.4 ARM Linux compiler available like there was for 2.2.2.

I am using fpGUI with FPC 2.2.2 ARM Linux and I'd sure like to try fpGUI ASAP on Android.
« Last Edit: December 05, 2009, 03:00:57 am by PaulBreneman »
Regards,
Paul Breneman
www.ControlPascal.com

Mike J

  • Jr. Member
  • **
  • Posts: 54
  • Computer Programmer/www.NewsRx.com
    • ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ ᏗᏕᎶᏆᏍᏗ (Cherokee Language Lessons)
Re: Android? ... Android NDK?
« Reply #9 on: December 05, 2009, 10:17:55 pm »
http://developer.android.com/sdk/ndk/1.6_r1/index.html#overview

Quote
What is the Android NDK?

The Android NDK provides tools that allow Android application developers to embed components that make use of native code in their Android applications.

Android applications run in the Dalvik virtual machine. The NDK allows developers to implement parts of their applications using native-code languages such as C and C++. This can provide benefits to certain classes of applications, in the form of reuse of existing code and in some cases increased speed.

The NDK provides:

    * A set of tools and build files used to generate native code libraries from C and C++ sources
    * A way to embed the corresponding native libraries into application package files (.apks) that can be deployed on Android devices
    * A set of native system headers and libraries that will be supported in all future versions of the Android platform, starting from Android 1.5
    * Documentation, samples, and tutorials

This release of the NDK supports the ARMv5TE machine instruction set and provides stable headers for libc (the C library), libm (the Math library), OpenGL ES 1.1 (3D graphics library), the JNI interface, and other libraries.
ᏙᎯ

Stamp

  • Newbie
  • Posts: 2
Re: Android?
« Reply #10 on: August 09, 2010, 07:17:04 am »
Android is now the #1 used mobile OS now, I'm surprised that there hasn't been much discussion about it here (as you can tell by the 8 month Bump). Am I looking at the wrong place?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Android?
« Reply #11 on: August 09, 2010, 02:50:33 pm »
I am planning on starting an Android widgetset for Lazarus and I started documenting the idea here:

http://wiki.freepascal.org/Android_Interface

The time frame is rather long, because I am rather busy. I predict it should be usable in 1 year.

Financial contributions for this project are of course welcome. (just contact me via PM/e-mail)

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Android?
« Reply #12 on: August 10, 2010, 09:12:14 am »
but Felipe, as i understand the plan is to create a wrapper between Lazarus/Freepascal applications and Java, do i understand correctly?

Well if so, would that not be slow?
If so we would have a Java dependency for our applications.


Would that be a temporally solution for a later native application?
maybe i understood wrong...

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Android?
« Reply #13 on: August 10, 2010, 09:47:28 am »
but Felipe, as i understand the plan is to create a wrapper between Lazarus/Freepascal applications and Java, do i understand correctly?

That more or less already exists. The bulk of the work would be creating the generic Java encapsulating program and a new Lazarus widgetset which communicates with it.

Quote
Well if so, would that not be slow?

No, because most of the code running will be native Pascal. Only the Android GUI Library is in Java. The encapsulating application will be a thin layer, similar to the DLL which binds Qt to Pascal.

Quote
If so we would have a Java dependency for our applications.

It's the GUI API of Android. You cannot have Android without the Java GUI API. It is already installed in all Android phones. Lazarus applications also depend on the Windows API on Windows.

Quote
Would that be a temporally solution for a later native application?

No, Android has no native API, so you cannot have a fully native application unless it is an OpenGL application without native look and without integration to the PDA APIs (like contacts, sms, camera, etc)

Another possible solution would be building the entire application into Java bytecode, by adding a new architecture to FPC, a new RTL and then a new Lazarus widgetset. But this would be around 2 orders of magnitude more work.
« Last Edit: August 10, 2010, 09:49:30 am by felipemdc »

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Android?
« Reply #14 on: August 10, 2010, 11:32:21 am »
I see, thanks for the explanation

 

TinyPortal © 2005-2018