Android List App
Install Android Studio and use it to create an Android app that allows a user to create and view a list of
strings. Then submit at Blackboard a .zip file of the folder containing your Android project (see Create
Android Project screen shot further below for how to find the correct folder). The one who submits the
app for your team should tell me in your submission who your teammate is.
Detailed Requirements
When you create the Android project for your app (see figure below), as the beginning three
segments of the Package name use your edu.duq followed by your Multipass username. For
instance, the beginning of my Package name is edu.duq.jacksonj. The last segment of the
Package name will be generated automatically from the project Name. Also, note the Save
location for your project, which you can change if you like. This is the folder you will need to zip
and submit.
The app must consist of two activities, one for entering strings one at a time, the other for
viewing the list of strings.
o The activity for entering strings is the one that should be displayed when the app begins
execution.
The activity for entering must have one text box and two buttons, one clicked to add the text
box contents to the list being created, the other clicked to view the list.
o The text box and first button (the button for adding to the list) should be laid out as in
the Android Build your first app tutorial.
The margins should be 16dp
The text box should stretch horizontally to fit the available space.
The baselines of the button and text box should be constrained to align.
o Use the strings.xml file to set the hint for the text box and the text for the buttons, and
give an appropriate string for each.
o When the first button is clicked, the string from the text box should be saved for later
display and the text box should be cleared.
o The second button (the button for displaying the list) should be 16dp below the first
button and should be centered horizontally.
The activity for displaying the list should:
o display a list with three newlines (\n) between strings (as in the Udacity example)
o allow the user to scroll through the list
o include an "up" (back) button allowing the user to return to the first activity where they
can create another list.
Use an appropriate string, based on the domain you specify when you create the app, when
calling the putExtra() method on an Intent object.
Hints/Suggestions
This assignment is more-or-less a merge of the projects that you will build if you work through
the Android Build your first app tutorial and Udacity Developing Android Apps Lesson 1 (Create
Project Sunshine). I recommend that you begin by working through both the tutorial and lesson.
o For the Android tutorial "Build a simple user interface" section "Make the text box size
flexible"
Item 2: You can see all the attributes for a view by clicking . Then select
Layout_Margin and assign 16 to right.
Item 3: Return to viewing fewer attributes. Use the layout_width dropdown to
select match_constraint.
o For the Udacity course, you can skip lesson 18, since newer versions of Android Studio
use ConstraintLayout in an empty activity by default.
The Android EditText class has a setText() method that sets a text box to the value of the
string argument passed to setText(). I used this method to clear the text box (set it to the
empty string).
The Android Intent class has a getStringArrayExtra() method that returns an "extra"
value that is of type String[]. I used this method as part of passing the list of strings entered
in the main activity to the activity that displays the list.
If your app crashes, you can click at the bottom of the Android Studio window in
order to see exceptions thrown by your app (this works with the emulator; I haven't tested it
with an Android device). Click to return to the default pane that shows the progress of
the compiler.
Grading
No points for an app that does not start up.
2 pts: Following directions (e.g., submit .zip, zip the correct folder, use specified domain name)
First (add-to-list) activity: 13 pts broken down as follows
o 2 pts: Layout as specified
o 2 pts: Correct use of strings.xml
o 2 pts: Buttons connected to methods
o 3 pts: Functionality of button for adding a string to the list
o 3 pts: Functionality of button for displaying the list (starting the second activity)
o 1 pt: Appropriate putExtra() string
Second (display-list) activity: 5 pts broken down as follows
o 3 pts: Display list with newline characters between strings
o 1 pt: Allow scrolling
o 1 pt: Provide up (back) button to return to first activity
版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。