I'm new in android and i want to know if there is some server / web service online that o can use to update and communicate with my app?
example: I have the app "message" in 5 phones so I want to communicate with all of them, if the phone 1 send a message all device must receive notification.
There is something that I can use maybe free?
You have many options to accomplish this goal, and most provide some free level of support.
In general if you want to "push" notifications to android devices, you can either directly use or use some provider that uses Google Cloud Messaging.
Using this approach directly means you need some web server to send request to, which will then forward a request to Google, which will then forward your "message" to the devices you want to reach. There are many options for free hosting of (smallish) web services. IBM's BlueMix and Heroku come to mind. So if your are comfortable writing web apps, this might be a good choice. I have used both (for Ruby on Rails backends to mobile apps) and found both very good, but am currently using Bluemix.
I believe Bluemix along with Parse also offer mobile data storage and easy access to Push notifications to both Android and iOS. I am currently using Bluemix via Ruby on Rails and pushing messages directly to devices via GCM and don't have much experience with those particular offerings.
Related
I want to implement fcm push notification like other websites facebook,amazon etc. for my web app built on spring and Jsp. I go through the all google docs but didn't find any. How other website ask user to send them notification and after allowing they start sending?
HTTP, which has a request-response model, is ill suited for the job. You asked how some applications do it, well the older ones create a HTTP channel which remains open for the application lifetime. The backend pushes new data to this channel as and when new events occur.
Any application that is reasonably modern uses websockets. See the WSS protocol. There are libraries built around this protocol to make it easier to consume, such as socket.io. You should read the MDN reference as well: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications
I recently started developing my first web application with Spring and I'm stuck with a question I could not really find an answer to. What I have is a simple Spring MVC application running in tomcat which provides data in form of JSON, XML or binary via REST. This service is consumed by two clients I developed, a simple Java desktop application and an Android app. So far the clients only got information about new data by polling.
What I want now, is a way for the server to send notifications/messages to the clients when new data is available. For the Android client it would be good if the notifications could received anytime, not only when the app is currently open of course. I found lots of information for JavaScript client code but very little really useful, up-to date input about what the options for java and android clients are.
It would be really great if someone could give me some idea what would be the best way to achieve what I want (ideally something which integrates well with Spring on the server side), what protocols/libraries/frameworks to use, maybe even point me to some example or tutorial, how to implement this on server and client side.
Thanks in advance for any input.
For android or mobile devices, Google Cloud Messaging is the preferred way of sending messages to applications running on devices.
Example : spring gcm server side project and a sample tutorial.
For desktop apps, either poll regularly the server or run something in background like crontab or active-mq to check the messages and start the desktop app.
WebSockets are the best solution. check the implementation in java in the server side
I need to create an Android application with lots of graphics and many rather complex calculations.
I want to do the calculations on a server and use the Android app only for interacting with the user (receiving user input, graphics).
I'm thinking about using Stencyl or Corona SDK for implementing the client.
If I implement the Android client with Stencyl or Corona, will I be able to communicate with a server via a web service?
you can do this on Corona using Network Request see this link
I'm interested in having a desktop application send messages to a web app. Specifically, the desktop app, written in Java, needs to send messages to a Javascript function that will be running in a browser. The messages only need to be sent one way. Also, both programs will be running on the same local machine. I can set up a local development server if necessary.
I'm new to networking and web development and I have no idea how to approach this problem. Can anyone offer any suggestions?
I think the appropriate way to do that (if not the only way) would be to go through a server both apps talks to
The enterprise architecture way I recommend you do is:
Put the common information into a webservice.
The website sends information, possibly via ajax or by navigating to a different URL or doing a form POST to the webservice.
The desktop app will start up and will subscribe to the webservice. The webservice will notify the desktop app once it has an update. (note that the desktop app, might need to poll for updates).
That approach is how services such as flikr, twitter etc use.
The light weight (ie smaller architecture) way of hacking this is to make your website have an RSS feed that your desktop app subscribes to. The desktop app gets updated via the RSS feed.
That approach is how services such as news websites will send updates to readers. See google reader as an example RSS client. RSS has an adavantage of supporting generic rss consumers like MS outlook or google reader from the start, where as webservices are likely to be more flexible and cleaner in the long run.
why does the desktop app need to talk to javascript? What is it you are actually trying to do? Send or receive data to or from a database? Run some business logic on the web app? These things are typically done from a desktop app to a website using soap or rest.
is the browser embedded somehow in the desktop app? Or could is it just running as a separate process? It seems like audio processing should really run in the desktop app.
However, assuming that the browser is running as a separate app, you should be able to send messages to the browser through the query string. The desktop app could fire up the browser, point it to a url and pass some parameters to it. THen javascript can process those parameters. Google whether jquery can process query string parameters.
Embed a simple container like jetty then use Jersey or a Simple Servlet
I am currently trying to research how to use Android with an existing java based system. Basically, I need to communicate to/from an Android application.
The system currently passes object data from computer to computer using ActiveMQ as the JMS provider. On one of the computers is a display which shows object data to the user.
What we want to do now is use a phone (running Android) as another option to show this object data to a user with wifi/network access.
Ideally we would like to have a native application on the Android that would listen to the ActiveMQ topic and publish to another Topic and read/write/display the object data, but from some research I have done, I am not sure if this is possible.
What are some other ways to approach this problem? The android Phone needs to be able to send/receive data. I have been using the AndroidEmulator for testing.
A quick and dirty way would be to have your JMS pushes the data to a XMPP/Jabber server and use a XMPP library like Smack API on the Android to connect. The advantage of this approach is that
You can emulate the point-to-point and pub/sub in JMS.
XMPP is quite extensible so what you can do is instead of carrying your payload as 'chat' text, you can create your own namespace within the XMPP packet. For data portability, you can use a lightweight like JSON in the namespace.
XMPP will handle your presence for you so your app don't have to keep track of services if they are online.
There is a nice article here that shows you how to use Smack on Android.