How to implement GCM in Google AppEngine? - java

I'm a PHP Developer and Web Designer. In my work a partner asked me if I could set up a Google Cloud Messaging server.
I read the documentation but couldn't find a clear tutorial to set up this server.
I got no knowleadge about Java so it makes my job harder. I could "compile" a war file using ant as GCM Demo Tutorial says. But I can't deploy it to my AppEngine server to try it out (It's my first time using AppEngine too).
Could you give me some steps to create my own GCM server?
Sorry about my bad english.
Thanks!

A easy way to import the gcm-server-demo to eclipse:
①Download a “Eclipse IDE for Java EE Developers”,and create a dynimic web project.
②Copy the ‘src’ and ‘webcontent’ from the gcm-server-demo to cover the web project.
③Add a server like tomcat or jetty to run the project.
And the registration id is sent by the Android application with a 'Post' request.
You can handle it with servlet or PHP

Related

Google App Engine tutorial questions

I am interested in importing Google contacts into my web-application.
I have gone through some of the Google App Engine tutorials on youtube and I have the following questions.
http://www.youtube.com/watch?v=tVIIgcIqoPw
(the above tutorial, my question are applicable to any google api)
In the tutorial they are using "Google plugin for eclipse" to build and deploy the application on to the App Engine.
I know I can deploy it on the local machine (for development purpose), but can I use Tomcat for deploying this.
When I use my local machine for development, how to configure OAuth2 redirect URL. The reason I am confused with this is because the application will deployed on the local machine. Will it mean I cannot use OAuth2 redirect URL will developing?
Your help will be greatly appreciated...
You are mixing things up and reading unrelated tutorials. Gae tutorials are about gae not a random deployment to something else like tomcat.
Look at the contacts api directly. There are also many tutorials on how to do oauth for a client app.

where is .WSDL file in visual studio web service project

I have created a WCF web service project using visual studio 2012. I published the service on local IIS on my own machine. I also wrote a client using the same version of visual studio and I can easily connect and use the service.
Now, I need to write the client using java Or C++ as I have to write the client for Linux base systems also. In all of the tutorials I found they address a file with .WSDL extension to call from client. There is no such a file in my web service project and also in published location.
How can I call my WCF web service using java or C++.
where is .wsdl file in wcf project of visual studio to call from a javq base client
It may seem funny but it was in front of my eyes. When I right click on the .svc file of my service in the IIs and select brows, it will show a page which has two links for .wsdl file of my service. I used the second URL to call my service from a java program using netbeans.
hope it help someone who is looking for the same topic.

Consuming Web Service in Blackberry Plugin for Eclipse Indigo

I am having problem consuming a web service written in asp.net/vb.net hosted at http://www.transmodallimited.com. After writting the code i discovered that the app wasn't really hitting the web service. So, in order to be sure, I went testing with the httpconnection demo and discover that even the httpconnection demo is not working. I tried switching the MDS on, tried adding ';deviceside=true' to my link and it still not working.
If you want to use KSOAP2 you can use this link BlackBerry and Ksoap2 Tutorial. Also see this thread on suppots forum Consuming .NET Web Service With BlackBerry JDE 4.6, Java Wireless Toolkit and KSOAP. If you want to use jsr-172 compliant stub you can use Calling a Webservice from Blackberry Java Application.
I strongly recommend you to use any sniffer tool like Wireshark in order to trace any HTTP/XML packages, if there isn't any HTTP/XML package, and your MDS is running before you run your application, then the problem could be in your code.

How to run jar Files in web Application

Now I have two .jar files: one is a chat Client and the other one is the chat Server. They are running fine on my desktop application, but now I want to upload them to run on my website. What is the best method for doing this? I have the following files:
chatclient.jar
chatserver.jar
Can some one please advise on how to put them in my web page without having to download them when a user clicks on them?
You do not provide enough information.
What would you like to achieve?
What technologies are you using inside the JARS?
Why not package the server jar with a web application ?
Is your client a desktop application, if so, why not to put it in the client's classpath?
Maybe consider having the client implemented in JavaScript using jQuery for example and some web sockets technology,
or maybe using some java web framework or tookit like GWT or Apache Wicket?

How do you access SQL database from GWT?

I've read some articles on the Internet that this is not possible. To communicate own SQL database that is located on other server from GWT application. Jetty doesn't allow it.
I found a way how to perform it but it's not very cosy. I have client and server part inside GWT. The server has to communicate with MySQL database on localhost. So I've written an ant script to build a war that I can launch on Apache Tomcat server. It works perfectly there but I'm not able to debug the code effectively.
Do you have some advices how to perform this task? I was thinking of writing the clienty only in GWT and find some waz how to communicate my own server written outside the GWT. I've found Apache Thrift for GWT but this edited library of thrift seem not to work properly.
Thank you very much for your answers:)
It is possible to communicate with a database from a GWT application. The client side has to call the methods of the server via GWT-RPC, which can communicate with any database.
Maybe Jetty does not support it (have not tested it personally) but you can develop your web application using Apache too. There you can access the database the same way as from any web application:
You will need the mysql-connector-java-5.1.20-bin.jar file (downloadable from: http://dev.mysql.com/downloads/connector/j/ ), and restart the server added to the $CATALINA_HOME/common/lib directory.
OR added to the WEB-INF/lib folder of your web application.
You can find tutorials online of how to develop an application using Tomcat instead of Jetty. For example: https://wiki.auckland.ac.nz/display/BeSTGRID/Deploying+GWT+to+Tomcat+in+Eclipse
Reshi, stop and think about how applications really work. Nobody provides web pages with javascript to read/write databases, that would be crazy and unsecure. Servers are always in themiddle of all communication in this case. You need to create services that run inside your server, one of these services will be a database layer.
Javascript cant create network connections and read/write binary data, thus it would be insane to attempt to get the gwt compiler to compile any jdbc drvier and more.
Jetty does NOT stop us from connecting to a database. All you have to do is to follow the MVP model way. Although MVP is better bet against all hurdles, at a minimal point, you would have to try not having SQL code on the client package.

Categories