Hello all,
Been beating my head against a wall trying to achieve the following:
I'm using the example:
https://www.b4x.com/android/forum/threads/android-device-unique-id-alternative-to-phoneid.14759/
From the device id, I'm grabbing the last 8 hex digits in order to create a unique "user".
The reason I'm only grabbing the last 8 is, I am then trying to generate a 32 bit number from them.
For example:
I am needing this 10 digit decimal due to my microcontroller waiting to receive (2) 5 digit numbers for "word" sized variables.
I am currently using:
to send the payload but this is where I get tripped up.
I sure hope the above makes sense and if it does, hopefully one of you fine folks can assist this dummy .
Thanks to all,
C
Been beating my head against a wall trying to achieve the following:
I'm using the example:
https://www.b4x.com/android/forum/threads/android-device-unique-id-alternative-to-phoneid.14759/
From the device id, I'm grabbing the last 8 hex digits in order to create a unique "user".
The reason I'm only grabbing the last 8 is, I am then trying to generate a 32 bit number from them.
For example:
Device ID: 1a2b3c4d5e6f7a10
32 bits: 5e6f7a10
What I am desperately seeking to do is convert the 32 bits (5e6f7a10) to a zero-padded (If needed) 10 digit decimal number: 1584364048 (zero padding not needed in this example)32 bits: 5e6f7a10
I am needing this 10 digit decimal due to my microcontroller waiting to receive (2) 5 digit numbers for "word" sized variables.
I am currently using:
B4X:
Sub SendSerial(message As String)
If AsyncStreams.IsInitialized = False Then Return
Dim buffer() As Byte
buffer = message.GetBytes("UTF8")
AsyncStreams.Write(buffer)
End Sub
I sure hope the above makes sense and if it does, hopefully one of you fine folks can assist this dummy .
Thanks to all,
C