=================================
=================================
=================================
출처: http://developer.android.com/reference/android/app/DownloadManager.html
DownloadManager
extends Objectjava.lang.Object | |
↳ | android.app.DownloadManager |
Class Overview
The download manager is a system service that handles long-running HTTP downloads. Clients may request that a URI be downloaded to a particular destination file. The download manager will conduct the download in the background, taking care of HTTP interactions and retrying downloads after failures or across connectivity changes and system reboots. Instances of this class should be obtained through getSystemService(String)
by passing DOWNLOAD_SERVICE
. Apps that request downloads through this API should register a broadcast receiver for ACTION_NOTIFICATION_CLICKED
to appropriately handle when the user clicks on a running download in a notification or from the downloads UI. Note that the application must have the INTERNET
permission to use this class.
Summary
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | DownloadManager.Query | This class may be used to filter download manager queries. | |||||||||
class | DownloadManager.Request | This class contains all the information necessary to request a new download. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACTION_DOWNLOAD_COMPLETE | Broadcast intent action sent by the download manager when a download completes. | |||||||||
String | ACTION_NOTIFICATION_CLICKED | Broadcast intent action sent by the download manager when the user clicks on a running download, either from a system notification or from the downloads UI. | |||||||||
String | ACTION_VIEW_DOWNLOADS | Intent action to launch an activity to display all downloads. | |||||||||
String | COLUMN_BYTES_DOWNLOADED_SO_FAR | Number of bytes download so far. | |||||||||
String | COLUMN_DESCRIPTION | The client-supplied description of this download. | |||||||||
String | COLUMN_ID | An identifier for a particular download, unique across the system. | |||||||||
String | COLUMN_LAST_MODIFIED_TIMESTAMP | Timestamp when the download was last modified, in System.currentTimeMillis() (wall clock time in UTC). |
|||||||||
String | COLUMN_LOCAL_FILENAME | The pathname of the file where the download is stored. | |||||||||
String | COLUMN_LOCAL_URI | Uri where downloaded file will be stored. | |||||||||
String | COLUMN_MEDIAPROVIDER_URI | The URI to the corresponding entry in MediaProvider for this downloaded entry. | |||||||||
String | COLUMN_MEDIA_TYPE | Internet Media Type of the downloaded file. | |||||||||
String | COLUMN_REASON | Provides more detail on the status of the download. | |||||||||
String | COLUMN_STATUS | Current status of the download, as one of the STATUS_* constants. | |||||||||
String | COLUMN_TITLE | The client-supplied title for this download. | |||||||||
String | COLUMN_TOTAL_SIZE_BYTES | Total size of the download in bytes. | |||||||||
String | COLUMN_URI | URI to be downloaded. | |||||||||
int | ERROR_CANNOT_RESUME | Value of COLUMN_REASON when some possibly transient error occurred but we can't resume the download. |
|||||||||
int | ERROR_DEVICE_NOT_FOUND | Value of COLUMN_REASON when no external storage device was found. |
|||||||||
int | ERROR_FILE_ALREADY_EXISTS | Value of COLUMN_REASON when the requested destination file already exists (the download manager will not overwrite an existing file). |
|||||||||
int | ERROR_FILE_ERROR | Value of COLUMN_REASON when a storage issue arises which doesn't fit under any other error code. |
|||||||||
int | ERROR_HTTP_DATA_ERROR | Value of COLUMN_REASON when an error receiving or processing data occurred at the HTTP level. |
|||||||||
int | ERROR_INSUFFICIENT_SPACE | Value of COLUMN_REASON when there was insufficient storage space. |
|||||||||
int | ERROR_TOO_MANY_REDIRECTS | Value of COLUMN_REASON when there were too many redirects. |
|||||||||
int | ERROR_UNHANDLED_HTTP_CODE | Value of COLUMN_REASON when an HTTP code was received that download manager can't handle. |
|||||||||
int | ERROR_UNKNOWN | Value of COLUMN_ERROR_CODE when the download has completed with an error that doesn't fit under any other error code. | |||||||||
String | EXTRA_DOWNLOAD_ID | Intent extra included with ACTION_DOWNLOAD_COMPLETE intents, indicating the ID (as a long) of the download that just completed. |
|||||||||
String | EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS | When clicks on multiple notifications are received, the following provides an array of download ids corresponding to the download notification that was clicked. | |||||||||
String | INTENT_EXTRAS_SORT_BY_SIZE | Intent extra included with ACTION_VIEW_DOWNLOADS to start DownloadApp in sort-by-size mode. |
|||||||||
int | PAUSED_QUEUED_FOR_WIFI | Value of COLUMN_REASON when the download exceeds a size limit for downloads over the mobile network and the download manager is waiting for a Wi-Fi connection to proceed. |
|||||||||
int | PAUSED_UNKNOWN | Value of COLUMN_REASON when the download is paused for some other reason. |
|||||||||
int | PAUSED_WAITING_FOR_NETWORK | Value of COLUMN_REASON when the download is waiting for network connectivity to proceed. |
|||||||||
int | PAUSED_WAITING_TO_RETRY | Value of COLUMN_REASON when the download is paused because some network error occurred and the download manager is waiting before retrying the request. |
|||||||||
int | STATUS_FAILED | Value of COLUMN_STATUS when the download has failed (and will not be retried). |
|||||||||
int | STATUS_PAUSED | Value of COLUMN_STATUS when the download is waiting to retry or resume. |
|||||||||
int | STATUS_PENDING | Value of COLUMN_STATUS when the download is waiting to start. |
|||||||||
int | STATUS_RUNNING | Value of COLUMN_STATUS when the download is currently running. |
|||||||||
int | STATUS_SUCCESSFUL | Value of COLUMN_STATUS when the download has successfully completed. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
long | addCompletedDownload(String title, String description, boolean isMediaScannerScannable, String mimeType, String path, long length, boolean showNotification)
Adds a file to the downloads database system, so it could appear in Downloads App (and thus become eligible for management by the Downloads App).
|
||||||||||
long | enqueue(DownloadManager.Request request)
Enqueue a new download.
|
||||||||||
static Long | getMaxBytesOverMobile(Context context)
Returns maximum size, in bytes, of downloads that may go over a mobile connection; or null if there's no limit
|
||||||||||
String | getMimeTypeForDownloadedFile(long id)
Returns the media type of the given downloaded file id, if the file was downloaded successfully.
|
||||||||||
static Long | getRecommendedMaxBytesOverMobile(Context context)
Returns recommended maximum size, in bytes, of downloads that may go over a mobile connection; or null if there's no recommended limit.
|
||||||||||
Uri | getUriForDownloadedFile(long id)
Returns the
Uri of the given downloaded file id, if the file is downloaded successfully. |
||||||||||
ParcelFileDescriptor | openDownloadedFile(long id)
Open a downloaded file for reading.
|
||||||||||
Cursor | query(DownloadManager.Query query)
Query the download manager about downloads that have been requested.
|
||||||||||
int | remove(long... ids)
Cancel downloads and remove them from the download manager.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Constants
public static final String ACTION_DOWNLOAD_COMPLETE
Broadcast intent action sent by the download manager when a download completes.
public static final String ACTION_NOTIFICATION_CLICKED
Broadcast intent action sent by the download manager when the user clicks on a running download, either from a system notification or from the downloads UI.
public static final String ACTION_VIEW_DOWNLOADS
Intent action to launch an activity to display all downloads.
public static final String COLUMN_BYTES_DOWNLOADED_SO_FAR
Number of bytes download so far.
public static final String COLUMN_DESCRIPTION
The client-supplied description of this download. This will be displayed in system notifications. Defaults to the empty string.
public static final String COLUMN_ID
An identifier for a particular download, unique across the system. Clients use this ID to make subsequent calls related to the download.
public static final String COLUMN_LAST_MODIFIED_TIMESTAMP
Timestamp when the download was last modified, in System.currentTimeMillis()
(wall clock time in UTC).
public static final String COLUMN_LOCAL_FILENAME
The pathname of the file where the download is stored.
public static final String COLUMN_LOCAL_URI
Uri where downloaded file will be stored. If a destination is supplied by client, that URI will be used here. Otherwise, the value will initially be null and will be filled in with a generated URI once the download has started.
public static final String COLUMN_MEDIAPROVIDER_URI
The URI to the corresponding entry in MediaProvider for this downloaded entry. It is used to delete the entries from MediaProvider database when it is deleted from the downloaded list.
public static final String COLUMN_MEDIA_TYPE
Internet Media Type of the downloaded file. If no value is provided upon creation, this will initially be null and will be filled in based on the server's response once the download has started.
See Also
public static final String COLUMN_REASON
Provides more detail on the status of the download. Its meaning depends on the value of COLUMN_STATUS
. When COLUMN_STATUS
is STATUS_FAILED
, this indicates the type of error that occurred. If an HTTP error occurred, this will hold the HTTP status code as defined in RFC 2616. Otherwise, it will hold one of the ERROR_* constants. When COLUMN_STATUS
is STATUS_PAUSED
, this indicates why the download is paused. It will hold one of the PAUSED_* constants. If COLUMN_STATUS
is neither STATUS_FAILED
nor STATUS_PAUSED
, this column's value is undefined.
See Also
public static final String COLUMN_STATUS
Current status of the download, as one of the STATUS_* constants.
public static final String COLUMN_TITLE
The client-supplied title for this download. This will be displayed in system notifications. Defaults to the empty string.
public static final String COLUMN_TOTAL_SIZE_BYTES
Total size of the download in bytes. This will initially be -1 and will be filled in once the download starts.
public static final String COLUMN_URI
URI to be downloaded.
public static final int ERROR_CANNOT_RESUME
Value of COLUMN_REASON
when some possibly transient error occurred but we can't resume the download.
public static final int ERROR_DEVICE_NOT_FOUND
Value of COLUMN_REASON
when no external storage device was found. Typically, this is because the SD card is not mounted.
public static final int ERROR_FILE_ALREADY_EXISTS
Value of COLUMN_REASON
when the requested destination file already exists (the download manager will not overwrite an existing file).
public static final int ERROR_FILE_ERROR
Value of COLUMN_REASON
when a storage issue arises which doesn't fit under any other error code. Use the more specific ERROR_INSUFFICIENT_SPACE
and ERROR_DEVICE_NOT_FOUND
when appropriate.
public static final int ERROR_HTTP_DATA_ERROR
Value of COLUMN_REASON
when an error receiving or processing data occurred at the HTTP level.
public static final int ERROR_INSUFFICIENT_SPACE
Value of COLUMN_REASON
when there was insufficient storage space. Typically, this is because the SD card is full.
public static final int ERROR_TOO_MANY_REDIRECTS
Value of COLUMN_REASON
when there were too many redirects.
public static final int ERROR_UNHANDLED_HTTP_CODE
Value of COLUMN_REASON
when an HTTP code was received that download manager can't handle.
public static final int ERROR_UNKNOWN
Value of COLUMN_ERROR_CODE when the download has completed with an error that doesn't fit under any other error code.
public static final String EXTRA_DOWNLOAD_ID
Intent extra included with ACTION_DOWNLOAD_COMPLETE
intents, indicating the ID (as a long) of the download that just completed.
public static final String EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS
When clicks on multiple notifications are received, the following provides an array of download ids corresponding to the download notification that was clicked. It can be retrieved by the receiver of this Intent using getLongArrayExtra(String)
.
public static final String INTENT_EXTRAS_SORT_BY_SIZE
Intent extra included with ACTION_VIEW_DOWNLOADS
to start DownloadApp in sort-by-size mode.
public static final int PAUSED_QUEUED_FOR_WIFI
Value of COLUMN_REASON
when the download exceeds a size limit for downloads over the mobile network and the download manager is waiting for a Wi-Fi connection to proceed.
public static final int PAUSED_UNKNOWN
Value of COLUMN_REASON
when the download is paused for some other reason.
public static final int PAUSED_WAITING_FOR_NETWORK
Value of COLUMN_REASON
when the download is waiting for network connectivity to proceed.
public static final int PAUSED_WAITING_TO_RETRY
Value of COLUMN_REASON
when the download is paused because some network error occurred and the download manager is waiting before retrying the request.
public static final int STATUS_FAILED
Value of COLUMN_STATUS
when the download has failed (and will not be retried).
public static final int STATUS_PAUSED
Value of COLUMN_STATUS
when the download is waiting to retry or resume.
public static final int STATUS_PENDING
Value of COLUMN_STATUS
when the download is waiting to start.
public static final int STATUS_RUNNING
Value of COLUMN_STATUS
when the download is currently running.
public static final int STATUS_SUCCESSFUL
Value of COLUMN_STATUS
when the download has successfully completed.
Public Methods
public long addCompletedDownload (String title, String description, boolean isMediaScannerScannable, String mimeType, String path, long length, boolean showNotification)
Adds a file to the downloads database system, so it could appear in Downloads App (and thus become eligible for management by the Downloads App).
It is helpful to make the file scannable by MediaScanner by setting the param isMediaScannerScannable to true. It makes the file visible in media managing applications such as Gallery App, which could be a useful purpose of using this API.
Parameters
title | the title that would appear for this file in Downloads App. |
---|---|
description | the description that would appear for this file in Downloads App. |
isMediaScannerScannable | true if the file is to be scanned by MediaScanner. Files scanned by MediaScanner appear in the applications used to view media (for example, Gallery app). |
mimeType | mimetype of the file. |
path | absolute pathname to the file. The file should be world-readable, so that it can be managed by the Downloads App and any other app that is used to read it (for example, Gallery app to display the file, if the file contents represent a video/image). |
length | length of the downloaded file |
showNotification | true if a notification is to be sent, false otherwise |
Returns
- an ID for the download entry added to the downloads app, unique across the system This ID is used to make future calls related to this download.
public long enqueue (DownloadManager.Request request)
Enqueue a new download. The download will start automatically once the download manager is ready to execute it and connectivity is available.
Parameters
request | the parameters specifying this download |
---|
Returns
- an ID for the download, unique across the system. This ID is used to make future calls related to this download.
public static Long getMaxBytesOverMobile (Context context)
Returns maximum size, in bytes, of downloads that may go over a mobile connection; or null if there's no limit
Parameters
context | the Context to use for accessing the ContentResolver |
---|
Returns
- maximum size, in bytes, of downloads that may go over a mobile connection; or null if there's no limit
public String getMimeTypeForDownloadedFile (long id)
Returns the media type of the given downloaded file id, if the file was downloaded successfully. Otherwise, null is returned.
Parameters
id | the id of the downloaded file. |
---|
Returns
- the media type of the given downloaded file id, if download was successful. null otherwise.
public static Long getRecommendedMaxBytesOverMobile (Context context)
Returns recommended maximum size, in bytes, of downloads that may go over a mobile connection; or null if there's no recommended limit. The user will have the option to bypass this limit.
Parameters
context | the Context to use for accessing the ContentResolver |
---|
Returns
- recommended maximum size, in bytes, of downloads that may go over a mobile connection; or null if there's no recommended limit.
public Uri getUriForDownloadedFile (long id)
Returns the Uri
of the given downloaded file id, if the file is downloaded successfully. Otherwise, null is returned.
If the specified downloaded file is in external storage (for example, /sdcard dir), then it is assumed to be safe for anyone to read and the returned Uri
corresponds to the filepath on sdcard.
Parameters
id | the id of the downloaded file. |
---|
Returns
- the
Uri
of the given downloaded file id, if download was successful. null otherwise.
public ParcelFileDescriptor openDownloadedFile (long id)
Open a downloaded file for reading. The download must have completed.
Parameters
id | the ID of the download |
---|
Returns
- a read-only
ParcelFileDescriptor
Throws
FileNotFoundException | if the destination file does not already exist |
---|
public Cursor query (DownloadManager.Query query)
Query the download manager about downloads that have been requested.
Parameters
query | parameters specifying filters for this query |
---|
Returns
- a Cursor over the result set of downloads, with columns consisting of all the COLUMN_* constants.
public int remove (long... ids)
Cancel downloads and remove them from the download manager. Each download will be stopped if it was running, and it will no longer be accessible through the download manager. If there is a downloaded file, partial or complete, it is deleted.
Parameters
ids | the IDs of the downloads to remove |
---|
Returns
- the number of downloads actually removed
=================================
=================================
=================================
출처: http://androidhuman.tistory.com/entry/%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C%EB%8A%94-%EB%82%B4%EA%B2%8C-DownloadManager-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0
많은 용량의 데이터를 필요로 하는 애플리케이션 혹은 주기적으로 데이터를 업데이트 할 필요가 있는 애플리케이션들은 인터넷에서 데이터를 직접 다운로드하는 기능을 포함해야 합니다. 하지만, 데이터를 다운로드 하는 기능을 구현하는 것이 그렇게 만만한 작업은 아니였습니다.
- DownloadManager : 다운로드 시작/취소, 다운로드 파일 열기, 다운로드한 항목 조회 메서드 제공
- DownloadManager.Request : 다운로드 시작에 필요한 정보 포함
- DownloadManager.Query : 다운로드 항목 조회에 필요한 정보 포함
API
public long enqueue (DownloadManager.Request request)
새로운 다운로드 작업을 요청합니다. 요청한 작업은 다운로드 대기열에 추가됩니다. 다운로드 대기열에 추가된 작업의 ID를 반환합니다.
public int remove (long... ids)
요청한 다운로드 작업을 취소합니다.
public Cursor query (DownloadManager.Query query)
DownloadManager를 통해 다운로드한 항목들 중 조건에 일치하는 항목을 검색합니다. 결과는 Cursor 형태로 반환됩니다. 결과 레코드의 값을 참조하기 위한 필드 값은 DownloadManager.COLUMN_으로 시작하는 상수들(예:DownloadManager.COLUMN_TITLE)을 사용하여 얻을 수 있습니다.
public ParcelFileDescriptor openDownloadedFile (long id)
파일 처리를 위해 다운로드한 파일을 엽니다. 인자로 다운로드 항목의 고유ID를 넘겨줍니다.
API
public DownloadManager.Request (Uri uri)
DownloadManager.Request의 생성자입니다. 인자로 다운로드할 파일의 URI를 지정합니다. HTTP 형식만 지원합니다.
public DownloadManager.Request setAllowedNetworkTypes (int flags)
다운로드 진행시 사용 가능한 네트워크 종류를 설정합니다. 모바일 네트워크(3G)와 Wi-Fi 중 하나를 선택할 수 있습니다. 대용량 파일 다운로드시 실수로 3G 네트워크를 사용하여 데이터를 다운로드하여 많은 요금이 부과되는 것을 방지하기 위한 목적으로 사용할 수 있습니다. 사용 가능한 네트워크를 명시적으로 지정하지 않으면 모든 네트워크에서 다운로드를 수행할 수 있습니다.
public DownloadManager.Request setTitle (CharSequence title)
다운로드 항목에 표시될 제목을 지정합니다.
public DownloadManager.Request setDescription (CharSequence description)
다운로드 항목에 표시될 세부 설명을 지정합니다.
public DownloadManager.Request setDestinationUri (Uri uri)
다운로드할 파일이 저장될 경로를 지정합니다. 외부 미디어(예:SD카드)의 경로여야 하며, 외부 미디어에 데이터를 쓰기 위해 WRITE_EXTERNAL_STORAGE 권한을 지정해야 합니다.
API
public DownloadManager.Query ()
모든 다운로드 항목을 조회하는 객체를 생성합니다.
public DownloadManager.Query setFilterById (long... ids)
지정된 id에 해당하는 다운로드 항목만을 조회하기 위한 필터를 설정합니다.
public DownloadManager.Query setFilterByStatus (int flags)
특정 다운로드 상태의 다운로드 항목을 조회하기 위한 필터를 설정합니다.
[어플리케이션 정보]
액티비티
- Main (Main.java)
레이아웃
- main.xml
권한 (uses-permission)
- android.permission.INTERNET
- android.permission.WRITE_EXTERNAL_STORAGE
API Level
- 9 (Android 2.3)
01.
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
02.
<
LinearLayout
03.
xmlns:android
=
"http://schemas.android.com/apk/res/android"
04.
android:orientation
=
"vertical"
05.
android:layout_width
=
"fill_parent"
06.
android:layout_height
=
"fill_parent"
>
07.
08.
<
EditText
09.
android:layout_height
=
"wrap_content"
10.
android:layout_width
=
"fill_parent"
11.
android:hint
=
"Enter URL"
12.
android:id
=
"@+id/downloadUrl"
13.
android:inputType
=
"textUri"
/>
14.
<
Button
15.
android:layout_width
=
"wrap_content"
16.
android:layout_height
=
"wrap_content"
17.
android:id
=
"@+id/addQueueButton"
18.
android:text
=
"Add to download queue"
/>
19.
<
Button
20.
android:layout_width
=
"wrap_content"
21.
android:layout_height
=
"wrap_content"
22.
android:text
=
"Cancel latest download"
23.
android:id
=
"@+id/cancelDownloadButton"
/>
24.
<
Button
25.
android:layout_width
=
"wrap_content"
26.
android:layout_height
=
"wrap_content"
27.
android:text
=
"View downloads"
28.
android:id
=
"@+id/viewDownloadsButton"
/>
29.
30.
</
LinearLayout
>
01.
public
class
Main
extends
Activity
implements
OnClickListener{
02.
private
EditText downloadUrl;
03.
private
Button addToQueueButton;
04.
private
Button cancelLatestButton;
05.
private
Button viewDownloadsButton;
06.
07.
private
long
latestId = -
1
;
08.
09.
private
DownloadManager downloadManager;
10.
private
DownloadManager.Request request;
11.
private
Uri urlToDownload;
1.
private
BroadcastReceiver completeReceiver =
new
BroadcastReceiver(){
2.
3.
@Override
4.
public
void
onReceive(Context context, Intent intent) {
5.
Toast.makeText(context,
"다운로드가 완료되었습니다."
,Toast.LENGTH_SHORT).show();
6.
}
7.
8.
};
01.
@Override
02.
public
void
onCreate(Bundle savedInstanceState) {
03.
super
.onCreate(savedInstanceState);
04.
setContentView(R.layout.main);
05.
06.
downloadUrl = (EditText)findViewById(R.id.downloadUrl);
07.
addToQueueButton = (Button)findViewById(R.id.addQueueButton);
08.
cancelLatestButton = (Button)findViewById(R.id.cancelDownloadButton);
09.
viewDownloadsButton = (Button)findViewById(R.id.viewDownloadsButton);
10.
11.
downloadManager = (DownloadManager)getSystemService(Context.DOWNLOAD_SERVICE);
12.
13.
addToQueueButton.setOnClickListener(
this
);
14.
cancelLatestButton.setOnClickListener(
this
);
15.
viewDownloadsButton.setOnClickListener(
this
);
16.
}
1.
@Override
2.
public
void
onResume(){
3.
super
.onResume();
4.
IntentFilter completeFilter =
new
IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE);
5.
registerReceiver(completeReceiver, completeFilter);
6.
}
01.
@Override
02.
public
void
onClick(View v) {
03.
switch
(v.getId()){
04.
case
R.id.addQueueButton:
05.
urlToDownload = Uri.parse(downloadUrl.getText().toString());
06.
List<String> pathSegments = urlToDownload.getPathSegments();
07.
request =
new
DownloadManager.Request(urlToDownload);
08.
request.setTitle(
"다운로드 예제"
);
09.
request.setDescription(
"항목 설명"
);
10.
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, pathSegments.get(pathSegments.size()-
1
));
11.
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).mkdirs();
12.
latestId = downloadManager.enqueue(request);
13.
downloadUrl.setText(
""
);
14.
break
;
15.
16.
case
R.id.cancelDownloadButton:
17.
downloadManager.remove(latestId);
18.
break
;
19.
20.
case
R.id.viewDownloadsButton:
21.
startActivity(
new
Intent(DownloadManager.ACTION_VIEW_DOWNLOADS));
22.
break
;
23.
}
24.
}
1.
@Override
2.
public
void
onPause(){
3.
super
.onPause();
4.
unregisterReceiver(completeReceiver);
5.
}
다운로드할 파일의 경로를 입력합니다.
파일 다운로드가 진행되는 모습
다운로드가 완료 메시지가 표시됩니다.
다운로드한 항목들의 정보를 조회할 수 있습니다.
=================================
=================================
=================================
'스마트기기개발관련 > 안드로이드 개발' 카테고리의 다른 글
[안드로이드/안드로이드 개발]Intent filter 를 이용한 실행가능 app 목록 얻어오기(Intent.createChooser) (0) | 2014.04.24 |
---|---|
android에서 zip 파일 압축 해제(unzip) (4) | 2014.04.18 |
android webview apk download to sdcard from webview webview 를 통해 안드로이드 파일 다운로드, apk 다운로드 설치 관련 (0) | 2014.02.27 |
안드로이드 flash 플래시 플레이어 apk 다운로드 관련 (0) | 2014.02.18 |
안드로이드로 android sound 사운드 가 디바이스에 이상하게 들리거나 짤릴때게 들릴 때 관련 (0) | 2014.01.18 |