I am designing a simple Android application (might be ported to iOS in the future) where I want to have real-time communication between multiple devices. The procedure is that one device(creator) makes a "lobby" that have certain ID, using this ID other devices should be able to join this "lobby" and wait for messages from the creator. Then clients connected to the "lobby" should be able to respond to the messages from the creator. The connection should only be active for couple of minutes and no need to store the messages on the server side.
I am not sure what methods I should look into to archive this functionality. I have looked at comet, but I am not sure if that is the way to go for this project.
Have anyone solved similar problem? And if so how did you do it and what libraries/frameworks did you use?
Related
I'm planning to make a game like Trivia HQ and i know it isn't so simple. I wanted to know the possible solutions to build a scale-able server to handle around 5 to 10 million users on the same country. This is what i've planed but i'm not sure it will work or not.
1: App will be created in react-native (because i'm pretty familiar with this and it is a cross-platform).
2: Will create an admin panel to publish questions in the game.
3: Handle all the questions and answers using firebase realtime database and admin portal.
4: Record a video and send it to the server through RTMP encoder.
Questions:
I can broadcast these packets to the users but, Can I show RTMP Packet directly to the app or i've to convert it before sending and showing to the app?
Should i make a server in node js and use socket io for broadcasting (Already done some messaging app but not for too much traffic, not sure single threaded nodeJs will work or not) or have to use some other libraries? or completely use other technology like java or something else for server side?
Or there is a better solution to make this?
Please let me know if you didn't get. Your suggestions will be highly appreciated.
thanks!
I have a web bot continuously scanning a web page for a certain string, and when it finds it, I want a notification to be sent to my phone. The web bot is written in Java, so what would be the best way to communicate the information? Is it SMS or perhaps Bluetooth? Thanks!
Edit: A little more information... I have an iPhone 5c and the distance between my phone and computer can be assumed to be short (as in in the same house)
You could have your phone constantly polling the web bot computer to see if it has any new notifications for it, or you could have your phone run a web server (assuming you are on the same network) and let the web bot contact it when it has something to share.
However, I suspect that you may find it easier to simply use one of the common mobile notification services such as:
https://aws.amazon.com/sns/
https://developers.google.com/cloud-messaging/
These have the advantage of working across mobiles, should have good examples and user forum etc, and most importantly are designed to work when you mobile is not actively running an app, so will likely be much more power efficient than a home grow solution.
Hi guys could any one help me a little bit, I'm making an android app, for cabs request, but I need a way to send to the driver app, an alert where he accepts the invitation to pick up the client, if he choose the accept button, and alert pops up on the client app telling him that the driver is on the way :) Thanks, I think i need for Threads to me always watching for these client notifications.
You can use Socket programming. This is an example where it shows how to communicate between two android phones.Example shown in emulators
http://examples.javacodegeeks.com/android/core/socket-core/android-socket-example/
This question depends on a few factors. Whether there is a server to control the communication mechanism or not. Whether the devices are close to each other. Whether there is a network oriented method like SMS allowed to be placed and so on. To minimally answer this, the following could be the easiest way to communicate between two Android devices.
If the devices are close to each other, use Bluetooth
If the devices have a server to connect in between, use an Android service to take the connections things to the background
If there is an SMS/Call based connection between the devices, use Intents and Content providers to further deal with the data.
I want to make one desktop application for our college so that it can be use in the way so that when we want to send update about the college fest it can be directly reached to all the person who have the desktop application in java.
For android we have the GCM concept. Is there any method for the desktop application also?
I do not want to use polling here .... So please tell me any suitable method how to do this?
Not without running a server of your own. GCM is a particular service that Google runs free of charge to encourage developers to use the Android platform, and it works by having every Android device make a TCP connection to Google and keep it open all the time waiting for incoming messages. You'd have to have your own similar server.
You could use a JMS publish/subscribe topic, but in this case, it is almost certainly a better idea to let the client poll for updates in JSON or RSS format. Is there a specific reason you don't want to poll?
Idea: create a remote control for your android phone.
Why: I like listening music on my phone in a dock station with speakers connected. Now sometimes I want to turn the volume up/down, change the song, etc. So I need to unlock the phone, locate app that is playing music (Music player, internet radio app, etc.). Sometimes I manage to undock the phone or just mess something up and generally this s*cks.
So I would like to control my phone (on a data connection, not wifi) from the laptop (on wifi).
I had investigated couple of approaches and would like to get some recommendations on them:
Use XMPP. This is nice as there a lots of free XMPP services I can use. Two libraries (both based on smack) that I tried work just fine (Flow aSmack port and Beem smack port). I could automatically create new user on device and present some id/password combination that I (user) would enter on a desktop side to link both devices.
Use JXTA. Should be the next real deal but could be an overkill. I would imagine running a rendezvous&relay server somewhere (need to get hosting to work around firewall/NAT) and creating a peer group protected with password. Use device unique id and password (withing group) to link to the desktop application. (A great eBook explaining p2p and JXTA can be downloaded from here).
Use C2DM. Could be the answer, but notification delivery sometimes can take more then couple of seconds to deliver and there would be no feedback mechanism.
So far first solutions looks like a lot easier choice. Create custom extension or just create chat between both endpoints and use that for relaying commands/messages. But I wonder if I would be abusing XMPP system?
JXTA sounds great, but from all the reading I done it is apparent that it is designed for group communication and service sharing and not a solution for connecting two endpoints.
What do you guys think? I welcome all suggestions too.
UPDATE I do not want to remote to a phone and interactively control it. I want to establish a connection (socket connection) between laptop and phone even if both of them are on different networks secured behind firewalls, routers. With this I could define a protocol to issue commands to the phone (lower volume, mute, start app, etc.).
UPDATE 2 I'm giving JXTA a shot. It is a nice solution but lack of documentation is a bit of a downer. Got VPS FreeBSD server to test RDV/relay side of things. I keep updating this question further as it may be helpful for others.
UPDATE 3 Some more reading:
How to make two android devices to communicate through TCP
Connection between two computers without opening ports using a third computer
UPDATE 4
So far I did not have enough time to further continue my project. I did find an interesting project. At the moment project owners are re-writing their library, you can track their progress here.
why do not you try installing VNC server on machine and then use VNC client on laptop to access mobile
Mobile Shell (Mosh) maybe just the tool you are looking for. I have been looking for a good project to use Mosh, your idea seems pretty interesting :)