S Squiffy Active Member Licensed User Longtime User Aug 9, 2015 #1 Hi - I'm trying to do this (following another thread to create UUIDs) : Dim no As NativeObject Return no.Initialize("NSUUID").RunMethod("UUID", Null).RunMethod("UUIDString", Null).AsString but it complains that there is no NativeObject type. Should there be in B4j? I've tried adding all of the libraries in the manager but it doesn't seem to exist.
Hi - I'm trying to do this (following another thread to create UUIDs) : Dim no As NativeObject Return no.Initialize("NSUUID").RunMethod("UUID", Null).RunMethod("UUIDString", Null).AsString but it complains that there is no NativeObject type. Should there be in B4j? I've tried adding all of the libraries in the manager but it doesn't seem to exist.
rwblinn Well-Known Member Licensed User Longtime User Aug 10, 2015 #2 Try using a JavaObject (LIbrary JavaObject) #Example Sub to retrieve a type 4 (pseudo randomly generated) UUID. Code: Copy Sub UUID As String Dim joUUID As JavaObject Return joUUID.InitializeStatic("java.util.UUID").RunMethod("randomUUID", Null) End Sub Output: Log("UUID: " & UUID) UUID: 59ec389c-6ba2-46fb-bd6b-e33b5a24ce74 Upvote 0
Try using a JavaObject (LIbrary JavaObject) #Example Sub to retrieve a type 4 (pseudo randomly generated) UUID. Code: Copy Sub UUID As String Dim joUUID As JavaObject Return joUUID.InitializeStatic("java.util.UUID").RunMethod("randomUUID", Null) End Sub Output: Log("UUID: " & UUID) UUID: 59ec389c-6ba2-46fb-bd6b-e33b5a24ce74
S Squiffy Active Member Licensed User Longtime User Aug 10, 2015 #3 Ah, that's the johnny! Works perfectly, thanks. Upvote 0