Solved by verified expert:Attached is a .pdf which covers how the exercise should be completed, it is a step by step on the exercise, but the .pdf
clarifies how it should be completed since the exercise is a little
outdated.Here’s a link to the exercise: https://spring.io/guides/gs/consuming-rest-android…The
.pdf is attached, the exercise is titled “Consuming a RESTful Web
Service with Spring for Android” with a link to the .pdf, starts on page
5.This is a dropbox link to my progress so far:https://www.dropbox.com/s/aovqf6gh7uy7r5x/Rest.zip…The project is a .zip file.These are the requirements:Deliverables:Create a zip file as follows:Filename of zip file identifies assignment and youSource filesGradle build fileRunnable .apk fileminSdkVersion set to 21Word document with screenshots of app running on your machine.
week_10_agenda__web_service_.pdf
Unformatted Attachment Preview
CIS 622
Mobile App Development
Week 10
AGENDA
Homework Review
Chapter 16 Notes
Bellevue
University
Define fragment (p.264)
Define service
Is a fragment always required to have a
user interface?
What controls the lifecycle of a
fragment?
How do you create a fragment?
What method is called to set a
fragment’s user interface?
After setting the fragment’s user
interface, the onActivityCreated()
method should be called; what should
be done when this method is called?
Why is a Context object needed?
Fragments must be added to layouts
(p.265); there are two ways do this.
The first is to use an XML element in a
layout file; describe how this is done.
What is a transaction?
The second way to add fragments to layouts is to use the
FragmentManager and FragmentTransaction classes. Describe how
methods from these two classes can be used to:
o get a fragment
o add a fragment to a layout
o replace a fragment in a layout
What is the purpose of calling the commit() method in a transaction?
What other functions can you perform using the methods from the
FragmentTransaction class? (p. 266)
When implementing fragments in your application, should fragments
be able to communicate directly with each other? Why or why not?
What should be called whenever a control in a fragment needs to
update other parts of the user interface? (p.267)
When updates are made internally in the fragment and do not affect
the rest of the user interface, from where should these updates be
managed; the fragment or the activity class that created the
fragment? (p. 268)
Imagine you are updating an older Android application that does not
support responsive user interfaces; how would you begin this
process? (p.268)
During the latter redesign process, what can be done to make reusing
fragments easier?
LOOKING AT AN EXAMPLE APP (p. 269)
List the fragments involved in the Example App.
Describe the functionality of the color picker screen activity. (p. 271)
Describe the functionality of the setColor(int color) in the
ResponsiveExampleActivity class. (p.272)
Describe the contents of the PickColorFragment XML resource file.
How does the PickColorFragment activity class work? (p.273)
The fragments and app thus far are designed for a phone interface.
When you are ready to scale this interface up to a small or large
tablet, what makes the job of converting this interface to work on a
larger screen is easier? (p. 274)
Would you agree that the image in Figure 16-6 should be in Figure
16-7 and vice-versa? (p. 275)
Underneath “Layouts” on page 275 it states “As you can see on the
wireframe designs, the first activity can have any of the three
layouts—a one-column phone screen, two columns on a small tablet
screen, or three columns on a large tablet screen.” For the latter
statement to happen, what is the first coding task that must be
completed?
What is the difference between a one-column and two-column layout
in the Example App?
On page 276 in the XML code for the two-column layout, note that
only the PickColorFragment is defined in the layout; how is the
second fragment added?
What is the difference between a one-column and three-column
layout in the Example App, and how are the other fragments added in
the three-column layout? (p. 278)
What chooses the correct layout automatically at runtime? (p.279)
What is the first step to changing the ResponsiveExampleActivity
class so that it can manage the different layouts and how can this
change be coded?
For two-column displays, what must you add to show the second
two-column screen? (p. 281)
Building a mobile application with Web services
What is a Web service?
o Android applications usually cannot interact directly with
applications running on different operating systems
o Example: An Android mobile application may not be able to
store/receive data with a database on a Linux server
o There are many definitions for “Web service”. For this class
Web service is defined as “An Android application component
that enables interaction across the Web with an application
running on a different operating system.”
o A Web service can be written in any programming language
Typical uses of Web services
o Reusable application-components
Call a Web service for commonly-performed application
functions
Examples: currency conversion, weather reports,
language translation
o Connect existing software
Enable Android app interaction across Web with
application running on a different platform
Example: Android app exchanges data across Web with
application running on different platform
Types of Web services
o WSDL
WSDL stands for Web Services Description Language
WSDL is an XML-based language for describing Web
services
o SOAP
SOAP stands for Simple Object Access Protocol
SOAP is a messaging protocol that enables apps running
on different operating systems to exchange data
formatted in XML using the Web Hypertext Transfer
Protocol (HTTP)
SOAP is commonly used with WSDL – WSDL defines the
Web service, SOAP transports the data
o RDF
RDF stands for Resource Description Framework
RDF is a framework for describing resources on the Web
o RSS
RSS stands for Really Simple Syndication
RSS allows you to syndicate your site content
RSS defines an easy way to share and view headlines
and content
RSS files can be automatically updated
RSS allows personalized views for different sites
RSS is written in XML
Consuming a RESTful Web Service with Spring for Android
This is a step-through exercise
1. Create new project with blank activity
a. Name project “Rest”
b. Change package name to “org.hello.rest”
c. Select blank activity
d. For remainder of choices select defaults
e. Finish
2. In content_main.xml remove “Hello World” textview
3. In activity_main.xml remove ‘fab’ e-mail icon
4. Add the Internet permission to the manifest file:
5. Replace strings.xml with strings provided by example
6. Replace content_main.xml with content in example’s
fragment_main.xml
7. View activity_main.xml in Design mode; the preview should
look similar to the example’s preview
8. Replace menu_main.xml with contents from example’s
menu/main.xml
9. To the project’s Java package (org.hello.rest) add a new Java
class called “Greeting” and replace its contents with the code
provided for Greeting.java in the example
10.
Open the build.gradle (module app)
a. Copy/paste the packagingOptions from the example’s
build.gradle file exactly as shown
b. Copy/paste only the following lines from the example’s
build.gradle file and them to your project’s
dependencies:
compile ‘org.springframework.android:springandroid-rest-template:1.0.1.RELEASE’
compile ‘com.fasterxml.jackson.core:jacksondatabind:2.3.2’
11.
Open MainActivity.java
a. Remove the FloatingActionButton code
b. Add the onStart() method from the example
c. Replace the onOptionsItemSelected() method with the
same method from the example
d. Add the entire HttpRequestTask nested class
e. Resolve all required imports (click in red text, wait until
blue box appears, click Alt+Enter)
12.
Rebuild the project and run it
13.
User interface adjustments I had to make:
a. The ID label and value disappeared underneath the app
bar, so I added the following layout attribute to the
id_label TextView component in content_main.xml:
android_layout_centerVertical=’true’
b. The beginning of the message from the Web service
(“Hello World”) was being overwritten by the end of the
content_label so I added the following layout attribute
to the id_value component (the content_value
component lines up underneath the id_value
component):
android_layout_marginLeft=”4dp”
14.
If you make the adjustments, rebuild the project and run it
Technologies Used in RESTful Web Service Example
Spring for Android is an extension of the [Java] Spring
Framework that aims to simplify the development of native
Android applications.
o Spring is a lightweight Java application development
framework – Spring handles the infrastructure so that you
can focus on your application, for example, you can make a
Java method execute in a database transaction without
having to deal with [database] transaction APIs
o Spring resources:
http://www.tutorialspoint.com/spring/spring_overview.htm
http://docs.spring.io/springframework/docs/3.0.x/reference/overview.html
The service will respond with a JSON representation of a
greeting: {“id”:1,”content”:”Hello, World!”}
o JSON (JavaScript Object Notation) is a lightweight datainterchange format
o JSON is a syntax for storing and exchanging data
o JSON is an easier-to-use alternative to XML
o Example: http://www.w3schools.com/json/
o See: http://www.json.org/
…
Purchase answer to see full
attachment
You will get a plagiarism-free paper and you can get an originality report upon request.
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more