

Fabian1648
Members-
Content Count
38 -
Joined
-
Last visited
Community Reputation
1 NeutralRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
I found the source of the problem using Android Device Monitor. the permission "record sounds" was not enabled in the project parameters of the app! In this case, Android's permissions management doesn't seem to work perfectly since the code was working sometimes.
-
Hello, I'm trying to use Google's voice recognition service in an Android app but my app loses control when retrieving data. 1° In the triggered event, it is not possible to process the provided answer (the app loses the hand and Android indicates the app does not answer anymore after several seconds) procedure TForm1.SpeechRecognition1Recognition(Sender: TObject; Guess: string); begin ... // Impossible to do something end; 2° If I start a timer, the code in the timer works and the app does not lose control procedure TForm1.SpeechRecognition1Recognition(Sender: TObject; Guess: string); begin timer3.Enabled:=true; end; procedure TForm1.Timer3Timer(Sender: TObject); begin try ... finally timer3.Enabled:=false; end; end; 3° If I try to transmit the obtained answer through a global variable to be able to process it in the timer code, same behaviour of point 1 most of the time (it works sometimes...) procedure TForm1.SpeechRecognition1Recognition(Sender: TObject; Guess: string); begin G_Heard:=Guess; timer3.Enabled:=true; end; procedure TForm1.Timer3Timer(Sender: TObject); begin try ShowMessage('Start timer3: '+G_Heard);//DEBUG finally timer3.Enabled:=false; end; end; Does anyone have an explanation or solution to prevent the app from getting out of control? Thank you in advance
-
[Android] How to change regional settings
Fabian1648 replied to Fabian1648's topic in Cross-platform
Thank you all for your help. The problem is solved. -
[Android] How to change regional settings
Fabian1648 replied to Fabian1648's topic in Cross-platform
Great! This is exactly what I was looking for! Your code uses the date format provided by the OS but forces the display of the year to 4 characters. Thanks a lot Vandrovnik! -
[Android] How to change regional settings
Fabian1648 replied to Fabian1648's topic in Cross-platform
1) If you use FormatDateTime to define in your Delphi code a custom date format as "yyyy-mm-dd", you will have this format regardless of the country where you use the software: 2022-08-05 in France, 2022-08-05 in USA, 2022-08-05 in Deutschland or in Japan. Each country has his standard. In France, the date format is "05/08/2022" and not "2022-08.05"! That's why the regional settings of an OS exist! 2) Our software must be used worldwide. The date format must be adapted for the country where it is used. 3. We don't want to replace the regional settings of the OS with Delphi code that specifies settings for every country in the world! We want that the regional settings display date with 4 characters ans not 2 for the year. That's it! -
[Android] How to change regional settings
Fabian1648 replied to Fabian1648's topic in Cross-platform
I have already tried TFormatSettings.LongDateformat... -
[Android] How to change regional settings
Fabian1648 replied to Fabian1648's topic in Cross-platform
Here is my problem: Why the default TFormatSettings.ShortDateformat displays the year with 4 characters under Windows, but only with 2 characters under Android? Isn't there a way to notify Android that you want the year with 4 characters instead of 2 without changing the regional settings? -
[Android] How to change regional settings
Fabian1648 replied to Fabian1648's topic in Cross-platform
When you have a software that is used in different countries, the date display format changes from one time to another (In France, you will have a "dd/mm/yyyy", in the USA a "mm-dd-yyyy", etc.). If you use a custom format in the code, you will have to create a custom format for each country!!!!!!!!!! So, I would simply force the display of the year with 4 characters instead of 2... -
[Android] How to change regional settings
Fabian1648 replied to Fabian1648's topic in Cross-platform
I have a problem with FormatSettings.ShortDateFormat: When I use it to display a date according to the country standard (e.g. the order "day, month, year" is not suitable in the USA), the year is only displayed with 2 characters. I'd like to take advantage of the default date format defined by the Android device OS but force the year to be displayed with 4 characters instead of 2. If I force the date format (example with a "dd mm yyyy"), I will lose the automatic adaptation of the date format according to the country... -
Hello, Is it possible to change the regional settings of an Android device via Delphi code? If so, how? Thank you
-
Hi, In an Android application, how can we catch the exception that is triggered when we make a REST request that remains unanswered. The following code does not work. When we launch the REST request, the app freezes until the REST timeout is exceeded and then Android displays a message "the app does not respond" try //Blabla... except on E: Exception do begin //blabla... end; end;
-
[Android][FMX] Which solution to have a full size app icon with Android 10?
Fabian1648 replied to Fabian1648's topic in FMX
Thanks for all answers! -
[Android][FMX] Which solution to have a full size app icon with Android 10?
Fabian1648 replied to Fabian1648's topic in FMX
@vfbbStarting from an empty project, I have done your example successfully. Now I have my standard icons (.png files up to 144 pixels). How can I use my .png files as Adaptive Icon? I have converted a .png file to .svg (I obtain about hundred different "d=" lines!... I concatenated them to have only one "d="), but in the end I obtain only on the Android device a white square as icon. I have as "ic_laucher_background.xml": <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="108dp" android:height="108dp" android:viewportWidth="108.0" android:viewportHeight="108.0"> <path android:name="square" android:fillColor="#ffffffff" android:pathData="M0,0 L108,0 L108,108 L0,108 z" /> </vector> I have as "ic_launcher_foreground.xml" <vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt" android:width="108dp" android:height="108dp" android:viewportWidth="108" android:viewportHeight="108"> <path android:name="square" android:fillColor="#ffffffff" android:pathData="M1590 1370 c0 -5 5 -10 10 ..........." /> </vector> Is this the right approach to tranform my .png icons in adaptives icons? -
[Android][FMX] Which solution to have a full size app icon with Android 10?
Fabian1648 replied to Fabian1648's topic in FMX
I must be a fool because I tried to follow the examples of both Dalija and vfbb and it doesn't work with Delphi Rio: I still have the basic icons (the Delphi flame). In my case, it's the customized Android OS of the device manufacturer that shown my icon with an external white frame. Are the adptative icons the only solution to remove this problem or is there an alternative way to disable this customized behavior? -
[Android][FMX] Which solution to have a full size app icon with Android 10?
Fabian1648 replied to Fabian1648's topic in FMX
@corneliusdavid: Yes! I wrote " On Android 10, the app icon is reduced to a small size with a huge white frame around it". I tried it on another Android 10 device and the icons appear normal. So the problem is not with Android 10 but with the use of Android 10 by the device manufacturer. I tried to add files through "Project > Deployment": I can add a file but I can't modify the corresponding values, I end up with an empty value under "Local path" and the value "file" under "Type" without being able to edit and modify the values linked to the added file. @ dalija.prasnikar: I looked at your zip. So if I understand correctly: I don't modify in "Project > deployment" the icons defined by Delphi via "Project > options" I add the files of the additional icons in "Project > deployment" I modify the manifest.xml file Is this correct?