Android Download (download) Project detailed

Source: Internet
Author: User
Tags filter xmlns

Environment: Android 0.5.2 + gradle 1.11 + Kindle Fire

Download, download the project, load resources from the Internet, and save it to the local SD card.

Click on the Download button, download the picture, then display the download content, you can click to view.

Specific design of Download:

1. Modify Activity_main.xml

Location: Res->layout->activity_main.xml

 <relativelayout xmlns:android= "http://schemas.android.com/apk/res/android xmlns:tools=" http:// Schemas.android.com/tools "android:layout_width=" match_parent "android:layout_height=" Match_parent "Android:pa" ddingleft= "@dimen/activity_horizontal_margin" android:paddingright= "@dimen/activity_horizontal_margin" Android: paddingtop= "@dimen/activity_vertical_margin" android:paddingbottom= "@dimen/activity_vertical_margin" tools:
        context= "Mzx.spike.download.app.MainActivity" > <button android:id= "@+id/download_button"  
      
    Android:layout_width= "Match_parent" android:layout_height= "wrap_content" android:text= "Download"/> <textview android:text= "@string/hello_world" android:layout_width= "Wrap_content" an droid:layout_height= "Wrap_content" android:layout_below= "@id/download_button"/> </relativelayout& gt; 

Add a button to make "Hello_world" below it, using the Layout_below property;

2. Modify Androidmanifest.xml

Location: Main->androidmanifest.xml

<?xml version= "1.0" encoding= "Utf-8"?> <manifest xmlns:android= "http://schemas.android.com/apk/res/" Android "package=" Mzx.spike.download.app "> <uses-permission android:name=" Android.permission.INTER NET "/> <uses-permission android:name=" Android.permission.WRITE_EXTERNAL_STORAGE "/> <a Pplication android:allowbackup= "true" android:icon= "@drawable/ic_launcher" android:label= "@string/ App_name "Android:theme=" @style/apptheme "> <activity android:name=" mzx.spike.download . App. 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> </application> < /manifest>

Need the Internet, the right to connect to the Internet; Write_external_storage, writes the memory the permission;

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.