(Part 1)
Douglas C. Schmidt
d.schmidt@vanderbilt.edu
www.dre.vanderbilt.edu/~schmidt
2
Learning Objectives in this Part of the Lesson
1. Recognize key elements in
the ImageDownloader app’s
design
2. Know how to run the app
& interpret its UI & output
Activity
1
Activity
2
Activity
3
3
Learning Objectives in this Part of the Lesson
1. Recognize key elements in
the ImageDownloader app’s
design
2. Know how to run the app
& interpret its UI & output
5
Key Design Elements in the ImageDownloader App
• The ImageDownloader app
uses three activities
Activity
1
Activity
2
Activity
3
See gitlab.com/vandy-aad-2/ImageDownloader
6
Key Design Elements in the ImageDownloader App
• The ImageDownloader app
uses three activities
1. Prompts user for a URL
Activity
1
Activity
2
Activity
3
7
Key Design Elements in the ImageDownloader App
• The ImageDownloader app
uses three activities
1. Prompts user for a URL
2. Downloads & stores
the image
Activity
1
Activity
2
Activity
3
8
Key Design Elements in the ImageDownloader App
• The ImageDownloader app
uses three activities
1. Prompts user for a URL
2. Downloads & stores
the image
3. Displays the image
Activity
1
Activity
2
Activity
3
9
Key Design Elements in the ImageDownloader App
• The ImageDownloader app
uses three activities
1. Prompts user for a URL
2. Downloads & stores
the image
3. Displays the image
Activity
1
App
Activity A
2
These activities are
both defined in the Activity App
ImageDownloader app 3 B
10
Key Design Elements in the ImageDownloader App
• The ImageDownloader app
uses three activities
1. Prompts user for a URL
2. Downloads & stores
the image
3. Displays the image
Activity
1
App
Activity A
2
Activity App
3 B
This activity is defined in the Gallery app
See packages/apps/Gallery2/src/com/android/gallery3d/app/Gallery.java
11
Key Design Elements in the ImageDownloader App
• The AndroidManifest.xml file declares two activities
12
Key Design Elements in the ImageDownloader App
• The AndroidManifest.xml file declares two activities
13
Key Design Elements in the ImageDownloader App
• The AndroidManifest.xml file declares two activities
• DownloadImageActivity handles implicit DOWNLOAD_IMAGE intents
14
Key Design Elements in the ImageDownloader App
• The AndroidManifest.xml file declares two activities
• DownloadImageActivity handles implicit DOWNLOAD_IMAGE intents
• A FileProvider is used to ensure the downloaded image can be stored
securely in external device storage
See developer.android.com/reference/android/support/v4/content/FileProvider.html
15
Key Design Elements in the ImageDownloader App
• There are four classes related to
activities in ImageDownloader
22
End of Case Study of the
ImageDownloader App
(Part 1)
23