Can anyone recommend a tutorial or point me in the direction of some easily implemented .net or PHP code that i could use to setup a third party application server for C2DM.
I am a Front-End Developer with some PHP/.net experience, but very minimal Java experience, our app is setup with the required java code/classes and I have registered with C2DM, but i'm struggling with the application server part of the equation.
I would like to setup a server application that can handle form requests to send a message out to our app.
Any help or advice would be greatly appreciated!
The server part of C2DM is a piece of cake compare to the client (in my opinion). You can find below some tutorials about the server part :
One for JAVA very easy to understand even if your are not JAVA developper.
One for PHP and Zend framework.
A basic example for C# on stackoverflow
A common mistake to avoid if you want some performance : Don't connect for each message to send.
You just have to auth one time to the google server and then you can send multiple notification message.
Also don't forget that Google will periodically refresh the token in an Update-Client-Auth header. You should handle this header to keep your tokens up to date. Have look to this discussion about it
You may want to have a look at this post. It is a basic PHP implementation using curl.
I am building a server-side C2DM based on Drupal CMS.
While it is not 100% ready, if you want I can try and help you building it.
Using Drupal as the server-side, and its amazing modules such as Services and Rules, you can create a very interesting applications very easy, almost "out-of-the-box".
Related
I went through several topics on SO but I am not sure what fits my needs as I am newbie.
I am creating an Android application for my website.
I reckon that the users can be over 800000 online at the same time.
Users will be able to:
- Submit data through the application
- Read news and updates
I want the updates to happen in real time..
The question is what approach or technique should I use?
In some SO topics is mentioned that there should be on the server side some php files that will accept http/post/get requests and they will return JSON data as feedback.
Is the above-mentioned a proper technique to serve a huge amount of users at the same time(for my standards "huge" means around 800000 users at the same time)?
I recently came across node.js. From what I read it seems like it can act as service where a user/ app can request or post data.
Can anyone give me a suggestion or links where the things are clear? How can I make sure what approach is the right one for my application?
Whatever the case is can anyone describe the right way of doing this thing?
For example: How Android chat aplications suchs as whatsapp, facebook etc work? How they do it?
I do NOT want you to post any code.. just ideas!
Thanks in advance!
If you want create an app like Facebook, Snapchat ... YES you must have a WebService, an API.
The API is linked with your database like your website and return to the app JSON, with the content of your app.
Your API (web service) can be programmed in various language as PHP, Node.JS ...
If you want to know Facebook had their API in PHP before that they created their own language.
Some other app have their API in other language.
I don't really know what is THE BEST language, the BEST language is the language which you are good with, and know it.
I think think nodejs will be best option.
NodeJs is helpfull when there are large number of clients.
Nodejs works best when building chat and gaming applications.
I think this link will help you a lot to learn nodejs.
If you are asking how facebook and whatsapp works they are implementing websockets which provides bidirectional flow of data helps in real-time communications between clients.
If your scenario is sending chats back and forth nodejs is a really good option, Most of the online tutorials you will find about nodejs develop a chat application and its super easy to do so with nodejs. Infact the biggest catch with nodejs is its easy configurations and deployment plus its lightweight. However it might be a good idea to have a look at XMPP as tech giants such as whatsapp use it to send messages and maintain presence. This link can be a good head start for nodejs learning http://code.tutsplus.com/tutorials/nodejs-for-beginners--net-26314
I need for a project to build a live chat with:
group chat room
private chat (user-user);
web site interface;
mobile interface;
others information (profile etc).
I want to start obviously from the server: any PHP framework or tutorial to do this ?
Otherwise, any full-solution (but customizable) with web site + mobile compatible ?
Use XMPP Server (XMPP server uses Socket programming, so once a connection will be establish, then it uses that connection each and everytime, you no need to create connection everytime, like HTTP).
Or Use GCM (Using Push Notification you can send and receive messages as well).
Here are some Source Code - Github
Source from google
Hope it helps.
http://vidorsolutions.blogspot.pt/2011/01/writing-xmppjabber-chat-application-for.html
This would be the best place to start!
Have fun building the app!
Also if you really want to get deep into it, Xabber source code will prove of great help.
XMPP is a communication protocol for message-oriented middleware based on XML (Extensible Markup Language). In plain words it is a protocol used for instant messaging.
While APNS and GCM are services used to set up push notifications for your apps.
So, it's a bit different.
I believe building a chat app from scratch is not an easy task for you.
So, I'd recommend using a ready backend and concentrate on client-side implementation of your app.
For backend you need to choose a provider with the set of features most suitable for your project and then start app development with the API provided by your backend provider. You might find this article useful when choosing.
It seems you are looking to get going fast on your chat implementation...the xmpp implementation is one way. Firebase provides another. Having implemented messaging via xmpp as well as firebase, I can offer up this tip: stable connectivity and auto-reconnect logic in an openfire+SMACK implementation is not particularly reliable. I have had recurring troubles maintaining connection in the face of drop offs; updates in Openfire that may or may not conform to the older SMACK library versions are not helpful (no one guarantees for conformity - you are on your own). Others with more xmpp-based experience may attest to these difficulties. Firebase is not without its own challenges but I found them manageable. I also recommend you checkout at least one opensource chat library implementation via firebase (github link being one such). With firebase the connectivity issue largely goes away and a host of new options open up. I prefer if the backend is fully taken care of by the library provider so we only need to focus on UI. Hope this is helpful.
I have looked on here and anddev for a suitable response, but haven't found anything suitable.
Here is the question: My friend has an instant chat application with iPhone, and since I have some basic android experience he asked me to check out "porting" it to Android. So before I set up the UI, I decided to look into php which I don't have much experience with. I know the UI will need an array to call contacts, but I'm not sure about retrieving the information from the php.
How do I know if I can use his script or not? I haven't found any good tutorials about Android and Php - has anyone found one?
I might as well learn this stuff now because my next app will require an online database to be used in it - I know his has users and passwords, and he'd like to be able to send im's between iPhone and Android clients.
Thanks for any help you may provide!
EDIT:
Yes, this issue is more related to http requests from android to a remote server; I have changed the tags and subject accordingly, but would still appreciate a guide to android-friendly php writing. Thank you!
There really isn't Android-Friendly PHP but there is mobile friendly PHP. Basically, you need your PHP scripts to emit something that is easy to parse in an application (like XML or JSON) rather than the standard HTML. After that, all you need to do is figure out what the API should look like on the server side. That is, what functions does the server need to provide and how is it going to provide them. Are you going to use simple HTTP authentication or are you going to use something more complicated?
With regards to his chat application, I would imagine that if he already has an iPhone version, then you won't need to mess with the sever side at all. All you need to do is figure out what URLs and parameters to use for what operations. You also need to ask him what data format his server uses. If it's XML, you need to find an XML parser, if it's JSON then you need to find a JSON parser etc. (there are plenty of tutorials on how to do both in Android via Google). I would start by asking him, at a high-level, not with Objective-C specifics, how his chat application communicates with the sever. You can then use that to build your application to communicate in the same manner.
In my website, I have to make a chat system similar to Gmail so registered users can chat with their group. I have no idea about how I will do this. Can anyone provide me with an idea of how to implement this or any useful links? I have to do it using Zend Framework.
Since you are looking to work this out using Zend framework, have a look at Jaxl library (Jabber XMPP Client/Component Library). The library can be integrated with any existing website/framework and also contains several examples for browser based chat applications.
Actually there are two parts for chatting:
A long running request that streams massges from the server to the client
Ajax messages from the client to the server that sends one message to the server
For the second, any ajax framework will do it. For the first you might have a look at Comet to get the idea for this. But you should be aware that html isn't ment to be a chatting protocol. If you don't pay attention such stuff can easily kill your server.
I am wondering how to integrate jabber instead of using my AJAX polling script. I chanced upon the following: http://code.google.com/p/xmpphp/
It gives me access to a jabber server, but does not tell me how to exactly go about it. I mean for example
$payloads = $conn->processUntil(array('message', 'presence', 'end_stream', 'session_start'));
Are there a fixed set of commands that I can use? Is there some site which explains the jabber workflow in very simple terms?
Thank you very much for your time.
I've been wondering about technologies to play around with XMPP, been looking at:
Strophe
BOSH
Examples of this technology can be seen at:
drop.io
Chesspark
These two doc pages seem to be fairly readable:
Core
Instant Messaging and Presence
Also, you might already be heavily invested into xmpphp, but if not, you may want to take a look at Phurple. It gives you access to the libpurple library (the code-base for Pidgin) from PHP.
From the project page:
This libpurple PHP binding, which
defines a set of internal classes,
gives a possibility to use aol and icq
(oscar), yahoo, msn, jabber, irc and
much more protocols directly from PHP.
Write your own IM chat client in PHP,
as simply as PHP enables it.