Skip to content

Commit

Permalink
Merge pull request #4 from douglascraigschmidt/master
Browse files Browse the repository at this point in the history
Update from original
  • Loading branch information
aorgaz committed May 11, 2015
2 parents df19a36 + 8922ef3 commit 1accdf5
Show file tree
Hide file tree
Showing 49 changed files with 1,904 additions and 1,586 deletions.
2 changes: 1 addition & 1 deletion assignments/assignment1/.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Downloaded Image Viewer (P1 - Assignment 1)</name>
<name>Downloaded Image Viewer (P2 - Assignment 1)</name>
<comment></comment>
<projects>
</projects>
Expand Down
30 changes: 18 additions & 12 deletions assignments/assignment1/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="vandy.mooc"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="21"
<uses-sdk android:minSdkVersion="19"
android:targetSdkVersion="22" />

<uses-permission
Expand All @@ -14,27 +14,33 @@
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<application
android:label="@string/app_name">

<activity android:name=".MainActivity"
<application>
android:label="@strings/app_name">
<activity android:name=".activities.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".DownloadImageActivity"
android:label="@string/download_image_activity">
<activity
android:name=".activities.DisplayImagesActivity"
android:label="@string/app_name"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.WEB_SEARCH" />
<action android:name="android.intent.action.DISPLAY_IMAGES" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="" />
<data android:scheme="file" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>

<service
android:name=".services.DownloadImageService"
android:process=":remote">
</service>

</application>
</manifest>
45 changes: 19 additions & 26 deletions assignments/assignment1/index.html
Original file line number Diff line number Diff line change
@@ -1,62 +1,55 @@
<html>

<title>Downloaded Image Viewer (P1 - Assignment 1)</title>
<title>Downloaded Image Viewer (P2 - Assignment 1)</title>

<body text = "#000000"
link="#000fff"
vlink="#ff0f0f"
bgcolor="#ffffff">

<hr>
<h3>Downloaded Image Viewer (P1 - Assignment 1)</h3>
<h3>Downloaded Image Viewer (P2 - Assignment 1)</h3>

<hr width=50% align=left>
<h4>Overview of the Downloaded Image Viewer Assignment</h4>

<p>

The purpose of this assignment is to give you experience using
Android to develop an app that contains a MainActivity that
prompts the user for a URL to an image and then uses Intents and
the DownloadImageActivity to download the image and view it via
the Gallery app. The DownloadImageActivity should use the Android
"HaMeR" concurrency framework, which is covered in <A
HREF="https://www.youtube.com/watch?v=6cV54pxU6bc&list=PLZ9NgFYEMxp4tbiFYip6tDNIEBRUDyPQK&index=28">this
video</a>. <P>

<p> In addition to the lectures on Android we'll present in
class during Weeks 1 and 2, the following resources may be helpful
in completing portions of this assignment: </p>

<ul>
<li> <A HREF="https://www.youtube.com/watch?v=GtqZrzBuers&list=PLZ9NgFYEMxp4tbiFYip6tDNIEBRUDyPQK&index=7">Introduction to Android Concurrency</A>
<li> <A HREF="https://www.youtube.com/watch?v=x8TTL_u0dNU&list=PLZ9NgFYEMxp4tbiFYip6tDNIEBRUDyPQK&index=9">Motivations for Concurrency</A>
</ul>
Android Services by developing an app containing a main Activity
that prompts the user for URLs of images to download concurrently
via the DownloadImageService and then view via the
DisPlayImagesActivity. The DownloadImageService should use the
Android <A
HREF="http://developer.android.com/reference/android/app/IntentService.html">IntentService</a>
framework, which is covered in <A
HREF="https://www.youtube.com/watch?v=N9tx9sRmn48&list=PLZ9NgFYEMxp4tbiFYip6tDNIEBRUDyPQK&index=39">this
video</a>. Material presented in lectures during Week 1 and 2 of
this class are also relevant to this assignment. </p>

<hr width=50% align=left>
<h4>Skeleton Code</h4>

<p> Skeleton code for this assignment is available <a
href="https://github.com/douglascraigschmidt/POSA-15/tree/master/assignments/assignment1">here</a>.
href="https://github.com/douglascraigschmidt/POSA-15/tree/master/assignments/assignment1"">here</a>.
Pull the appropriate skeleton code in your repository, read it
carefully, and complete the "TODO" markers. </p>

<p> Note that there are no automated unit tests for this
assignment. Instead, you'll know the program is working when you can
successfully download and view an image. Make sure that your
program works properly for both valid and invalid URLs entered by
the user.
successfully download and view an image. However, make sure your
program works for both valid and invalid URL input.

</p>

<hr width=50% align=left>
<h4>Concluding Remarks</h4>
<p>

This assignment is designed to help you get familiar with concurrent
programming Android in Java. Make sure you start early and come to
Virtual Office Hours if you have questions or run into problems.
</p>
This assignment is designed to further your understanding with
programming Android Started Services and the IntentService framework
in Java. Start early and come to Virtual Office Hours if you have
questions or run into problems. </p>

