Lab 02 – Developing Applications With the Google App Engine PDF

Title Lab 02 – Developing Applications With the Google App Engine
Author Mohammad Ahmad
Course Enterprise Programming
Institution Manchester Metropolitan University
Pages 6
File Size 462.9 KB
File Type PDF
Total Downloads 14
Total Views 126

Summary

Tutorial work for EP Cloud Computing ...


Description

!Lab!02!–!Developing!Applications!With!the!Google!App!Engine! ! In!this!exercise,!you!will! • Use!the!Google!App!Engine!development!tools! • Create!and!execute!a!Web!application!in!the!Google!App!Engine!development! Environment! ! Overview! Google!provides!a!cloud!development!and!simulation!environment!that!lets!applications!be! developed!and!tested!on!developers’!machines!before!being!moved!to!the!Google!App!Engine.!! ! Eclipse!is!a!standard!development!environment!used!by!developers!working!in!Java,!C++!and! many!other!languages.!We!will!need!to!use!a!plugFin!for!eclipse!for!the!Google!App!Engine.!If! your!version!of!Eclipse!does!not!have!this,!you!should!download!and!install!the!Google!App! Engine!plugin,!available!at!http://code.google.com/appengine/downloads.html!! ! Creating!a!new!Google!Web!Application!Project! 1. Start!Eclipse.!From!the!Eclipse!menu,! select!File@New@Other,!then!Google@ Web!Application!Project! ! ! ! ! ! ! ! ! ! ! ! ! ! 2. Click!Next,!and!in!the!resulting!dialogue,!enter! appenginedemo!for!the!project!name!and!com.epmmu! as!the!package.!Clear!the!checkbox!for!Use!Google!Web! Toolkit.!Leave!the!others!at!their!default!setting:!Then! click!Finish! ! ! ! ! You!will!now!have!a!new!project!in!which!a!Web!application!for! the!Google!App!Engine!can!be!developed.! ! ! ! ! ! ! ! !

Running!the!application! 3. In!Project!Explorer,!select!appenginedemo!by!clicking!once.!RightFclick!and!from!the! menu!select!Run!As@Web!Application! The!console!should!show!the!message:!! The server is running at http://localhost:8888/! ! 4. Open!a!web!browser!and!type!in!the!URL:!http://localhost:8888! You!should!see!the!application!start!page!displayed! ! 5. Open!the!file!index.html listed!in!the!Project!Explorer!(in!lab3/war).!Change!the!text! Hello App Engine!to!some!text!of!your!choice!(note!it!is!in!two!places).!Save,!and!! ! You!have!created!and!executed!a!Web!application!using!the!Google!App!Engine! development!tools.! ! Adding!a!new!Web!page!to!the!application! ! 6. In!Project!Explorer,!select!the!war!directory!in!appenginedemo!and!RightFclick,!select! New@Other@Web@JSP.!Click!Next.! 7. Enter!the!file!name!cloud_computing!and!click!Finish! 8. In!the!file!that!is!created,!locate!the! !tags,!and!insert!the!following! text:! Cloud Computing Central Welcome to the cloud computing resource. We provide resources on Google App Engine Amazon Web Services Microsoft Azure 9. Save!the!file!and!open!the!file!index.html.!In!the!main!section,!enter!the!section! highlighted!in!bold!below:! ! td>Ex42 Cloud Computing ! 10. Save!index.html!and!run!the!application!again.!From!the!home!page,!click!the!link! Cloud!Computing.!You!should!see!the!new!page!displayed! ! Stopping!and!Starting!the!App Development!Server! ! You!may!want!to!stop!the!serve Click!the!Red!Button!in!the!App Console!Window! ! ! 2

