saeed10051 Active Member Licensed User Longtime User Apr 30, 2020 #1 I have used Network library to send data from my B4A app on my mobile to my desktop running a B4J app. A custom data type can be send this way using wifi connection. I need to know which library / method i can use to communicate between my B4A app and B4J app over the internet. I am considering that my B4J app is online all the time and i am outside some where with my mobile having an internet connection.
I have used Network library to send data from my B4A app on my mobile to my desktop running a B4J app. A custom data type can be send this way using wifi connection. I need to know which library / method i can use to communicate between my B4A app and B4J app over the internet. I am considering that my B4J app is online all the time and i am outside some where with my mobile having an internet connection.
MicroDrie Well-Known Member Licensed User Longtime User Apr 30, 2020 #2 Perhaps this is a starting point: Custom WebSocket Based Push Framework Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Apr 30, 2020 #3 You are confusing different things. The exact same code will work over the internet if the routers are configured to support it. This is unlikely to be the case and for that reason it is easier to have an accessible server and let the clients access this server. Upvote 0
You are confusing different things. The exact same code will work over the internet if the routers are configured to support it. This is unlikely to be the case and for that reason it is easier to have an accessible server and let the clients access this server.
saeed10051 Active Member Licensed User Longtime User Apr 30, 2020 #4 Hi Erel, I have tried using web socket for this communication. It is working fine when my laptop and my mobile are connected to same wifi. But when i use my data package on my mobile and laptop is on wifi, the mobile app tries to connect but connection doesnt work. Upvote 0
Hi Erel, I have tried using web socket for this communication. It is working fine when my laptop and my mobile are connected to same wifi. But when i use my data package on my mobile and laptop is on wifi, the mobile app tries to connect but connection doesnt work.
Erel B4X founder Staff member Licensed User Longtime User Apr 30, 2020 #5 [Server] Upload files from your B4A app to your B4J server over the internet Upvote 0
saeed10051 Active Member Licensed User Longtime User Apr 30, 2020 #6 Hi Erel, i am getting following error on B4A side while running above mentioned apps java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpPost; while on B4J side i am getting followIng warning, however in the last line it says that Update duckdns: OK WARNING: Invalid cookie header: "Set-Cookie: AWSALBCORS=NW3AZyuLsxzg2ww3aLr6eWFGdHx8UKPK/bAtmb0pqTG/loSYUYz8soURIGeNA1RGW98Gvv2aIuL0CUnNdG3iRO/xy33w7bwcpZlLC2lNrsq8zBC5fTcMWCNtI9Ci; Expires=Thu, 07 May 2020 13:42:32 GMT; Path=/; SameSite=None". Unable to parse expires attribute: Thu, 07 May 2020 13:42:32 GMT Upvote 0
Hi Erel, i am getting following error on B4A side while running above mentioned apps java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpPost; while on B4J side i am getting followIng warning, however in the last line it says that Update duckdns: OK WARNING: Invalid cookie header: "Set-Cookie: AWSALBCORS=NW3AZyuLsxzg2ww3aLr6eWFGdHx8UKPK/bAtmb0pqTG/loSYUYz8soURIGeNA1RGW98Gvv2aIuL0CUnNdG3iRO/xy33w7bwcpZlLC2lNrsq8zBC5fTcMWCNtI9Ci; Expires=Thu, 07 May 2020 13:42:32 GMT; Path=/; SameSite=None". Unable to parse expires attribute: Thu, 07 May 2020 13:42:32 GMT
Erel B4X founder Staff member Licensed User Longtime User Apr 30, 2020 #7 The actual code doesn't matter. It explains the steps that you need to do in order to make a direct connection over the internet. Upvote 0
The actual code doesn't matter. It explains the steps that you need to do in order to make a direct connection over the internet.
saeed10051 Active Member Licensed User Longtime User May 1, 2020 #8 Erel said: The actual code doesn't matter. It explains the steps that you need to do in order to make a direct connection over the internet. Click to expand... Hi Erel, when i run the B4J side of the code, i get following in my log Update DuckDNS: OK as per the code if j.success = true then i will be getting this message in the log. This shows that the server side is working when i write 127.0.0.1:54021/test in the browser i get Your ip address: 127.0.0.1 however when i run yourdomain.duckdns.org:54021/test with my domain name that i have set on duckdns, it gives me error, this site cant be reached i have configured my router as per attached file for port forwarding, here i have given same port name i.e. 54021 dont know where i am going wrong. Also i beleive i need to make change in the B4A code on following line, i have updated it like this Private link As String = "http://saeedhassan.duckdns.org:54021/upload" Click to expand... also when i see my ip address in duckdns it is different than the one i get when i run ipconfig on my system. I have updated the ip on duckdns also but doesnt work. i am not sure if i need to make any changes to the following code, here it is a key value pair and in the ip key the value is empty. do i need to give my ip address here B4X: Copy Sub UpdateIp_Tick Dim j As HttpJob j.Initialize("j", Me) j.Download2("http://www.duckdns.org/update", Array As String("domains", domain, "token", token, _ "ip", "")) End Sub Attachments orbi.jpg 133 KB · Views: 613 Upvote 0
Erel said: The actual code doesn't matter. It explains the steps that you need to do in order to make a direct connection over the internet. Click to expand... Hi Erel, when i run the B4J side of the code, i get following in my log Update DuckDNS: OK as per the code if j.success = true then i will be getting this message in the log. This shows that the server side is working when i write 127.0.0.1:54021/test in the browser i get Your ip address: 127.0.0.1 however when i run yourdomain.duckdns.org:54021/test with my domain name that i have set on duckdns, it gives me error, this site cant be reached i have configured my router as per attached file for port forwarding, here i have given same port name i.e. 54021 dont know where i am going wrong. Also i beleive i need to make change in the B4A code on following line, i have updated it like this Private link As String = "http://saeedhassan.duckdns.org:54021/upload" Click to expand... also when i see my ip address in duckdns it is different than the one i get when i run ipconfig on my system. I have updated the ip on duckdns also but doesnt work. i am not sure if i need to make any changes to the following code, here it is a key value pair and in the ip key the value is empty. do i need to give my ip address here B4X: Copy Sub UpdateIp_Tick Dim j As HttpJob j.Initialize("j", Me) j.Download2("http://www.duckdns.org/update", Array As String("domains", domain, "token", token, _ "ip", "")) End Sub