Click on each screenshot:
Fun_Fact
is
treehouse.com
’s
Fun
Facts project.
InteractiveStory
is
treehouse.com
’s
Signals From Mars.
AUG1
is
androidbegin.com
’s
Simple
ListView Tutorial.
Jul25
,
I changed the call to
append
to the following.
The
([.!?])\s*
is a regular expression.
When you write it inside of a
"
double-quoted string"
,
you have to write a
\
before the
\
.
The
[.!?]
is a wildcard that tells the computer to
“look for either a dot,
an exclamation point,
or a question mark”.
The
\s
is wildcard that tells the computer to
“look for a whitespace character”,
e.g., a blank, tab, or newline.
Instead of
\s
we could have written something like
[ ]
,
but it would be impossible to see which characters were in the brackets.
The
$1
is the
dot, exclamation point, or a question mark
found by the
[.!?]
in the parentheses.
See the Pig Latin
replaceAll
s
in
EditText.
textView.append("\n" + ipsum.replaceAll("([.!?])\\s", "$1\n\n"));
styles.xml
.
Here is the app’s
activity_main.xml
file.
In
MainActivity.java
,
the
showTime
method of class
MainActivity
displays the time when the app was launched.
To display the time when the purple button was pressed,
move lines 15–17 to line 25½.
Do not remove the
import java.util.Date;
.
res
stands for
resources.
Hello/app/src/main/res/layout/activity_main.xml
.
See
Layout
Resource.
Hello/app/src/main/res/values/strings.xml
.
See
String Resources.
Hello/app/src/main/res/values/styles.xml
.
See
Style
Resources.
Hello/app/src/main/res/values/dimens.xml
.
See
Dimension
Resources.
Hello/app/src/main/res/values-w820dp/dimens.xml
.
w
stands for width.
820dp
≅
820/160 inches = 5⅛ inches.
See
Providing
Alternative Resources.
Hello/app/src/main/java/edu/nyu/scps/hello/MainActivity.java
.
See
Activities.
Hello/app/src/main/AndroidManifest.xml
.
See
App
Manifest
and
Declaring
the activity in the manifest.
Hello/app/build.gradle
(Module: app)