</body>
</html>
5 changes: 5 additions & 0 deletions assignments/assignment1/res/drawable-hdpi/.svn/all-wcprops
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
K 25
svn:wc:ra_dav:version-url
V 104
/aporter/AndroidShortCourse/svn/!svn/ver/46/SourceCodeExamples/MapLocationFromContacts/res/drawable-hdpi
END
28 changes: 28 additions & 0 deletions assignments/assignment1/res/drawable-hdpi/.svn/entries
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
9

dir
133
https://free1.projectlocker.com/aporter/AndroidShortCourse/svn/SourceCodeExamples/MapLocationFromContacts/res/drawable-hdpi
https://free1.projectlocker.com/aporter/AndroidShortCourse/svn



2011-05-26T22:47:42.839519Z
46
[email protected]


svn:special svn:externals svn:needs-lock











e45d3413-d4ad-49ab-8bcb-92a513df27ac

1 change: 1 addition & 0 deletions assignments/assignment1/res/drawable-hdpi/.svn/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
5 changes: 5 additions & 0 deletions assignments/assignment1/res/drawable-ldpi/.svn/all-wcprops
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
K 25
svn:wc:ra_dav:version-url
V 104
/aporter/AndroidShortCourse/svn/!svn/ver/46/SourceCodeExamples/MapLocationFromContacts/res/drawable-ldpi
END
28 changes: 28 additions & 0 deletions assignments/assignment1/res/drawable-ldpi/.svn/entries
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
9

dir
133
https://free1.projectlocker.com/aporter/AndroidShortCourse/svn/SourceCodeExamples/MapLocationFromContacts/res/drawable-ldpi
https://free1.projectlocker.com/aporter/AndroidShortCourse/svn



2011-05-26T22:47:42.839519Z
46
[email protected]


svn:special svn:externals svn:needs-lock











e45d3413-d4ad-49ab-8bcb-92a513df27ac

1 change: 1 addition & 0 deletions assignments/assignment1/res/drawable-ldpi/.svn/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
5 changes: 5 additions & 0 deletions assignments/assignment1/res/drawable-mdpi/.svn/all-wcprops
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
K 25
svn:wc:ra_dav:version-url
V 104
/aporter/AndroidShortCourse/svn/!svn/ver/46/SourceCodeExamples/MapLocationFromContacts/res/drawable-mdpi
END
28 changes: 28 additions & 0 deletions assignments/assignment1/res/drawable-mdpi/.svn/entries
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
9

dir
133
https://free1.projectlocker.com/aporter/AndroidShortCourse/svn/SourceCodeExamples/MapLocationFromContacts/res/drawable-mdpi
https://free1.projectlocker.com/aporter/AndroidShortCourse/svn



2011-05-26T22:47:42.839519Z
46
[email protected]


svn:special svn:externals svn:needs-lock











e45d3413-d4ad-49ab-8bcb-92a513df27ac

1 change: 1 addition & 0 deletions assignments/assignment1/res/drawable-mdpi/.svn/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
31 changes: 31 additions & 0 deletions assignments/assignment1/res/layout/activity_result.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/resultLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<HorizontalScrollView
android:id="@+id/scrollView"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" >

<LinearLayout
android:id="@+id/buttonList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="left" />

</HorizontalScrollView>

<GridView
android:id="@+id/imageGrid"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="8"
android:stretchMode="columnWidth"
android:gravity="center" />

</LinearLayout>
55 changes: 41 additions & 14 deletions assignments/assignment1/res/layout/main_activity.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="match_parent"
android:layout_width="match_parent">

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:text="@string/defaultURL" />
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<EditText
android:id="@+id/url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:inputType="text|textMultiLine|textUri"
android:ems="10"
android:hint="@string/enter_url"
android:ems="10" >
android:inputType="text|textMultiLine|textUri" >
</EditText>

<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="addUrl"
android:text="@string/add_url" />

<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.84"
android:orientation="vertical">
</LinearLayout>

<ProgressBar
android:id="@+id/progressBar_loading"
style="@android:style/Widget.ProgressBar.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/button1"
android:visibility="invisible"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>

<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/url"
android:layout_below="@+id/url"
android:layout_marginTop="18dp"
android:onClick="downloadImage"
android:text="@string/download_image" />
android:onClick="downloadImages"
android:text="@string/download_and_display_image" />

<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="deleteDownloadedImages"
android:text="@string/clear_directory" />

</LinearLayout>
7 changes: 7 additions & 0 deletions assignments/assignment1/res/layout/result_button.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Button xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/resultButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="?android:attr/borderlessButtonStyle" >
</Button>
6 changes: 4 additions & 2 deletions assignments/assignment1/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<resources>
<string name="app_name">DownloadImageViewer</string>
<string name="download_image_activity">DownLoadImageActivity</string>
<string name="download_image">Download Image</string>
<string name="defaultURL">http://www.dre.vanderbilt.edu/~schmidt/robot.png</string>
<string name="download_and_display_image">Download and Display Image(s)</string>
<string name="add_url">Add URL</string>
<string name="enter_url">Enter URL</string>
<string name="clear_directory">Delete Downloaded Image(s)</string>
<string name="defaultURL">http://www.dre.vanderbilt.edu/~schmidt/robot.png;http://www.dre.vanderbilt.edu/~schmidt/ka.png</string>
</resources>
Loading

0 comments on commit 1accdf5

Please sign in to comment.