I am working on a BlackBerry app. This app has already been developed in Android in "Basic4Android" program. The code for the android app is written in vb.net. I need to write the exact same code for BlackBerry. I am trying to understand this method but I am unable to since I am not an expert with vb.net. I will not paste the entire method but only parts which I need to clarify:
Sub HEX_T24_SHORT_GPS(latitude_decimal_degrees As Double, longitude_decimal_degrees As Double, speed_knots As Int, heading_degrees As Int, time_seconds_since_midnight_gmt As Int, alert_on As Boolean, alert_ack As Boolean, external_interface_control As Boolean, send_extended As Boolean) As String
Dim pBuffer(11) As Int
pBuffer(0)=0 ' T24 MSGID 0
Log("pBuffer(2)" & pBuffer(2))
Dim t1 As Double
'Get latitude sign
Dim lat_south As Boolean
lat_south=True
If latitude_decimal_degrees<0 Then lat_south=False
'Get Longitude sign
Dim lon_west As Boolean
lon_west=True
If longitude_decimal_degrees<0 Then lon_west=False
'Get number of second since midnigh extra bit
Dim num_of_second_extra_bit As Boolean
num_of_second_extra_bit=False
If time_seconds_since_midnight_gmt > 0xFFFF Then num_of_second_extra_bit=True
'Convert latitude in bytes 1 to 3
latitude_decimal_degrees = Abs(latitude_decimal_degrees*60000)
What does "If time_seconds_since_midnight_gmt > 0xFFFF" mean? What is happening here "latitude_decimal_degrees = Abs(latitude_decimal_degrees*60000)". I checked the "Basic4Android" documentation but could not find the Abs API.
If num_of_second_extra_bit=True Then latitude_decimal_degrees=latitude_decimal_degrees + 0x800000
pBuffer(1)=Bit.ShiftRight(Bit.And(latitude_decimal_degrees, 0xFF0000),16)
pBuffer(2)=Bit.ShiftRight(Bit.And(latitude_decimal_degrees, 0x00FF00),8)
pBuffer(3)=Bit.And(latitude_decimal_degrees, 0xFF)
How is the bit shift applied? Is the "AND" operation used between an int and hex value? What is the final value in pBuffer(1)? What is the purpose of steps pBuffer(1) to pBuffer(3). What is it doing and what is the final value of latitude_decimal_degrees?Is the final value in bytes, byte array or hex?Please explain.