! ! Demonstration! ! Your!tutor!should!now!give!a!demo!of!uploading!the!app!to!a!live!Google!Apps!page.!If!you!want! to!do!this!for!yourself,!you!will!need!to!create!a!Google!Apps!account!or!use!your!class!one.!You! can!have!up!to!10!apps!per!account!at!the!time!of!writing.!Ensure!that!you!are!logged!into!your! Google!account!inside!Eclipse.! ! Creating!your!own!App!Engine!Application! ! 1. Log!onto!your!account!at! http://appengine.google.com!! ! ! ! ! ! ! 2. Select!Create!Project! a. Create!a!Project!Name,! and!either!remember!the!unique!appFid! shown!or!create!your!own.!unique!appid! on!the!appspot!domain.!You!will!need! this!id!later!to!enter!into!your!Eclipse! Developer!screen.!! b. Accept!terms,!and!Create!Application.! This!will!take!a!minute!or!so.! ! ! !

! ! !

!

3. COMPATABILITY!PROBLEM! ! Currently!(Oct.!2016)!the!Google!App!Engine!runs!Java!1.7!.!By!default,!your!Eclipse!compiler! is!probably!using!Java!1.8!or!later.!You!need!to!set!the!defaultversion!for!the!app!engine! project!to!be!1.7,!together!with!the!Project!Facets!if!they!are!set!too.! ! You!will!know!if!you!have!this!problem!if!you!see!a!message!somewhere!similar!to!! 3

“Unable!to!update!app!:!Class!file!is!Java!8!but!max!supported!is!Java!7”! ! In!this!case,!set!the!Java!Compliance!level!in!the!Project!Properties! !

! ! Also,!go!to!Project!Properties!–!Project!Facets!and!set!Java!to!be!1.7! ! ! ! ! ! ! ! ! 4. Publish!your!demo!app!from!Eclipse! a. Ensure!you!are!signed!into!your!Google!account.!It! should!indicate!this!at!the!bottom!of!the!screen.!If!you! cannot!log!in!from!Eclipse,!quit!Eclipse,!log!into!Google! from!your!browser,!then!restart!Eclipse.!See!problem! at!! https://developers.google.com/eclipse/docs/signin!! b. Set!your!app!id!in!Eclipse.!RightFclick!the!project— Google—AppEngineSettings!

4

c. Enter!your!id!created!previously! ! ! ! ! ! ! ! ! ! ! ! ! ! 5. Now!access!your!app!live!at!http://yourappid.appspot.com!! ! Monitoring!Statistics!on!your!App! ! You!can!monitor!usage!of!your!app!through!the!dashboard!at!appengine.google.com!(ensure! you!are!signed!in!to!the!account!you!are!using!for!the!demos)! !

! ! Explore!the!dashboard.!Note!aspects!such!as! • Versions! • Admin!Logs! • Quota!Details! • Usage!History! ! ! ! Later,!we!will!look!at!using!the!Datastore!on!the!GAE,!to!show!data!persistence!from!your!apps.! ! ! !

!

5

GAE!Exercise!Part!2! ! 1. Try!importing!the!examples!from!your!intro!to!using!Google!Apps!exercise!into!the!App! Engine!project.!See!how!you!can!move!across!JSP!and!html,!as!well!as!other!folders.! ! 2. Migrate!your!servlets!from!the!jQuery!labs!to!the!AppEngine,!and!alter!your!jQuery! scripts!to!point!to!those!instead.!This!will!be!especially!useful!for!the!assignment.! ! IntelliJ?! If!you!are!using!IntelliJ,!try!the!tutorial!at! https://www.jetbrains.com/help/idea/2016.2/gettingFstartedFwithFgoogleFappFengine.html!! ! ! Extra!Info! ! • You!can!try!the!Google!tutorial!on!getting!started!with!AppEngine!at! https://cloud.google.com/appengine/docs/java/gettingstarted/creatingFguestbook!.! This!requires!that!you!have!Maven!installed,!though!you!may!be!able!to!use!it!without.! ! ! Real!Time!Sensors!implemented!on!AppEngine! • http://omerio.com/2016/01/16/realFtimeFsensorFdashboardFusingFgoogleFappFengineF andFraspberryFpiFzero/! !

6...


Similar Free PDFs