This is more about an explanation then it is about asking a question. What I am wondering is if its possible to write an Android application that can communicate with another Android phone, given the phone number of the phone I want to communicate with. By communicate, I mean I want to be able to send data to the phone and have my application on the other phone be able to recive it.
If its not possible to do this, then I guess my alternative is to have my application "sign" the phone into a server. Then I'm assuming the server can act a proxy to communicate with both phones.
Any clarification would be helpful!
Check out the BUMP api. It allows you to establish a connection between two (I think more are also possible) devices, and it gives you a channel over which to communicate. The devices need to be "bumped" first, but then it's all fair game.
Any reason why it has to be by phone number? That and i'm pretty sure you can only send data over WAN or local bluetooth/wifi.
Perhaps try something along the lines of a server that has phones sign into it and keeps track of the phones IP addresses allowing them to communicate almost directly to another (kind of like a dynamic DNS hah!).
Look into SMS. I haven't coded for mobile phones in years but I seem to recall that most phone operating systems let an app intercept SMS messages, react to their contents, and prevent the user from seeing them.
As long as you're not sending lots of data, SMS might do the trick.
Related
I want to have one stationary device like an android phone that can use a standard local SIM card and forward all calls to a second device over some kind of VoIP protocol. When someone calls the phone number of the stationary device, I want my second device to ring and handle the call through something like linphone, element, or whatever. Ideally, it should be possible from the second device to initiate a call from the stationary device's phone number as well. Bridging SMS too would be nice, but I already have a solution for this on android.
There are many use cases like
when traveling abroad, being able to bring the latter device and receive/make calls via the stationary device at home
forwarding multiple phone numbers to a single device and e.g. switching off the work number when away from work
having privacy when the location of SIM cards is logged, by making calls over wifi from somewhere else than the stationary device
when traveling somewhere with bad mobile coverage but available wifi, without having to think about how the second device handles it
Are there any existing projects for doing this?
If not, then what would be necessary to make something myself? Is the best solution something like connected an android device by bluetooth to something running asterisk like was discussed here? Or has something changed in the past 11 years, maybe the existence of some working linux phones makes this possible on a dedicated purism or pinephone device?
I think you can achieve this with Brekeke SIP Server. I am using their solution to achieve something similar to what you want to do.
there are multiple ways to achieve it technically, but the most practical solution to your use case will be to use a VOIP Gateway device.
Actually we can not use a mobile phone as gateway between SIM and VOIP calls.
so you can buy a voip gateway example GOIP (single SIM) and put your sim, connect to your home internet and configure. your phones softphone (eg linphone) will be able to directly register on it and you will be able to make/receive calls and sms.
there will be a new problem as mobile OS platforms are more and more restrictive about power, your sip client will not be able to receive calls while in background for that you will need push, so you can use twillio's mobile sdk to make a client that works fine then forward your calls to twillio from gateway. since there is no number or telecom services involved, cost on twillio should be minimal.
A more common way to do this is with an operator service, rather than implementing it yourself.
The operator is able to see the routing to your number and simultaneously call multiple numbers you have set up. Different operators will have different names and details so you would need to speak to your local operator.
For example BT in the UK (who I have no affiliation to - just an example) provide a service called 'Follow ME': https://support.ringcentral.co.uk/s/article/9010?language=en_GB
If you do want to do it yourself than an open source PBC like Asterisk is indeed a good starting point.
Basically - the task:
On device one, text is copied to clipboard.
Device two must perform some actions with the text just copied on device one, for example invoke a browser with search engine page and query ?q=text-from-clipboard-just-copied-on-device-A.
First question: is it possible to do with out-of-the box applications?
Second question: if not, what are different approaches to do that?
Both devices are on the same local wi-fi network (connected via router). Connection via external ip server is not what I want, I would prefer a server running on device A or device B (android) if there's any, so there would be not need in working internet connection.
I see there's an option of Wi-fi direct (my devices are 4.0 and 4.2 Android versions, so it's possible). Is there a source code how to send a message with wifi direct and receive it on the other side?
First question: is it possible to do with out-of-the box applications?
No it is not possible with out of box applications. I would be surprised if there would be one!
Second question: if not, what are different approaches to do that?
One approach will be to implement Bluetooth Server and Client applications that can communicate between them and excange data. Ofcourse you will be able to implement different functionalities for example opening a webpage with the text as you mentioned in your question.
Or you can also have a look at NFC Communication explained here: (Remember the devices will have to be at very short distances to achieve such communication) http://developer.android.com/guide/topics/connectivity/nfc/index.html
I guess question 1 is not possible. I can't imagine that an out of the box app knows what action you want to perform with the received data.
Solution for question two could be working with tcp sockets. One device as server one as client, so that you can send your sting, link or whatever to the other device, which receives this and performs some action.
edit: Sorry, just read that you don't want to do it with internet permission, so data exchange via bluetooth, sms... could be possible
Im a little new to the android development, I believe I have the basics down but I am wondering the best way to communicate between two phones running the same app. I am looking for something that would be close to instant. For an example, if you sent a message or somekind of variable or string it would appear on the other phones app providing the app was open on both phones. Would be great if I could be pointed in the correct direction here, Thank you!
Assuming you have access to a server that both devices can connect to, the best way to handle this is to set up a socket and have both devices connect to it. That way the messages can be send back and forth and be pushed through immediately (rather than the devices polling for any new thing to do intermittently).
You can learn more about using sockets on android here: http://developer.android.com/reference/java/net/Socket.html
If you're unfamiliar with how to write a server socket, you can write something that works somewhat similarly with a system that just has each device leave a message and have the other device come looking for it, but as I said, that is much less "real time" since then you have to have the devices constantly pestering the server to see if there's anything new to do.
There are also kludgy ways to create a fake socket behavior whereby the http connection never closes and you just keep sending data down the pipe, but if you can avoid it and just use a socket, you should.
what is the best framework that I should use to make a remote control app for Android. What I want to do is something like Tony Fadel's app for Android and Iphone where you control your house thermostat temperature remotely with a smartphone app.
I was going to use sockets programming, but not sure if that is the best way. If it is then i will use it, but wanted some feedback before i get started.
If I make one android device the server and the other device the client I will still have to manually set the IP address every time I want to connect the client to the server.
I am trying to avoid having to make a web-app and having to make a php website to act as a server for this. Having to keep a server running is too much overhead. would rather make something like two android phones or tablets that can send message to each other over the internet or wifi router without too much setup and effort.
Would appreciate any ideas on this. I can't figure out how the nest thermostat works (http://www.nest.com/) but that is kind of the functionality that I am looking to copy. I wonder if they have to use a centralized server for all of the remote controls. If there is a way to do this peer to peer that would be great. that way all i would need is two Android tablets.
The other examples I can think of is VOIP like skype and google talk. I am sure these don't use a centralized server for voice calls. My needs are much more simple. no voice or video, only sending text messages from one android device to another over the internet. Each android device will probably be using wifi exclusively.
Does anyone know how to implement communication between 2 android devices over the internet without using App Engine? For example, I have 2 Android devices, and I want to send a stream of data from one to the second one over the internet. I would like to know, if someone could give me an idea, how could I identify the second device (or how to create a communication channel between two devices ), so I could initiate the transfer (this is not possible using IP addresses ?).If i were to have my own server, which is the best way to go to accomplish this? If someone could point me to some useful resources I would be grateful.I have some background on android programming.
One way I was thinking to accomplish this was to write an android application, and when the user enters it, it will start a service. This service will then listen for network events and registers on my own server with the username and the IP address of the device as available.When another device wants to send data, it will connect to the server, search for the target device (by username key), gets the IP address and sends the data. Could this work, or does anybody have other suggestions?
One way I thought about doing this is making
(excuse the spelling mistakes if any)
It would help if we knew what kind of data you were trying to transfer.
For small bits of information, like notifications, events, and the like, I would suggest doing an HTTP POST to a server that has C2DM capabilities, and using the server as an intermediary.
For larger data, the only way I can think of to do it is to set up a SyncAdapter, then upload the information to the server. The delay will be a bit longer, but you'll reliably get the information downloaded from the server to the phone. So less of a communication API and more of a dropbox for phones.
I haven't done much with NFC, but that may be something you want to look into.