How to view Android package apps and call SMS or phone apps in Delphi FMX

 


unit Gradation;

unit MUnit1;

interface

uses

  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,

  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls,

  Androidapi.JNI.GraphicsContentViewText,

  Androidapi.JNI.JavaTypes,

  FMX.Helpers.Android,

  AndroidApi.Helpers,

  Androidapi.JNIBridge,

  Androidapi.JNI.Net;


type

  TForm1 = class(TForm)

   Button1: TButton;

    Button2: TButton;

    procedure Button1Click(Sender: TObject);

    procedure Button2Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

var

  Form1: TForm1;

implementation

{$R *.fmx}

procedure TForm1.Button1Click(Sender: TObject);

var

  PM: JPackageManager;

  mainIntent: JIntent;

  LaunchIntent: JIntent;

  pkgAppsList: JList;

  ri: JResolveInfo;

  iter: JIterator;

  midlist : TStringList;

begin

  PM := SharedActivityContext.getPackageManager;

  mainIntent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_MAIN, nil);

  mainIntent.addCategory(TJIntent.JavaClass.CATEGORY_LAUNCHER);

  pkgAppsList := PM.queryIntentActivities(mainIntent, 0);

  midlist := TStringList.Create;

  iter := pkgAppsList.iterator;

  while iter.hasNext do

  begin

    ri := TJResolveInfo.Wrap((iter.next as ILocalObject).GetObjectID);

    mIdList.Add(JStringToString(ri.activityInfo.applicationInfo.packageName));

  end;

  LaunchIntent := PM.getLaunchIntentForPackage(StringToJString(mIdList[2]));

// 특정 앱  실행 방법.

// LaunchIntent := PM.getLaunchIntentForPackage(StringToJString( 'com.samsung.android.messaging') );

// SharedActivityContext.startActivity( LaunchIntent )

  showmessage(  mIdList.Text );

end;



procedure TForm1.Button2Click(Sender: TObject);

var

  PM: JPackageManager;

  Intent: JIntent; //Declares the intent object

begin

  PM := SharedActivityContext.getPackageManager;

  Intent := TJIntent.Create;

  Intent.setData( TJnet_Uri.JavaClass.parse(StringToJString('smsto:01012345678')));   // sms

// Intent.setData(TJnet_Uri.JavaClass.parse(StringToJString('tel:' + ANumber)));      // call

  Intent.putExtra(TJIntent.JavaClass.EXTRA_TEXT, StringtoJString( 'Hellow' ));

  Intent.setAction(TJIntent.JavaClass.ACTION_VIEW); //Defines the Action.

  if SharedActivityContext.getPackageManager.queryIntentActivities(Intent, TJPackageManager.JavaClass.MATCH_DEFAULT_ONLY).size > 0 then //Checks if there is at least one application capable of receiving the intent.

     SharedActivityContext.startActivity(Intent) //Calls startActivity() to send the intent to the system.

  else

    ShowMessage('Receiver not found');

end;


end.

YouTube Mood Lights with gradient colors(Screensaver) FMX Project

 I open the source of the video production, which is recording very high views.

With Delphi FMX projects, you can easily create videos like this.

Let's try it.









DESKTOP UX Summit

 * Science of Great UI

https://summit.desktopfirst.com/talks/science-of-great-ui/


유저 인터페이스의 과학적 접근.

사람의 생물학적 인지 능력을 바탕으로 한 UI 설계에 대한 방향을 제시함.

버튼의 형태나 색상등을 어떻게 디자인 하는것이 사용자가 좀더 쉽고 편하게 사용하고 인지 할 수 있는지에 대한 분석



* Legacy desktop apps UI & UX modernization. From theory to practice.

https://summit.desktopfirst.com/talks/legacy-desktop-apps-ui-ux-modernization-from-theory-to-practice/



이론과 실습을 통해 오래된 레거시 Delphi 앱용 UI 및 UX를 마이그레이션하는 방법에 대한 경험을 논의함.



* Strategies for Building and Optimizing the Desktop UX

https://summit.desktopfirst.com/talks/strategies-for-building-and-optimizing-the-desktop-ux/


많은 연구와 시도가 진행되는 모바일 앱의 UI 디자인과 달리 데스크탑 UI 디자인은 계속 숙제를 가지고 있다.

비지니스적으로 중요한 데스크탑의 UI 디자인의 전략은 매우 중요하며 이에 대한 연구해 볼 필요가 있다.

(비교적 짧은 영상임 3분40초)



* Effective UX Design for Multiplatform Apps

https://summit.desktopfirst.com/talks/effective-ux-design-for-multiplatform-apps/


델파이에서 제공하는 수많은 콘트롤들을 어떻게 활용하면 멀티플랫폼에 적합한 효과적인 UX Design을 할 수 있는지 알아본다.


Free distribution of JSON function auto-generation application for Delphi users.

This application automatically creates a Delphi function to generate JSON data.
How to use is as follows.

1. Select Object type or Array type.
2. Enter JSON data name and data
3. Enter the array name and sample counter
4. Creation complete
5. Copy source to clipboard.
6. Copy the Delphi function to the sample project and use it.

The application is free.
Sample project for Delphi testing project is also included in the download file.





Let's do a great FMX app design with photos.

Embarcadero CodeRage 2019 

Let's do a great FMX app design with photos.




Demo project source Download


Example of how to retouch a photo image in Adobe Photoshop.
Apply a Gaussian blue filter and blending effect to use the photo as the background of your app.
Likewise, the same functions used in Photoshop can be used in the FMX environment.

Demo Project comments

1. Make two Rectangle.
2. Change the color of the top Rectangle to black.
3. The black Rectangle should be at the top.
4. Set the Align property as the contents so that the two rectangles cover the screen.
5. Other previously created UI objects reposition over the rectangle.
6. Set the transparency of the black rectangle to 0 to make it invisible.
7. Load and apply a photo file to the background of the base rectangle.
8. Change the color of the objects on the photo to make it easier to see.
9. To apply a blur effect to a photo, select TBlurEffect or TGaussianBlur Effect and apply to base Rectangle.
10. Change the value to make it look good. 
11. Adjust the black rectangle transparency with the Opacity.
12. You can also apply other pictures.