Dim bc As ByteConverter
bc.LittleEndian = True
Log(bc.HexFromBytes(bc.LongsToBytes(Array As Long(1287821))))
Output: 8DA6130000000000
If you want to remove the trailing zeroes:
B4X:
Dim s As String = bc.HexFromBytes(bc.LongsToBytes(Array As Long(1287821)))
Do While s.Length > 2 And s.SubString(s.Length - 2) = "00"
s = s.SubString2(0, s.Length - 2)
Loop
Log(s)