Thursday, June 24, 2010

Google AppEngine – Hello World Example


The best thing about Google AppEngine is you can run your java web-application in Google infrastructure for FREE of cost (up to certain user hits).I was really excited to know this, because it's really a great opportunity to deliver lots of small web utility at free of cost.
Let's get started:



Installing Eclipse AppEngine plugin:

              Google provided Eclipse plugin for developing & deploying AppEngine application easily. Based on the Eclipse version we need to select different update site URL, in our example I am using Eclipse 3.5 (Galileo) so i am using update site URL  as http://dl.google.com/eclipse/plugin/3.5


Steps 01:

In Eclipse, select Help menu and click "Install new Software" option as below.

Step 02:

Once the Wizard opens, click Add button. Below pop-up box should be displayed where you have to enter the update URL (based on the Eclipse version) and a unique name. Then click ok.

Step 03:

Below windows screen should be displayed, where SDK and plugin files are displayed. Check both check boxs and click Next.

Now Eclipse connect to the server and downloads the files, once the files are downloaded it displays license agreement page, once you have agreed to that, it starts installing the files and request you to restart the eclipse .After restarting  the eclipse, you should see below new icons in your eclipse top left corner.

Creating Application:

Click on google icon, which will open below application creation wizard.




 

Project Name:  Name of the project.

Package Name: you have to specify the default package name, based on this your files are created under the given packages.

Apart from that, it also supports GWT supports, currently we can ignore the GWT support option and we should select only AppEngine Support.Click Finish.


Default Project:

Once you click finish, plugin will create a default project skeleton, where you will have directory structure which is required by google appengine."war" is the deployment folder, where all your dynamic files and static files should be placed.

Debugging the Application:

Right click the project, select "dubug as" and select Web Application option.Now the code should compiles and then eclipse starts the server. You can view the application using URL http://localhost:8888/<application-name>



Deploy Application:

Once you done with the debugging, it's time to deploy the application. Select icon and eclipse pops-up below dialog box.


Click "App Engine project Settings" option, which open the windows where the application ID should be entered. If you are creating first time then click "My application" option which pop-up the browser and lands in creation of application Id.



Click "OK", now you will be back to the previous screen, now enter your password. Once you enter the password the Google AppEngine will connect to the server and the files are deployed.

Once the Eclipse finishes the deployment, now you can access the Hello world example in the below URL <Application_ID>.appspot.com/<project_name> example: http://its-passion4java.appspot.com/passion4java
 

That's it, now the hello world application is live in Google infrastructure.Please post your comments, if you think some thing can be added ;)...

5 comments:

Anonymous said...

I know this is a Java blog but is there any way you can write a hello world tutorial for appengine with Python, please and thanks :)

Mohammed Yousuff said...

oh, thanks for your comments... I think i may not the right person for google Appengine in python... Sorry for that :(

andreifu said...

great tutorial! keep up with the good work!

Classifs said...

Good Job Yousuff!

Keep up!

Animesh Agarwal said...

My college is using a proxy server to connect to the internet.

I have done the proxy settings as told on the GoogleAppEngine site but I cannot get past the email and password authentication. I am using Ubuntu 10.04 with eclipse helios. I have tried both the eclipse and command line methods.

Please Guide.

Post a Comment

 

This content comes from a hidden element on this page.

The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.
Click me, it will be preserved!

If you try to open a new ColorBox while it is already open, it will update itself with the new content.

Updating Content Example:
Click here to load new content