Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 26.12.14 16:57 
Moin Forum,

ich bin seit einiger Zeit Besitzer von Delphi XE7 und wollte mich mal ein wenig mit der Entwicklung von Anwendungen für Android vertraut machen.
Einfach mal ein Formular erzeugt, mit einem Button, Tablet an den PC, Debug Modus ein, funktioniert schon mal.
Jetzt hänge ich aber etwas: Wie erstelle ich denn eine Shared Object Library? Im Menü unter "Neu" finde ich leider nur die Möglichkeit eine DLL zu erstellen...

Danke schon mal und schöne Rest-Weihnachten,
Oliver

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 27.12.14 10:30 
Ich habe es noch nicht ausprobiert, aber ich gehe sehr davon aus, dass du einfach eine DLL erstellen und die Zielplattform auf Android umstellen kannst. ;-)

Der Projekttyp DLL wurde sicher schlicht nicht umbenannt.
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Sa 27.12.14 16:31 
Nein, das geht leider nicht.

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Sa 27.12.14 19:32 
Genau genommen wäre das Target da ja nicht Android (Java-Dalvik), sondern Linux-Arm. Keine Ahnung, ob Delphi sowas überhaupt kann.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 28.12.14 00:58 
user profile iconMartok hat folgendes geschrieben Zum zitierten Posting springen:
Genau genommen wäre das Target da ja nicht Android (Java-Dalvik), sondern Linux-Arm.
Nein, das ist nicht korrekt. Delphi erzeugt keinen Code für die Dalvik Runtime, sondern nativen ARM-Code für Android, das ist quasi Linux-ARM. ;-)

Allerdings kann man ein DLL-Projekt in der Tat nicht auf Plattform Android umschalten, nur auf OSX. Wenn ich aber eine FireMonkey Anwendung erstelle, das Formular wieder entferne, aus project in der Projektdatei library mache und in der .dproj diese Zeile von Application auf Library ändere, bekomme ich eine entsprechende libProject16.so:
ausblenden XML-Daten
1:
        <AppType>Library</AppType>					

Ob das dann wirklich als Bibliothek funktioniert, weiß ich allerdings nicht. Da fehlt mir grad die Zeit das zu testen.
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Mo 29.12.14 11:33 
Hat evtl. jemand ein Beispiel für ein einfaches Delphi-XE Projekt für Android?
Einfach wo in einer .so zwei Zahlen addiert werden?
Mit der Suche im Netz komme ich irgendwie nicht weiter...

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 02.01.15 18:51 
So, bin vielleicht mal einen kleinen Schritt weiter...

Ich versuche die externe Funktion "Addiere" zu benutzen:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
unit UnitLibAufrufen;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  c :Integer;

implementation

function Addiere(a,b:Integer):Integer; stdcallexternal 'libMeineBibliothek.so';


{$R *.fmx}

procedure TForm1.Button1Click(Sender: TObject);
begin
  c := Addiere(1,2);
end;

end.


Aber in der Fehlermeldung steh Dieses:

[DCC Fehler] E2597 C:\Users\Public\Documents\Embarcadero\Studio\15.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: error: cannot find -lMeineBibliiothek

Wieso "lMeineBibliothek"? Ich versuche doch auf "libMeineBibliothek" zuzugreifen.

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...