Web sockets or push notifications for non-native (web) applications - android

One of the advantages I thought of writing a HTML5 based app for mobile devices would be I wouldn't have to deal with (many) quirks.
I want to push changes from my server to a mobile phones browser, for example if my users goto http://mysite.com they should be notified when something changes. Is it possible to do this for android chrome browser and apple safari?

Yes this is possible if you build a server that can handle push (typically via WebSockets). Take a look at socket.io.

Yes if the changes are instant you can use websockets. Recently I started using http://pusher.com/ which is a quite good service. Alternitively create your own websockets to do this. Here is an article on websockets: http://www.html5rocks.com/en/tutorials/websockets/basics/

Related

Calling the OS Telecom Framework from a Web Browser

I need to develop a videocall application for telemonitoring, where a user in a Web Browser (on a Desktop PC running a Web App) calls a user in an Android App (on a Smartphone/Tablet).
Is it possible to use Android's Telecom Framework from a Web Browser? I was looking at this tutorial.
If it's not possible to do such a thing, I was thinking about using a VideoConference service like Vidyo along with FCM or GCM, to notify the Android App that it should connect to the Conference Room.
But that seems overly complex for this case of use, so a second question would be: Is there a simpler way to achieve a Web Browser to Android App Videocalling service?
No. That requires a native app, or requires the web browser to provide access to those APIs. TO my knowledge, none do. And if they did, it would not likely be the same API, as they'd want it to work across OSes.

NodeJS Alternative For Android

I have visited many blogs and questions looking for a way to use android as a client and nodejs as a server for my app. I came up with a solution that is to use PhoneGap like frameworks so that it could act like native but is not in reality. I need to use native android sdk and connect with NodeJS server (using SocketIO) to create my app. Is there any way I could do this?
P.S I want to know that while I set up by GCM can I pass my IP and port that I have created in my socket.io file to the GCM?
Cordova (hence PhoneGap) allows you to use most of the hardware APIs. PhoneGap nowadays is just a build service of some sorts.
The Cordova website and plugin store explain all the details. But t WebSockets are just an upgraded protocol or feature of TCP. Any newer technology supports it without any dependencies, but in dependence of the network you're traveling in.
Without diving deep into the code here at socket.io-website, I reckon that the initial build of your Cordova app is a WebSocket implementation to the server. So you got everything bootstrapped already.
What this tutorial doesn't explain is how to connect to the server. But read it up here.
I have no prior experience but Google Cloud Messaging seems not to be in the scope of the problem of socket.io. Once you have a connection to the socket you can send to the client whatever payload you want and might or might not need GCM anymore. If you need to send stuff via GCM read up on the the GCM node module.
Passing IPs around shouldn't be much of a problem since you're are running a public service anyway. You'd need to secure it anyhow of course.

Develop a Instance Messaging Client + Server for Android

Hi I need to develop a fully functional IM solution (like viber or whatsapp) for android. It will have the basic chat features plus many more. Can any one direct me on this. I don't want to re invent the wheel so my target is to use the existing thing as much as possible for the chat server etc (some thing like jabber). If one can direct me for this, or give me some good advice for this it will be a great help.
Edit -
I will extend the application future to allow other platform clients like Windows Mobile or iOS clients. In that sense what would be the best technology to implement the server? It must handle real time traffic well. Will I be able to wrap or extend some sort of a XAMPP server to get my work done?
This is what you need. http://developer.android.com/google/gcm/index.html
It has everything you need for developing applications like viber, gtalk, instant messaging sistems, global user notifications etc...and its pretty easy to implement.
A good solution if you don't want to reinvent the wheel is to create a Jabber / XMPP client on Android and all other platforms.
Server-side, you can use an OpenFire server for managing the roster and conversations with the Smack Library
Google Cloud Messaging as mentioned Janbo is the best way for sending push notifications to your mobile app.
What you could look into, is something like Firebase. They have an incredible api for such applications
firebase link to android docs
Plus it gives you a backend at the same time for free.

Implement app able to receive push notifications and launch web browser

What is the easiest way to implement a simple app which does two things:
receive push notifications (new messages in user's inbox),
open a page on my website in a webview or web browser.
It would be best if the solution was portable among iOS, Android and possibly other mobile systems like Windows Phone and BlackBerry 10, but I'm happy with separate solutions, if it's the only way to do it.
I suggest that, checking out Parse apis for this task.
There are solutions like http://xtify.com/ or http://urbanairship.com/products/push-notifications/ that provide an all in one package across platforms but I don't know the quality of service or which one would be right for you, some research on your part will be necessary if you choose this path.
Or you could implement it yourself but it will require your own server. The server would notify both Androids C2DM And Apple Push Service at the same time. You will have to implement the client side on each.
For iPhone here's a good tutorial for setting it up http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
For Android http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html
You register your app with both services then sends the push keys to your server. With the keys the server can then notify both platforms respective push services to send a notification .
I can't really help with the server setup stuff as its not my area of expertise but this is how we implement push notifications for the apps my company makes.
I'd recommend a Phonegap (Cordova) app and UrbanAirship for the notifications. You can get a free account with that. It's relatively easy to implement too.
As for the browser, I'm not sure exactly what you want it for. Could you elaborate and I'll post a response.

Push Ntification Api for Android

i want to develop an application that will receive PUSH notification from
server. what is the best way to do this so that i dont have to write so much
code to implement this. I am looking for any commercial service that can do
this for me. Can you please suggest me some good api or service
Urban Airship (urbanairship.com) provides an API to do this. However I would recommend C2DM.
Google's c2dm provides nearly this http://code.google.com/android/c2dm/
Even though there is no official push api supported
Yes, here is a good tutorial with all code you need:
http://blog.boxedice.com/2010/10/07/android-push-notifications-tutorial/
http://tokudu.com/2010/how-to-implement-push-notifications-for-android/
Google's C2DM can do this very neatly. Its available from Android 2.2+. Here is a tutorial on how to do it by Vogella. http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html
If you want more control and run the service along side your server, you can try OpenMobster Mobile Cloud platform's push service.
It provides the following functionality
A platform agnostic Push API (works on Android and iOS)
Queuing (If you are not available, it will deliver later when the phone comes online)
Should get you up and running quite fast. (No certificates, device tokens etc etc). Just a secure persistent TCP connection to the OpenMobster server is needed (the framework establishes this when the service is installed on the phone)
For more on the platform you can checkout: http://code.google.com/p/openmobster/wiki/PushFramework
btw: The platform also supports Device-To-Device messaging between other devices in the systsem (applications could be chat, instant messaging etc)
D2D Framework doc: http://code.google.com/p/openmobster/wiki/D2DPushFramework

Categories

Resources