Thank for the replies and the welcoming. I had found both examples by searching before posting, and its not exactly what I need, I should have explained myself better, my mistake.
It has to be a type 1 UUID since they are based on a timestamp and the mac address of the machine that generated it . What I really need in this case is what some call a Type 6 UUID, but it is trivial to generate a type 6 from a type 1. These links will explain it better than I could:
Karthik Appigatla revisits a post Peter Zaitsev wrote on UUIDs (Universal Unique IDs), rearranging the timestamp and talks about storing UUID Values.
www.percona.com
UUID 'Version 6' is an alternate format which sorts correctly as raw bytes and is suitable for use as a primary key value in a database.
gh.peabody.io
TLDR: They are used as primary indexes in tables. That's how the existing MySQL database I have to work with is designed, and that is what I have to provide. It cannot be a random uuid for the reasons explained in the links above.
I did find java libraries that generate type 1 uuids, I also found that java.util.UUID does generate type 1 uuids, but you have to provide the timestamp, and if I knew how to generate the timestamp used I would then just implement the uuid generation myself.
One java library I did come across is this one:
https://github.com/f4b6a3/uuid-creator and it even generates type 6 uuids! Sadly I know java as much as I know B4A, so no chance of me creating a B4A library out of that for now.
This is the algorithm for a type 1 uuid if anyone is interested:
https://datatracker.ietf.org/doc/html/rfc4122#section-4.2.1