Android Question How to communicate between two or more devices?

androidsoftcoder

Member
Licensed User
Longtime User
I'm not sure what and how start to search - please give me some "entry points".
So, I want to create an application for sharing locations between two or more devices upon request. Something like this: Where are you? I'm here!
I'd like to make it fully transparent and even invisible - just to don't bother others with this asking.
As I assume, it must be 'client-server' (2-in-1) application. client part must send location requests. server one must listening incoming requests from other clients and answer to them.

Can anybody help me find answers for two questions:
1) How to establish and support connection in B4A between two or more devices? Via Internet, SMS, or other communication channel...
2) How to pass data (request and response) between such 'connected' devices?
 
Last edited:

androidsoftcoder

Member
Licensed User
Longtime User
Thanks a lot. It's a great answer to second Q.
And what about first one? I have two phones connected to Internet via GPRS or 3G. The only key I know about them are: phone numbers, accounts names, maybe - MAC addresses...
HTTP server must be run on some IP address, which may be changed accidentally. How I can support connections between them in such conditions? How I can find newly connected device which doesn't know yet who to be asked and for who must send responses?
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
In the same time, with most mobile providers, you wouldn't be able to P2P so you would need a server solution in between.
 
Upvote 0

androidsoftcoder

Member
Licensed User
Longtime User
Almost done. Via binary SMS.
The only last question: how to communicate between main application and its service.
From main app I send request SMS, it was received by service on other device and send me back its response.
Now service on my device get this response, but I must proceed it in main app. Let assume that response is a simple string.
How can I send from service to main app "signal" that response received and pass response data to main app?
 
Upvote 0

androidsoftcoder

Member
Licensed User
Longtime User
It is always better to start a new thread for a new question.
I thought to do so, but then decide to ask here, because it's a part of main question for this thread.
CallSubDelayed was the last mosaic item. Now whole chain is closed. All working perfectly. The only left to do - good design for app )
Thanks a lot for quick and really useful answers.
 
Upvote 0
Top