[fpc-devel] Free Pascal JVM and Android media player API call issue

Mgr. Janusz Chmiel janusz.chmiel at volny.cz
Sun Mar 31 18:39:10 CEST 2019


Dear specialists,
My name is Janusz Chmiel. I have found amazing project from 2017 
available here.
https://sourceforge.net/p/javavcl/code/HEAD/tree/
I AM sad, because I do not know, why I can not call Android Media player 
APIS.
The main source of my attempt is here.
Nobody elsewhere do not want to give Me a piece of advice, what I Am 
doing wrong? And this project is The onlyone non visual based bundle, 
which can I use as a user with no sight at all, since modern projects 
based on visual designers are less useful for Me. Because I do notsee on 
The computer screen so I can not determine which values for object 
positioning should I put inside .lfm file.
Thank you very very much for yours help.

unit MainForm;
{$mode objfpc}
{$H+}
interface
uses _System, Classes, Controls, Dialogs, Forms, GenChars, LCLIntf, 
Menus, StdCtrls, SysUtils, androidr22;
type
TFormMain = class(TForm)
jMediaPlayer1: AMMediaPlayer ;
PlayButton: TButton;
protected
procedure ButtonClick(A: TObject);
public
constructor Create(A: TComponent); override;
end;
var
FormMain: TFormMain;
implementation
constructor TFormMain.Create(A: TComponent);
begin
inherited;
Caption := Application.Title;
PlayButton:= TButton.Create(Self);
PlayButton.Align := alTop;
PlayButton.Parent := Self;
PlayButton.Caption := 'Play live stream';
PlayButton.OnClick := @ButtonClick;
(*
*)
(*
*)
end;
procedure TFormMain.ButtonClick(A: TObject);
begin
if A = PlayButton then begin
//jMediaPlayer1.setAudioStreamType(AudioManager.STREAM_MUSIC);
//jMediaPlayer1.setDataSource('http://icecast7.play.cz/cro1-128.mp3');
//jMediaPlayer1.Prepare();
//jMediaPlayer1.Start();
end;
end;
end.

What should I had to do to make my little player working? What I Am 
doing wrong? Or it is impossible to call Android APISby using this old 
project?
Thank you very much for yours time and for yours patience with my plea.
With warmest regards.
Janusz Chmiel



More information about the fpc-devel mailing list