B4J Question How to add a hexadecimal value

adambotsfford

New Member
Hello,

I'm working on a raspberry pie project where I need to use socket.io along with that, i have to create hexadecimal to decimal converter to process the numbers. i have a basic knowledge about socket.io and i found a thread how to integrate it with the app but i have no idea about numbers programming and how i can create a hex converter code. if anyone has an experience in this numbers programming then please share. i will be really grateful.
 

rabbitBUSH

Well-Known Member
Licensed User
Upvote 0

adambotsfford

New Member
i'm a student and with a view to get a full time job, I'm planning everything different. I'm developing a project where I need to set up a local area network between two systems with LAN cable and to enhance security on my app, I'm developing the number converter
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
B4X:
Sub hexToDecimal(hex As String) As Long
    Dim jo As JavaObject
    Return jo.InitializeStatic("java.lang.Long").RunMethod("valueOf",Array(hex,16))
End Sub
 
Upvote 0

adambotsfford

New Member
basically, I'm developing an app with reference to a web application project. In my app, I'm going to connect multiple devices on the same local area network. FOr example, device1 will be having the local area network 192.168.10.1. The device2 will be having local area network address 192.168.10.2 and deviceX will have the network address 192.168.10.X.

On that web application, they used socket.io to send values in the real-time without reloading the page and once the server is ready with the answer, it sends back the value without reloading the page.

I'm developing a file sharing application, which saves all local area addresses to a specific string. For example, John's address is going to be stored with 192.168.10.1 and Jack's address is going to be stored with 192.168.10.2. Now, when someone selects John and selects a file, that file automatically gets forwarded to John's IP address. Now the problem is, this local area IP address is not constant. The IP wifi addresses may change frequently and my app may end up sending file to wrong user. The MAC address comes in the picture. MAC address is a unique identifier of a system, just like twitter usernames. So, I can use MAC address to to send files over local area network. The MAC address of a system is written in hexadecimal number. So, to deal with hexadecimal and convert it to the decimal or binary i need to create a converter which converts numbers to hex back and forth like .

I know this is a bit confusing and i have almost lost hope on this one!šŸ˜„šŸ¤“
 
Last edited by a moderator:
Upvote 0
Top