mobile application development myrent service · 2016-11-01 · myrent service learningobjectives...
TRANSCRIPT
![Page 1: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/1.jpg)
Mobile Application DevelopmentMyRent Service
Waterford Institute of Technology
November 1, 2016
John Fitzgerald
Waterford Institute of Technology, Mobile Application Development MyRent Service 1/1
![Page 2: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/2.jpg)
MyRent serviceLearning objectives
• Service being provided to facilitate client dev.• Service provided for deployment to localhost.• Service also deployed on Heroku (access provided).
Waterford Institute of Technology, Mobile Application Development MyRent Service 2/1
![Page 3: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/3.jpg)
MyRent service appFile structure
Waterford Institute of Technology, Mobile Application Development MyRent Service 3/1
![Page 4: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/4.jpg)
MyRent service appService JUnit Play tested
Waterford Institute of Technology, Mobile Application Development MyRent Service 4/1
![Page 5: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/5.jpg)
MyRent service appAndroid client development
Waterford Institute of Technology, Mobile Application Development MyRent Service 5/1
![Page 6: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/6.jpg)
MyRent service appModel
• GenericModel extended.• Play Model an alternative.• Generic: allows bespoke id.• Model: auto-generates id.
Waterford Institute of Technology, Mobile Application Development MyRent Service 6/1
![Page 7: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/7.jpg)
MyRent service appUtility class
Enables controller actions to translate to & from Json objects.
Waterford Institute of Technology, Mobile Application Development MyRent Service 7/1
![Page 8: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/8.jpg)
MyRent service appJavaScript Object Notation (JSON)
• Text-based open standard.• Douglas Crockford
originator.• Transmit network data.• Replacing XML.
Waterford Institute of Technology, Mobile Application Development MyRent Service 8/1
![Page 9: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/9.jpg)
MyRent service appGoogle Gson
Waterford Institute of Technology, Mobile Application Development MyRent Service 9/1
![Page 10: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/10.jpg)
MyRent service appController: ResidencesAPI
• Actions do not renderviews.
• Use renderJson toreturn data.
• HTTP responsecodes: OK,notFound.
Waterford Institute of Technology, Mobile Application Development MyRent Service 10/1
![Page 11: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/11.jpg)
MyRent service appController: ResidencesAPI
Waterford Institute of Technology, Mobile Application Development MyRent Service 11/1
![Page 12: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/12.jpg)
MyRent service appController: ResidencesAPI
Waterford Institute of Technology, Mobile Application Development MyRent Service 12/1
![Page 13: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/13.jpg)
MyRent service appController: ResidencesAPI
Waterford Institute of Technology, Mobile Application Development MyRent Service 13/1
![Page 14: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/14.jpg)
MyRent service appController: ResidencesAPI
Waterford Institute of Technology, Mobile Application Development MyRent Service 14/1
![Page 15: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/15.jpg)
MyRent service appController: ResidencesAPI
Waterford Institute of Technology, Mobile Application Development MyRent Service 15/1
![Page 16: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/16.jpg)
MyRent service appRoutes - API
Client application uses these patterns to communicate with service.
Waterford Institute of Technology, Mobile Application Development MyRent Service 16/1
![Page 17: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/17.jpg)
MyRent service appRoutes - API
Waterford Institute of Technology, Mobile Application Development MyRent Service 17/1
![Page 18: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/18.jpg)
MyRent service appTest your API with Postman
GET localhost:9000/api/residences
Waterford Institute of Technology, Mobile Application Development MyRent Service 18/1
![Page 19: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/19.jpg)
MyRent service appPreload sample data
Not compatible with unit testing.
// Bootstrap.java@OnApplicationStartpublic class Bootstrap extends Job {
public void doJob() {if (Residence.count() == 0) {Fixtures.deleteDatabase();Fixtures.loadModels("data.yml");
}}
}
Waterford Institute of Technology, Mobile Application Development MyRent Service 19/1
![Page 20: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/20.jpg)
MyRent service appPreload sample data
Not compatible with unit testing.
// data.ymlResidence(residence_1):
id: 1234geolocation: "52.258136,−7.127810"date: 1448196498688rented: truetenant: Homerzoom: 12.0photo: "photo 1"
Waterford Institute of Technology, Mobile Application Development MyRent Service 20/1
![Page 21: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/21.jpg)
ReferencesRetrofit from Square Open Source
1.Gson User Guidehttps://goo.gl/ZPXTsI [Accessed 2016-10-30]3. Postman (Chrome Web Store)https://goo.gl/1we0lx [Accessed 2016-10-30]
Waterford Institute of Technology, Mobile Application Development MyRent Service 21/1
![Page 22: Mobile Application Development MyRent Service · 2016-11-01 · MyRent service Learningobjectives • Service being provided to facilitate client dev. • Service provided for deployment](https://reader033.vdocuments.us/reader033/viewer/2022060323/5f0dc0067e708231d43be646/html5/thumbnails/22.jpg)
Waterford Institute of Technology, Mobile Application Development MyRent Service 22/1