Is there an alternative to using Google C2DM for push notifications with Android? I ask because the app I'm working on will only run when the device is connected to a specific network. It's an app for members of this specific company and notifications will only come from that companies server. Since everything is "in-house" does it even make sense to push them to google just to have them come back to the same network? I've heard something about JMS. Does anyone know if that will work?
There are definitely some options. I played with UrbanAirship a bit and it seems nice. Check it out http://urbanairship.com/
You can try Tokudu . It uses IBM’s MQTT broker to handle the server work. Try it out.
Related
I have been trying to learn android programming following Ravi Tamada's tutorials - AndroidHive for weeks now.
I created an app that performs Create, Read, Update and Delete actions (CRUD). Similar to this .
Now, what I want in my app is to have another feature that whenever there is a new data created and/or updated in the database, the app sends notification to other android phones that have the same app.
I've researched and come across Google Cloud Messaging, which AndroidHive also have a tutorial for. The way I see it is that it is only the server that can send notification to devices and GCM cannot do: "Device to another Device" For instance, "Device creates data -> send to database -> GCM sends notifs to other devices". Correct me if I'm wrong.
So I've searched again and found that you can use Smack for Instant Messaging app. Similar to something that I want my app to accomplish. But I'm having trouble understanding and implementing Smack to Java and Android.
So what I want to know is:
1.) Is it possible for GCM to listen to a device to check if the app has change the database and sends a notification to other devices that there is a change in the database?
2.) Do you have any "noob-friendly" article links on how to have a basic understanding and implementation of Smack in Java-Android?
Thank you.
Check out the official tutorial on the Android developers site:
http://developer.android.com/google/gcm/notifications.html#upstream
You can just upstream a message to the Google cloud and it will be sent to other devices in the same notification group.
I'd suggest that you always start with the official tutorials first and then move on to third-party blogs, it's just easier that way.
I'm working on an app on Android that is supposed to connect to a custom device via Bluetooth, but in order to emulate that device (which I don't have yet), I made a simulator on PC, using Java's Bluecove.
However, I'm having a hard time figuring out the different connection's method.
First, on Android, we discover the device (here, a PC), then:
-We have the "UUID" solution, as explain in android sdk doc.
-Or the "Port" solution, as proposed here.
The second one seems more natural to me, as I don't quite understand what is a UUID in this scenario.
I do understand that we need to connect to a port of a device, but what does the UUID have to do with that? Why don't we need to specify it in the second solution?
If someone could give me a clue, that would be greatly appreciated :)
bluetooth communication is communication with service, so when you wanna connect to device you are attempting to connect to service,and uuid is number with which we connect to service, like ok, i wanna this uuid(this service).
I would like to manage a connection between 2 applications, they will run on diffrent phones.
The purpose doesn't really matters let's say that it would be some kind of a chat.
How can I create this connection between the applications? I know how to do it on pc java programs using the socket and the serverSocket classes but I guess it's diffrent in here since the phone might change his ip when he moves between networks.
So how would you do that? how would you create a connection between 2 applications/phones
Given the scenario you described in your comment, using Push Notification i.e Google Cloud Messaging (GCM) might be sufficient.
So, when program B wants update from program A, it will ask the server to push a notification (via GCM) to program A. Note that program A will not connect to the server every x time to check for updates.
Another out-of-the-box solution is to use SMS if the communication is not so frequent and messages are short. Here I mean SMS that will be processed directly by your app (given it has certain attention word) and will not go to the inbox i.e. no SMS notification on the phone
Since the two phones will, as you note, have changing IP addresses, you'll probably need to use an intermediary.
The general design pattern here would be to have a server with a fixed IP or DNS address that relays messages between your two mobile devices. The simplest implementation would be a webserver, to which each phone would connect via HTTP(S) to transmit data or poll for updates.
There are a number of backend-as-a-service platforms that provide this type of functionality pre-built, and would likely suffice for something like a chat system. Check out Cloudmine and Parse.
If you need a low-latency or near-realtime connection, you could also consider implementing your own server that uses the Android C2DM (Cloud to Device Messaging) service.
See Android's Sample Bluetooth Chat App, It will give you an idea for how it can be achieved.
my apologies if this is a trivial question.
I've recently begun doing some android programming and I'm writing a simple app that allows you to use your android device as a controller for your windows PC. Specifically it allows the user to do things like turn off the machine, make it sleep, reboot it etc etc. I'm currently using a python library called CherryPy as a server on the windows machine to execute the actual win32api calls to perform the desired function. What i'm not sure about is how to discover (dynamically) which machine on the network is actually hosting the server. Everything is working fine if I hardcode my machines public IP into the android app, but obviously that is far less than ideal. I've considered having the user manually enter their machines public IP in the app, but if there's a way to, say, broadcast a quick message to all machines on the WiFi and check for a pre-canned response that my Python server would send out, that'd be wonderful. Is that possible?
Thanks in advance guys.
Try sending a UDP packet to the special broadcast address 255.255.255.255. Every device in the network should receive a copy of that packet (barring firewalls), and you can arrange to have the server reply to the packet with its identity.
Write your app using the alljoyn framework. AllJoyn will handle these details for you.
I am looking for solutions for a problem that we are facing. We are planning to make a POC for Desktop Alert application. We will have a desktop AIR app that will connect to a Java Server. The server will need to notify Desktop App when it has a notification which will be displayed on the screen.
A couple of options that we have discovered are :
1. Keep a persistent connection between the AIR app and the Server, using some sockets and listen to any changes.
2. Poll the Server at intervals to check if some new data has come.
Since these options don't seem optimal (persistent connection) or seems performance wise (polling) better.
Is there a better solution for this problem or do we have to choose one of these?
For this, you could use a BlazeDS message service if you want to push messages to your client. Or a regular remote service with polling enabled.
It is built in out of the box and well tested equipment :)
Other technologies like GraniteDS or WebOrb for java are also possibilities.
Cheers