Jump to content

Yaron

Members
  • Content Count

    275
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Yaron


  1. For me one of the biggest problems in the new UI/UX issue with the tabs being wider (leaving less room for tabs) AND the "X" to close a tab is only visible on the active tab, so I'm occasionally closing tabs when trying to switch to them.

     

    Sure, I can get used to it, but this is an esthetic choice over a utilitarian chose when working in an environment to develops utilities... does that feel right to you?


  2. I'm have two issues with v10.3 and TEdit.ControlType set to TControlType.Platform:
     

    1. Under windows (android is fine) using FMX, changing the Height property results in a corrupted dialog (the background isn't filled, showing a 'window' to the form and underlying visual components), here's the code I use to create the TEdit:

    
      textInputEdit                                    := TEdit.Create(MainForm);
      textInputEdit.Parent                             := MainForm;
      textInputEdit.Width                              := Trunc(clientWidth*idMaxWidth);
      textInputEdit.Height                             := Trunc(textInputLabelOK.Font.Size*2);
      textInputEdit.StyledSettings                     := [TStyledSetting.Family];
      textInputEdit.Font.Size                          := textInputLabelOK.Font.Size;
      textInputEdit.ControlType                        := TControlType.Platform;
      {$IFDEF MSWINDOWS}
      textInputEdit.TextSettings.FontColor             := TAlphaColorRec.Black;
      {$ELSE}
      textInputEdit.TextSettings.FontColor             := TAlphaColorRec.White;
      {$ENDIF}
      textInputEdit.KillFocusByReturn                  := True;
      textInputEdit.KeyboardType                       := TVirtualKeyboardType.Alphabet; // is this good?
      textInputEdit.TextPrompt                         := strEnterYourName;
      textInputEdit.SetBounds(Trunc((clientWidth-textInputEdit.Width)/2),Trunc(clientHeight*textInputEditMargin),textInputEdit.Width,textInputEdit.Height);
    
    

     

    2. When I enter RTL text into the dialog, the resulting text STILL appears in reverse order when assigned to a TLabel for display.

     


  3. 1. I was testing against Android 6.0.1 so I don't think that's an issue.

    2. For me restarting delphi and reconnecting the device doesn't help, restarting the device worked once, but even that's not reliable (or timely) and I tried using multiple devices and they all had this issue (they were Android 4 and Android 5).

     

    I ordered a cheap Android 8.1 tablet, so we'll see how newer versions of Android work.


  4. Debugging worked fine for me in v10.2.2 and stopped working in v10.2.3.

    I'm sad to report that even after doing a fresh install of the recently released Delphi v10.3, I am still getting the 'port in use' error when trying to debug.

     

    Perhaps this may be related to the Android libraries updates introduced in v10.2.3?

    And yes, I'm testing devices running Android v4-v6, which may also be related.


  5. @Markus Kinzler The project your linked to is my first try at writing a REST server, since the data-set it uses is so small, for simplicity I just used a flat DB file.

     

    My upcoming project is more of a small scale social network, so there will be:

    1. Accounts

    2. Content upload (text/images) linked to the accounts.

    3. Content interaction (likes, shares) linked to content, etc.

     

    For this purpose I want a more solid and reliable DB back-end.

    Like suggested earlier in the thread, the client isn't connecting directly to the DB, it's connecting through a REST server, so the only DB user is the REST server.

     

    I don't think SQL syntax is that hard to learn and I have friends to consult with.

    Based on this should I go the firebird route or mORMot+SQLite3 ?

     

     


  6. To begin with, which database software should I install that would be the easiest (to install on windows) and connect to with Delphi.

     

    I previously installed MySQL for an unrelated project and didn't write any code for it, but I'm not sure if MySQL is overkill for my needs.


  7. I am a total novice to databases, I would appreciate any pointers you could give.

     

    I am developing a back-end server for an app/game that requires storing user accounts with a few details about each user:

    1. Name

    2. Reputation

    3. Score

    4. Connection to a list of content (images+metadata) submitted by the user

     

    And since the users are submitting content (images), I need to store this content (or path to the content) with some metadata:
    1. Likes

    2. Effect flags

     

    The database will be hosted on a windows server 2008 machine I'm administrating using remote desktop.

    It will run on the same hardware as the REST server I'm currently writing.

     

    What is the quickest/cheapest route to learn how bring up a database so I can quickly and reliably store and manipulate the data from within Delphi (v10.2 Tokyo)?

     

    • Like 1

  8. I was able to debug Android application in v10.2.2, but then after installing v10.2.3 it stopped working, either the debug doesn't hook correctly (it never debugs) or it stalls on 'launching' and never continues.  Pressing "cancel" at this point returns an error that the port is in use (I even read about how to change the port, but the error remained just showing a different port number).

     

    I suspect this may be related to the fact that I installed v10.2.3 ontop of v10.2.2 without doing a clean install (this resulted in a few other glitches as well).


  9. I use this code for the paths, it works for both Windows and Android

      UserDataPath          := System.IOUtils.TPath.GetHomePath+System.IOUtils.TPath.DirectorySeparatorChar+clientName+System.IOUtils.TPath.DirectorySeparatorChar;
      cacheFolder           := 'cache'+System.IOUtils.TPath.DirectorySeparatorChar;

     

    With regards to the UI, yes, I use high resolution source images so the same app will work on any resolution display and maintain a sharp & crisp image.

     

    Delphi does a real bad job at high quality image downscaling, but after a year of banging my head against the wall with multiple down-votes and even after offering a bounty on stackoverflow, I finally found a method that will scale the image in high quality using hardware on Android which I posted here:

    https://stackoverflow.com/questions/52989024/low-quality-delphi-user-interface-design-under-android-when-using-timage

     

    If you want to see how bad Delphi's GPU canvas is by default, look at this post:
    https://stackoverflow.com/questions/51157715/low-quality-downscale-interpolation-when-using-a-gpu-canvas-and-tcanvas-drawbitm

     


  10. @John Kouraklis I guess it really depends on how the images are used.   I use the resource approach where the images are elements in my UI (buttons, sprites, etc).

    Unlike windows which places all the resources in the executable, if you look into the installation folder on Android, you'll see that all the resource files are in their own folder as actual files, so the resource function is just re-routing to these files.

     

    I also use a caching mechanism in my apps where the images are scaled in high quality to the UI resolution and then saved uncompressed to speed up future loads.

    • Like 1

  11. I wrote a simple & elegant calculator for Android using Delphi Tokyo 10.2.3 and released the source code on GitHub:
    https://github.com/bLightZP/ElegantCalculator

     

    This sample demonstrates basic scalable Android UI, taking screen scale into account.

    I wrote a basic string math formula parser since I couldn't find anything free that would compile for Android.

     

    You can check out the compiled Elegant Calculator on the google play store:
    https://play.google.com/store/apps/details?id=com.inmatrix.ElegantCalculator

     

    • Like 1
    • Thanks 1

  12. I am trying to upload JSON data and an image as a MultipartFormData and return a JSON string from mars using the following code:
     

    var

      shareData  : TMultipartFormData;

      jsonStr : String;

    begin

      shareData := TMultipartFormData.Create;
      shareData.AddField('json','{"empty":"empty"}');
      shareData.AddFile('image',FileName);

      jsonStr  := NetHTTPRequest.Post(urlAPIBase+urlAPIShareImage,shareData).ContentAsString(TEncoding.UTF8);

    end;

     

    How do I setup mars to give me access to the json field and image fields?

     

    I looked at the ContentTypes demo, but I wasn't sure if any of the examples actually covered MultipartFormData.


  13. Alternatively, you can store your images as resources (project / resources and images) and then use this function to load the images from the resource:
     

    procedure LoadImageFromResource(ResourceName : String; TargetBitmap : TBitmap);
    var
      rStream   : TResourceStream;
    begin
      If TargetBitmap <> nil then
      Begin
        Try
          rStream := TResourceStream.Create(hInstance,ResourceName,RT_RCDATA);
        Except
          rStream := nil
        End;
        if rStream <> nil then
        Begin
          Try
            TargetBitmap.LoadFromStream(rStream);
          Finally
            rStream.Free;
          End;
        End;
      End;
    end;
    

    That way you don't care about paths.

×