Skip to content

Commit 0af839d

Browse files
committed
first commit
1 parent 91193fd commit 0af839d

28 files changed

+3079
-1
lines changed

AndroidManifest.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.yyxu.download"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk android:minSdkVersion="8" />
8+
9+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
10+
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
11+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
12+
<uses-permission android:name="android.permission.INTERNET" />
13+
14+
<application
15+
android:icon="@drawable/ic_launcher"
16+
android:label="@string/app_name" >
17+
<activity android:name=".activities.DownloadListActivity" >
18+
<intent-filter >
19+
<action android:name="android.intent.action.MAIN" />
20+
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
</activity>
24+
<activity android:name=".activities.TrafficStatActivity" >
25+
</activity>
26+
27+
<service android:name=".services.TrafficCounterService" >
28+
</service>
29+
<service android:name=".services.DownloadService" >
30+
<intent-filter >
31+
<action android:name="com.yyxu.download.services.IDownloadService" />
32+
</intent-filter>
33+
</service>
34+
</application>
35+
36+
</manifest>

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
android-download-manager
22
========================
33

4-
A download manager for android with muti-task downloads, resuming downloads, traffic counter and the basic task controls such as pause, continue and delete.
4+
A download manager for android with muti-task downloads, resuming downloads, traffic counter and the basic task controls such as pause, continue and delete.
5+
6+
NOTE:
7+
1. Any questions please contact [email protected] or twitter.com/yingyixu or weibo.com/yingyixu

res/drawable-hdpi/ic_launcher.png

4.05 KB
Loading

res/drawable-ldpi/ic_launcher.png

1.68 KB
Loading

res/drawable-mdpi/ic_launcher.png

2.51 KB
Loading

res/layout/download_list_activity.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="fill_parent"
5+
android:orientation="vertical" >
6+
7+
<ListView
8+
android:id="@+id/download_list"
9+
android:layout_width="fill_parent"
10+
android:layout_height="wrap_content"
11+
android:layout_weight="1"
12+
android:divider="#ffffff"
13+
android:dividerHeight="10dip" >
14+
</ListView>
15+
16+
<LinearLayout
17+
android:layout_width="fill_parent"
18+
android:layout_height="40dip"
19+
android:orientation="horizontal" >
20+
21+
<Button
22+
android:id="@+id/btn_pause_all"
23+
android:layout_width="wrap_content"
24+
android:layout_height="fill_parent"
25+
android:text="Pause All" />
26+
27+
<Button
28+
android:id="@+id/btn_delete_all"
29+
android:layout_width="wrap_content"
30+
android:layout_height="fill_parent"
31+
android:text="关闭后台" />
32+
33+
<Button
34+
android:id="@+id/btn_add"
35+
android:layout_width="wrap_content"
36+
android:layout_height="fill_parent"
37+
android:text="Add" />
38+
39+
<Button
40+
android:id="@+id/btn_traffic"
41+
android:layout_width="wrap_content"
42+
android:layout_height="fill_parent"
43+
android:text="流量统计" />
44+
</LinearLayout>
45+
46+
</LinearLayout>

res/layout/download_list_item.xml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="100dip"
5+
android:gravity="center_vertical"
6+
android:orientation="horizontal" >
7+
8+
<LinearLayout
9+
android:layout_width="wrap_content"
10+
android:layout_height="fill_parent"
11+
android:layout_weight="1"
12+
android:orientation="vertical" >
13+
14+
<TextView
15+
android:id="@+id/title"
16+
android:layout_width="wrap_content"
17+
android:layout_height="wrap_content" />
18+
19+
<ProgressBar
20+
android:id="@+id/progress_bar"
21+
style="?android:attr/progressBarStyleHorizontal"
22+
android:layout_width="fill_parent"
23+
android:layout_height="wrap_content"
24+
android:max="100" />
25+
26+
<TextView
27+
android:id="@+id/speed"
28+
android:layout_width="wrap_content"
29+
android:layout_height="wrap_content" />
30+
</LinearLayout>
31+
32+
<LinearLayout
33+
android:layout_width="wrap_content"
34+
android:layout_height="wrap_content"
35+
android:orientation="vertical" >
36+
37+
<Button
38+
android:id="@+id/btn_pause"
39+
android:layout_width="wrap_content"
40+
android:layout_height="40dip"
41+
android:text="Pause" />
42+
43+
<Button
44+
android:id="@+id/btn_continue"
45+
android:layout_width="wrap_content"
46+
android:layout_height="40dip"
47+
android:text="Contin"
48+
android:visibility="gone" />
49+
50+
<Button
51+
android:id="@+id/btn_delete"
52+
android:layout_width="wrap_content"
53+
android:layout_height="40dip"
54+
android:text="Delete" />
55+
</LinearLayout>
56+
57+
</LinearLayout>

res/layout/traffic_stat_activity.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:orientation="vertical">
7+
8+
<TextView android:id="@+id/net_text"
9+
android:layout_width="match_parent"
10+
android:layout_height="wrap_content" />
11+
12+
<LinearLayout
13+
android:layout_width="match_parent"
14+
android:layout_height="wrap_content"
15+
android:orientation="horizontal">
16+
17+
<TextView
18+
android:layout_width="wrap_content"
19+
android:layout_height="wrap_content"
20+
android:text="本应用Wi-Fi流量:" />
21+
22+
<TextView android:id="@+id/app_wifi_text"
23+
android:layout_width="wrap_content"
24+
android:layout_height="wrap_content" />
25+
</LinearLayout>
26+
27+
<LinearLayout
28+
android:layout_width="match_parent"
29+
android:layout_height="wrap_content"
30+
android:orientation="horizontal">
31+
32+
<TextView
33+
android:layout_width="wrap_content"
34+
android:layout_height="wrap_content"
35+
android:text="本应用2G/3G流量:" />
36+
37+
<TextView android:id="@+id/app_gprs_text"
38+
android:layout_width="wrap_content"
39+
android:layout_height="wrap_content" />
40+
</LinearLayout>
41+
42+
<Button android:id="@+id/btn_clear"
43+
android:layout_width="match_parent"
44+
android:layout_height="wrap_content"
45+
android:text="清空" />
46+
47+
<TextView android:id="@+id/test_text"
48+
android:layout_width="match_parent"
49+
android:layout_height="wrap_content" />
50+
51+
</LinearLayout>

res/values/strings.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<string name="hello">Hello World, DownloadManager!</string>
5+
<string name="app_name">DownloadManager</string>
6+
7+
</resources>

0 commit comments

Comments
 (0)