Jump to content

vfbb

Members
  • Content Count

    266
  • Joined

  • Last visited

  • Days Won

    30

Everything posted by vfbb

  1. vfbb

    Android FMX Game App not working reliably

    You may be manipulating images without checking the scale of the screen. Because in Windows the scale is usually 1 so there are no problems. Try on your windows to adjust the scale to 150% and test your program. I have a delphi crossplataform app that works perfectly on Windows, iOS and Android. It is not a game but have some cool animations that execute with 60fps without any choking and is more fast then the most of the apps that I have on my phone.
  2. This is a tutorial of how to add a new Universal Link to your Delphi Firemonkey iOS app, to open your app by a link, plus some tips. https://github.com/viniciusfbb/fmx_tutorials/blob/master/delphi_ios_universal_links/README.md
  3. vfbb

    iOS handle incoming url

    @Eric Bonilha I know you! You are Eric of Digifort. I am Vinícius, Paulo's brother. We started programming at the same time, about 15 years ago, at the time of intertruco, lncb, ydm. 😂😂😂. I send you my contact in private. Eric, this tutorial that I posted is just to detect which url opened your app, to parsing the URL. This is useful just when you have many Universal Links or wildcard in the Universal Link. I made today a tutorial explain how to configure the Universal Link, You can see here: https://github.com/viniciusfbb/fmx_tutorials/blob/master/delphi_ios_universal_links/README.md
  4. About Tasks there are infinite ways to do this, try to create a bitmap for each Task, you create from outside and destroy from outside the Task. You will cancel the current Task, and without WaitFor it, create a new one with a new bitmap, when closing the form or the application you check the TPair <TBitmap, TTask> list using Task.WaitFor and then Bitmap.Free. About the performance, I will disappoint you a little. The delphi TBitmap is meant to be used only on the main thread. Although it works in threads, it has a critical section that does not allow you to paint TBitmap and process Paint forms simultaneously. But, as I said, although it doesn't take full advantage of the computer's potential, the program will work, and it probably won't harm you.
  5. vfbb

    Difference between Pred and -1

    Pred and Succ best use is when used with enum. LBrushKind := Pred(LBrushKind); replace LBrushKind := TBrushKind(Ord(LBrushKind)-1);
  6. vfbb

    Delphi fmx comes standard in iOS font

    No, the problem is not with delphi, yo can see the full list of default font of the iOS https://developer.apple.com/fonts/system-fonts/ The current default font is Helvetica Neue. If you put a font family name that not exists, the iOS will load the Helvetica Neue font. To avoid install custom font, the best you can do is find a similar default font to use in the iOS
  7. vfbb

    IPV6 to number

    Because the used methods of the BigInteger changes a global variable. BigInteger.Hex; BigInteger.Decimal; But I was looking, it is possible to avoid these methods, so this new example will be safe: uses System.SysUtils, Velthuis.BigIntegers; function IPV6ToNumberDigits(const AIPV6: string): string; var LBigInteger: BigInteger; begin if not BigInteger.TryParse(AIPV6.Replace(':', '', [rfReplaceAll]), 16, LBigInteger) then Exit(''); Result := LBigInteger.ToString; end; function NumberDigitsToIPV6(const ANumberDigits: string): string; var I: Integer; begin if ANumberDigits.IsEmpty then Exit(''); Result := BigInteger(ANumberDigits).ToHexString.ToLower.PadLeft(32, '0'); for I := 0 to 6 do Result := Result.Insert((4 * (I+1)) + I, ':'); end;
  8. vfbb

    IPV6 to number

    uses System.SysUtils, VCL.Dialogs, Velthuis.BigIntegers; function IPV6ToNumberDigits(const AIPV6: string): string; var LBigInteger: BigInteger; begin BigInteger.Hex; LBigInteger := AIPV6.Replace(':', '', [rfReplaceAll]); BigInteger.Decimal; Result := string(LBigInteger); end; function NumberDigitsToIPV6(const ANumberDigits: string): string; var LBigInteger: BigInteger; I: Integer; begin LBigInteger := ANumberDigits; BigInteger.Hex; Result := string(LBigInteger).ToLower.PadLeft(32, '0'); BigInteger.Decimal; for I := 0 to 6 do Result := Result.Insert((4 * (I+1)) + I, ':'); end; procedure TForm1.FormCreate(Sender: TObject); const IPV6_EXAMPLE = '2001:0db8:85a3:08d3:1319:8a2e:0370:7344'; begin showmessage('Original: ' + IPV6_EXAMPLE + #13#10 + 'Number digits: ' + IPV6ToNumberDigits(IPV6_EXAMPLE) + #13#10 + 'IPV6 of the number digits: ' + NumberDigitsToIPV6(IPV6ToNumberDigits(IPV6_EXAMPLE))); end; Result: Original: 2001:0db8:85a3:08d3:1319:8a2e:0370:7344 Number digits: 42540766452641195744311209248773141316 IPV6 of the number digits: 2001:0db8:85a3:08d3:1319:8a2e:0370:7344 Remarks: This solution is not thread-safe.
  9. And to add all library paths, I created one tool that add all paths of all platforms in one click also. https://github.com/viniciusfbb/delphi-tools
  10. To build many packages in many platforms in one click, you can just create a project group, in the icon Show Build Groups create a new with each project option (Configuration and Platforms), then you can Build or Clean all projects in different configurations/platforms in one click...
  11. vfbb

    IPV6 to number

    You need to put as string to compile. var b:BigInteger; begin b:=‘47875086426098177934326549022813196294’;
  12. @Isaac Badru Your code is complete wrong!! Please, understand, my example of code works perfectly. You don’t need to change it.
  13. vfbb

    FMX- Cross platform embed resources

    It is that I say, you cannot change a signed Android, iOS or macOS app. To the store not. The binary have a checksum that is generated by a key that all apps have, because you don't have the sign key of that app, the changed apk will be invalid.
  14. vfbb

    Common code base for VCL and FMX control code

    I suggest you to create 2 different packages, with the same units, but need to have 2 different packages, one for FMX and one for VCL. After create packages, add in the project options of each package, in the "Conditional defines" something like USING_VCL for the vcl package and USING_FMX for the fmx package.In code of your .pas just use: {$IFDEF USING_VCL} ... {$ENDIF} or {$IFDEF USING_FMX} ... {$ENDIF}
  15. Depois que as suas tabelas estiverem exatamente da forma como te falei, você poderá usar o seguinte código: var LCountriesIds: TArray<Integer>; LCitiesIds: TArray<Integer>; // Load the cities after country combobox change procedure TForm1.ComboBox1Change(Sender: TObject); begin ComboBox2.Items.Clear; SetLength(LCitiesIds, 0); if ComboBox1.ItemIndex = -1 then Exit; FDQuery1.SQL.Text := 'SELECT city.city_id, city.city_name FROM city WHERE city.country_id=:country_id ORDER BY city.city_name ASC;'; FDQuery1.ParamByName('country_id').AsInteger := LCountriesIds[ComboBox1.ItemIndex]; FDQuery1.Open; try while not FDQuery1.Eof do begin LCitiesIds := LCitiesIds + [FDQuery1.FieldByName('city_id').AsInteger]; ComboBox2.Items.Add(FDQuery1.FieldByName('city_name').AsString); FDQuery1.Next; end; finally FDQuery1.Close; end; end; // Load all countries after form show procedure TForm1.FormShow(Sender: TObject); begin ComboBox1.Items.Clear; SetLength(LCountriesIds, 0); FDQuery1.SQL.Text := 'SELECT country.country_id, country.country_name FROM country ORDER BY country.country_name ASC;'; FDQuery1.Open; try while not FDQuery1.Eof do begin LCountriesIds := LCountriesIds + [FDQuery1.FieldByName('country_id').AsInteger]; ComboBox1.Items.Add(FDQuery1.FieldByName('country_name').AsString); FDQuery1.Next; end; finally FDQuery1.Close; end; ComboBox1Change(nil); end; Entender este simples código é primordial para fazer qualquer query.
  16. vfbb

    FMX- Cross platform embed resources

    You can not change an signed iOS, MacOS or Android app, if the app is not yours. But if you have the source, the app is your, you have many options to save the resources strings, you can save in particular files for it. When we are talking about resources strings for translation, this will allow the store to make smallest packages of your app, because it will not delivery the unnecessary data to the user. For example, a French language will not be included in a user that use English language ... However, this languages files isn’t usually big, and I personally prefer to make a cross platform solution, languages in the source code. Other solution is storing it in a SQLite.
  17. Suas tabelas estão erradas, veja novamente como teria que ser: É sempre melhor executar essas queries dentro do código, você terá mais opções fazendo isso.
  18. You need 2 tables with this fields city city_id country_id city_name country country_id country_name Get all countries SELECT * FROM country ORDER BY country.country_name ASC; Get all cities with their countries SELECT * FROM city LEFT JOIN country ON city.country_id=country.country_id ORDER BY city.city_name ASC; Get all cities of a specific country (change the XXX to the country number) SELECT * FROM city WHERE city.country_id=XXX ORDER BY city.city_name ASC;
  19. vfbb

    FMX- Cross platform embed resources

    What is the real purpose? Are the apps from third parties? Perhaps there is a much simpler solution than changing different platform binaries, explain it better.
  20. vfbb

    ANN HTML Library 4.1 released

    Just search in the web "remove unused css" you will find many tools. Recently, I used the Google Chrome without any extension, just open the DevTools > Sources > Coverage. You will see a report with all unused css codes and javascripts.
  21. vfbb

    Random Access Violation?

    For random AV, I would say you have a multithreaded application without correct synchronization.
  22. vfbb

    ANN HTML Library 4.1 released

    Do you really need it at run-time? If not, you will find many tools to do this in the web.
  23. vfbb

    Frequent compilation errors

    The same here. For it to occur less often, avoid use Build, just use Compile.
  24. Compile with Android 64 with AAB Bundles enabled and selected the Application Store configuration. But before it, check the Libraries (jar files) of the Android 64 bits, some jar file may be missing. Note: when you compile the AAB, to make the Android 32 and Android 64 packages, the delphi will only consider the jar files from Android64 libraries... I had the same problem, because my Android 32 had the google vision jars but after made the AAP Bundles, in the Android 32 bits the jar files weren’t there.
  25. It depends on the hash algorithm being used but in general it will not make a difference. For the dictionary implemented in delphi, the best capacity is always twice the number of items for known collections and 0 for unknown collections.
×