Jump to content

mausmb

Members
  • Content Count

    55
  • Joined

  • Last visited

Posts posted by mausmb


  1. With Delphi 12.1 I have a problem with building 32-bit Android APK  (With Delphi 11 and delphi 12 same project everything working/build fine).

     

    DCC Error E2597 ..arm-linux-androideabi-ld.exe: error: cannot find -ldl

    DCC Error E2597 C:\Users\Public\Documents\Embarcadero\Studio\23.0\CatalogRepository\AndroidNDK-21-23.0.51961.7529\android-ndk-r21\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.exe: error: cannot find -ldl

     

    Any idea how to find/solve that problem ?

     

    reproduction : Any Simple MultiDevice app ... and build for Android 32

     

    Best regards,
    Marjan Android32_error.thumb.png.34d654262cfc38e0c8649749a8cb3f47.png


  2. Hi,

     

    With Android Studio installed and SDK for API Level 33 .. is not working (for me). Because :

    1. I have to manually edit AndroidManifest file (  <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="33" />).

    2. It's working on Pixel 3 ... but not on Pixel 7 (app just close).

    3. if I change same configuration to android:targetSdkVersion="32" ... it's working on Pixel 7. 

    4.  I didn't find and know how to properly install  latest NDK   (gdbserver....) - so for all unknown's in NDK I left old path/files.

     

     

    image.thumb.png.c402eabd4f0b9a29b61d661e09d474a8.png

     

    Unkonowns

     

    strip.exe  is not ther ..llvm-strip.exe 

     

    NDK API LEVEL LOCATION
    C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.48361.3236\android-ndk-r21\platforms\android-23

     

    image.thumb.png.a7277047ecddabe394fa4cd8ccb7c099.png

     

     

     

    c++ builder NDK library path:
    C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.48361.3236\android-ndk-r21\platforms\android-23\arch-arm64\usr\lib

    Delphi ndk library path:
    C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.48361.3236\android-ndk-r21\sources\cxx-stl\llvm-libc++\libs\arm64-v8a;C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.48361.3236\android-ndk-r21\platforms\android-23\arch-arm64\usr\lib

     

     

    If Anybody have working setup - please let me know where are those files 🙂 

     

    Regards,

    Marjan 


  3. Hi,

    Great .. I'm curious how do you solve Android biometric working on Android  with Biometric privilega and activity/intents ?  

    There a "bug" in Androidapi.JNI.Os.pas you can't call TJManifest_permission.JavaClass.USE_BIOMETRIC) (USE_BIOMETRIC is not included).

    in AndrodiManifgest.xml i have "    <uses-permission android:name="android.permission.USE_BIOMETRIC" />" but nothing in Activity section.

     

    image.thumb.png.04750e97284970dc9029e6b282ca208b.png


    Regards,
    Marjan


  4. Hi,

     

    image.png.0050c803f8b8e09fc5b099eb60467657.png

     

    unit2.pas (C:\Users\Public\Documents\Embarcadero\Studio\22.0\Samples\Object Pascal\Multi-Device Samples\Device Sensors and Services\Bluetooth\Beacons\Beacons Proximity)

     

        LOCATION_PERMISSION = 'android.permission.ACCESS_FINE_LOCATION';
        BLUETOOTH_SCAN_PERMISSION = 'android.permission.BLUETOOTH_SCAN';
        BLUETOOTH_ADVERTISE_PERMISSION = 'android.permission.BLUETOOTH_ADVERTISE';
        BLUETOOTH_CONNECT_PERMISSION = 'android.permission.BLUETOOTH_CONNECT';

     

      if TOSVersion.Check(12) then
        Permissions := [LOCATION_PERMISSION, BLUETOOTH_SCAN_PERMISSION, BLUETOOTH_ADVERTISE_PERMISSION, BLUETOOTH_CONNECT_PERMISSION]
      else
        Permissions := [LOCATION_PERMISSION];

     

    regards,

    mm


  5. B3B4BFBF67D02522F059BB610D9FA6A21D3042F2B45640C3E6A79AF2567B1327

     

    with 

     

    function ByteArrayToHexString(BA: TArray<Byte>; Sep: string = ''): string;
    var
      i, k: integer;
    begin
      result:='';

      if Sep='' then begin
         for i:=low(BA) to high(BA) do
           result := result + IntToHex(BA, 2);
      end else begin
         k:=high(BA);
         for i:=low(BA) to k do begin
            result:= result + IntToHex(BA, 2);
            if k<>i then result := result + Sep;
         end;
      end;
    end;

     

     

     


  6. 36 minutes ago, mausmb said:

    if FormatSettings.DecimalSeparator = ',' then
        LText := StringReplace(LText, '.', FormatSettings.DecimalSeparator, [rfReplaceAll])
      else
        LText := StringReplace(LText, ',', FormatSettings.DecimalSeparator, [rfReplaceAll]);

    This solves all scenarios and local settings :classic_ohmy:


  7. Hi,

     

    Use System.SysUtils.FormatSettings.DecimalSeparator 

     

    one example

     

      if FormatSettings.DecimalSeparator = ',' then
        LText := StringReplace(LText, '.', FormatSettings.DecimalSeparator, [rfReplaceAll])
      else
        LText := StringReplace(LText, ',', FormatSettings.DecimalSeparator, [rfReplaceAll]);

     

    br,

    m


  8. Hi,

     

    1. You shouldn't put "targetSdkVersion" version in AndroidManifest file

    2. You should upgrade to 10.4.2 (Automatic target version is 29)

    3. My apps working with Android 11 (Pixel3, Pixel4,...) 

     

    " android:requestLegacyExternalStorage="true" " it's only for specific purpose as @Rollo62 pointed out. (Migration storage files)

     

     AndroidManifest.template

     

    <?xml version="1.0" encoding="utf-8"?>
    <!-- BEGIN_INCLUDE(manifest) -->
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
            package="%package%"
            android:versionCode="%versionCode%"
            android:versionName="%versionName%"
            android:installLocation="%installLocation%">

        <!-- This is the platform API where NativeActivity was introduced. -->
        <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
    <%uses-permission%>
        <uses-feature android:glEsVersion="0x00020000" android:required="True"/>
        <application android:persistent="%persistent%" 
            android:restoreAnyVersion="%restoreAnyVersion%" 
            android:label="%label%" 
            android:debuggable="%debuggable%" 
            android:largeHeap="%largeHeap%"
            android:requestLegacyExternalStorage="true"            
            android:icon="%icon%"
            android:theme="%theme%"
            android:hardwareAccelerated="%hardwareAccelerated%">

    <%application-meta-data%>
            <%services%>
            <!-- Our activity is a subclass of the built-in NativeActivity framework class.
                 This will take care of integrating with our NDK code. -->
            <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
                    android:label="%activityLabel%"
                    android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
                    android:launchMode="singleTask">
                <!-- Tell NativeActivity the name of our .so -->
                <meta-data android:name="android.app.lib_name"
                    android:value="%libNameValue%" />
                <intent-filter>  
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter> 
            </activity>
            <%activity%>
            <%receivers%>
        </application>
    </manifest>
    <!-- END_INCLUDE(manifest) -->
     

     

    AndroidManifest.xml generated from AndroidManifest.template

     

    <?xml version="1.0" encoding="utf-8"?>
    <!-- BEGIN_INCLUDE(manifest) -->
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
            package="si.ros.RosNZ"
            android:versionCode="28"
            android:versionName="1.1.0"
            android:installLocation="auto">

        <!-- This is the platform API where NativeActivity was introduced. -->
        <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
        <uses-permission android:name="android.permission.BLUETOOTH" />
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.NFC" />
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.READ_PHONE_STATE" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

        <uses-feature android:glEsVersion="0x00020000" android:required="True"/>
        <application android:persistent="False" 
            android:restoreAnyVersion="False" 
            android:label="RosNZ" 
            android:debuggable="False" 
            android:largeHeap="False"
            android:requestLegacyExternalStorage="true"            
            android:icon="@drawable/ic_launcher"
            android:theme="@style/AppTheme"
            android:hardwareAccelerated="true">


            
            <!-- Our activity is a subclass of the built-in NativeActivity framework class.
                 This will take care of integrating with our NDK code. -->
            <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
                    android:label="RosNZ"
                    android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
                    android:launchMode="singleTask">
                <!-- Tell NativeActivity the name of our .so -->
                <meta-data android:name="android.app.lib_name"
                    android:value="TESTXXAPP" />
                <intent-filter>  
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter> 
            </activity>
            
            <receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />

        </application>
    </manifest>
    <!-- END_INCLUDE(manifest) -->
     

     

     

     

     

    Regards,

    Marjan 

     

    • Thanks 1

  9. 3 hours ago, erva said:

    Trying to format date to show dd.mm.yyyy but don't get how it's complished. Have tried it with columns "customFormat" property but with no success.

    Hi,

     

      TFormatSettings.Create;
      FormatSettings.ShortDateFormat := 'dd.MM.yyyy'; //
      FormatSettings.LongDateFormat := 'dd.MM.yyyy'; //
      FormatSettings.DateSeparator := '.';
      FormatSettings.ShortTimeFormat := 'hh:mm:ss'; //
      FormatSettings.LongTimeFormat := 'hh:mm:ss'; //

     

    regards,

    M


  10. Something in this direction ?

     

    procedure ColorLabel(const pColor : TAlphaColor; const pString:String; mylabel:Tlabel);
    var
      prect:Trectangle;
      ptext:TText;
      
    begin  
    1. creation

       if mylabel.ChildrenCount=1 then begin // creating trrectangle on fly
         prect:=Trectangle.Create(mylabel);
         prect.Parent:=mylabel;
         prect.Align:=TAlignLayout.Client;
         prect.HitTest:=False;
         prect.Margins.Left:=-1;
         prect.Margins.Right:=-1;
         prect.Margins.Top:=-1;
         prect.Margins.Bottom:=-1;
         prect.Sides:=[]; // no borders
         prect.Fill.Color:=pColor;

         ptext:=TText.Create(mylabel);
         ptext.Parent:=prect;
         ptext.Align:=TAlignLayout.Client;
         ptext.Text:=pString;
         ptext.TextSettings:= mylabel.TextSettings;
         ptext.HitTest:=False;
         mylabel.Text:='';
       end

         
    2. changing color
         
         if mylabel.Children[1].ClassName=Trectangle.ClassName then Begin // change color
            (mylabel.Children[1] as Trectangle).Fill.Color:=pColor; // pCOlor is parameter for custom color
            if (mylabel.Children[1] as Trectangle).Children[0].classname=TText.classname then Begin // chanhe text
               ((mylabel.Children[1] as Trectangle).Children[0] as TTExt).Text:=pString; // pString is parameter for TEXT 
               ((mylabel.Children[1] as Trectangle).Children[0] as TTExt).TextSettings.Fontcolor:=mylabel.TextSettings.Fontcolor;
            End;
         End;

    end;

     

    br,

    m


  11. Hi,

     

    This code "qQuery.Open( 'SELECT * FROM tTableName WHERE Status  IN ( :pS, :pR  ) ORDER BY EventDate', [ 'S', 'R' ] );" can't work for a single or more than 2 parameters (just in case)

     

    Param1:='( 'S','R' )'

    Param2:='['S','R']'

     

    qQuery.Open( 'SELECT * FROM tTableName WHERE Status  IN :Param1 ORDER BY EventDate, :Param2 );

     

    I'm using that approach without Param2 (that part you should test it)

     

    regards,

    M

×