2017년 4월 2일 일요일

2017년 3월 11일 토요일

Calling apps from the web with Android Intent


How to call the Delphi Firemonkey App from a web page via Android Intent.

At this point, the URL parameter values are sent to the App.


1. Create an html page and install it on the web. (callapp.html)
<a href="delphiapp://callType1?title=This is a Type1&data1=1111&data2=2222">call Type1</a><BR><BR>

<a href="delphiapp://callType2?title=This is a Type2&data1=3333&data2=4444&data3=5555">call Type2</a><BR><BR>

<a href="delphiapp://callType2?title=Type2 : 한글로 된 제목&data1=6666&data2=7777&data3=3번째 데이터">call Type2 한글</a><BR><BR>



2. Add the same intent-filter entry to the html page's uri entry in the AndroidManifest.template.xml file.



3. Create a Delphi Project.
procedure TForm1.FormCreate(Sender: TObject);
{$IFDEF ANDROID}
var
  intent: JIntent;
  uri: Jnet_Uri;
  uriStr: String;
  rValue : TStringList;
  i : integer;
{$ENDIF}

begin
  {$IFDEF ANDROID}
  intent := SharedActivity.getIntent;
  if intent <> nil then
  begin
    if TJIntent.JavaClass.ACTION_VIEW.equals(intent.getAction) then
    begin
      uri := intent.getData;
      uriStr := JStringToString(uri.toString);  // read uriStr

      rValue := Get_URL_String( uriStr );  // parsing value

      for i := 0 to rValue.Count-1 do
         Memo1.Lines.Add( rValue[i] );
    end;
  end;
  {$ENDIF}
end;



Demo Video

2016년 12월 6일 화요일

Firemonkey 2D/3D Graph Chart Demo Project

I release the project that draws charts using various Firemonkey's  graphical components and objects.
The Demo Project reads the data from the SQLite Database Table and draws a graph chart.

It has the following features.

  • Demo Project built with Delphi Berlin update2.
  • Multi Platform Support: Windows / Mac OS X / Android / iOS.
  • Demo uses SQLite but uses FireDAC, so all databases can be linked.
  • Database Table Generates graphs that match the aspect ratio automatically, regardless of the number of records.
  • The Demo draws two charts, but you can easily draw multiple charts simultaneously.
  • Graph range is based on maximum value of record value and can be specified at runtime.
  • 2D Graph can draw on all Firemonkey's visible objects (TControl). Demo created above Rectangle object.
  • The total size of the 2D Graph is automatically set to match the size of the dynamically generated TLayout.
  • 3D Graph can be changed by mouse or touch Viewpoint.
  • 3D Graph size is set as camera Z coordinate value.
  • The 3D Graph range is automatically set to match the size of the dynamically generated TLayout3D.
  • The front and back positions of the screen reference of the 3D chart which is generated redundant are designated as the Z coordinate value of TLayout3D.
  • For Demo, 3D Graph Chart can be easily called from other projects using TFrame.

 2D chart creation method


 3D chart creation method

Sample data (SQLite Table)