Android Question Peer to peer chat

Pjmoltij

New Member
Licensed User
Hi, first of all, sorry for my english. This is my question: its possible build an app in b4a, and through this app (installed in 2 devices) chat without any server?. In short, anything similar to winsock library in VB6.

And other question: Is there any library or function similar to "Datediff" in VB6?

Thanks.
 

JordiCP

Expert
Licensed User
Longtime User
It is possible through wifi if the devices have always the same IP assigned or with other tricks, but not with celullar connection

You can get something similar with (assuming you have your datetimes in string format)
B4X:
Dim ticksEllapsed as long = DateTime.DateTimeParse(DT1) - DateTime.DateTimeParse(DT0) 'if you have your dates in string format. Otherwise just substract the ticks
Dim edays as int = tickEllapsed / DateTime.TicksPerDay
Dim ehours as int = (ticksEllapsed mod DateTime.TicksPerDay)/ DateTime.TicksPerHour
Dim emins as int =(ticksEllapsed mod DateTime.TicksPerHour)/ DateTime.TicksPerMin
Log("Ellapsed time is "&edays&" days, "&ehours&" hours and "&emins&" minutes!")
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top