Android's Development learning

Source: Internet
Author: User

I. Project Module 1. Novice boot use control Viewpager using step 1) Add Viewpager control tips to your layout: Enter Viewpager, Lenovo, copy the full package name Class Name 2 from import, and set up Adapter 2. The last page shows the immediate experience button 1) in the adapter's GetItem method to determine if the last page, set button display 2) in fragment New Method setvisible (), save whether the display, and in the OnCreate () method to set whether the button displays 3. The cache mechanism of the Viewpager is 4 of the number of cached pages in addition to the current page.  Animation Frameanimation frame animation drawableanimationtweenanimation motion tween viewanimation tweenanimation disadvantage: Only changes in the view, the control's properties have not really changed 5. Property animation propertiesanimation compatible with low version (2.x) animation package 6. The principle of Open source project (understanding) 7. Import Open Source Project considerations 1) Select Android->existing 2) Be sure to choose the copy tip: Set the syntax coloring feature two. Main Page 1. Actionbar difference: 1) Beautiful 2) Back button 3) menu visualization appCompatV7: Compatible with version 2.1, you can use Actionbar 2. Step 1 to implement Actionbar using APPCOMATV7) Import AppCompatV7 library D:\Android_Prog\android-sdk_r24.2\extras\android\support\v72) The project references the Android-support-v7-appcompat library, modifies the activity inheritance Actionbaractivity Class 3) to modify the subject, must be set with Theme.appcompat beginning with 4) Actionbar Property tip: Using 24.2 version of Eclipse does not require the first three steps 3. Add a menu item in Actionbar 1) Back button event     new version eclipse:         Low version eclipse:   & NBSP;2) Add menu item     3) menu item Click events      4. Fragment supports nesting, using the Fragment manager      5. Different fragment in activity Show different menu item implementation steps are based on: one activity, with different menu items in two fragment,fragment   three. Slide-off Layout 1.   How to use the Drawerlayout control view   |______viewgroup (base class for all layouts)                 nbsp  |______LinearLayout                   |______relativelayout                    |______FrameLayout                   |______TableLayout                   | ______absolutelayout           |______TextView                   |______EDITTEXT&NBSP                         |______Button                                    |_____ _compoundbutton                          &NBSP ;                 |______checkbox          &nbsp ;                             &nbsp ; |______radiobutton                          & nbsp                 |______togglebutton                                          &N BSP; |______SWItch   |______ImageView                   |______imagebutton& nbsp              |______Progressbar              &N Bsp    |______Seekbar                   |______Ratingbar  &N Bsp       Open Source project: http://www.github.com/Domestic http://www.oschina.net/   FAQ 1.  Cause: Project configuration Problem Resolution:  2. Version 24.2 of Eclipse issue  3. Associated SUPPORTV4 source code source code path: D:\Android_Prog\android-sdk_r24.2\extras\android\support\v4\src Association method  : Create a new file in the Libs directory, Name is: android-support-v4.jar.propertiesOpen the file and edit the contents as:Src= source code path Close Project, then open, 4. Call requires API level one (current min is 8): Android.app.activity#getactionbar 5. 06-03 06:46:13.392:e/androidruntime (7962): java.lang.RuntimeException:Unable to start activity componentinfo{ Com.example.ex_templete/com.example.ex_templete. Mainactivity}: Java.lang.IllegalStateException:You need to use a theme.appcompat Theme (or descendant) with this activity . 6. Tool Environment
1) do not include Chinese and white space in the path 2) Two versions cannot use 7 at the same time. The method Add (int, Fragment) in the type fragmenttransaction are not applicable for the arguments (int, blankfragment) one. Project question 1. Upgrade the configuration of the development environment
2. New Project Compilation Error avoidance method: First create a minimum version is 4.0 of the project, and then create the minimum version is 2.2 of the project 3. Garbled problem char code: 25991 = Common encoding format: UTF-8GBK Simplified Chinese gb2312gb18030big5 traditional ISO 8859-1 FAQ scenario: Client-to-server encoding different How to solve: preferably unified for Utf-8 4. Import SUPPORTV7 Library 1) Issue: The compilation version default is not 5.x, FIX: Modify the compiled version to 5.1.1, then Clean2) Error:error Retrieving parent for item:no Resource found that Ma Tches the given name ' Widget.AppCompat. Actionbutton '. 3) CardView 5. SupportV7 Source Code D:\Android_Prog\android-sdk_r24.2\extras\android\m2repository\com\android\support\appcompat-v7\ 22.1.1 6. When a project references a library, it prompts the compilation for an error: The project and library contain different versions of the same jar package, resolving: Change two jar packages to consistent or delete jar package 7 in the project.  Determine if one of the fragment in the Viewpager is visible two. Project Framework construction 1. Side-by-side layout drawerlayout control use reference SupportV7Actionbarwithdrawerlayout, copy Layout 2. Integrated home page Structure 1) Implement ListView layout, row Layout reference App2) ListView Row Click event, implement replace Fragment3 on main page) replace fragment and close Drawerlayout 3. Materialmenu reference Supportv7demo ACTIONBARWITHDRAWERLAYOUT.JAVA1) copy code and Layout 2) modify the home page content to FRAMELAYOUT3) Menu ListView Click event Modified to replace homepage fragment three. Technical Framework 1. Volley features: Asynchronous http Download tips 1) Judging current system version 2) Eclipse Local History FAQ: 1. If not necessary, do not use member variables necessary: One method needs to access a local variable in another method, such as non-mandatory, do not use static variable 2. [2015-06-04 14:34:45-dex Loader] Unable to execute Dex:multiple Dex files define Landroid/support/v7/appcompat/r$anim; [2015-06-04 14:34:45-DEMO_MM_ABC]  Conversion to Dalvik format failed:unable to execute dex:multiple Dex files define Landroid/support/v7/appcompat/r$anim; 3. The project is changed to library, and the constant quantity in R is variableI. Technical Framework1. HTTP, async,create a JSON-corresponding class,Parse JSON,asynchronously download pictures, memory caches, external memory caches 2. Volley-dependent technical points: applicationeffect: 1) Global object (similar to single instance)2) executed prior to activity initializationApplication Scenario: Initialization of the library volley = asynctask + URL 3. VolleyFeatures: Asynchronous HTTP Download 4. Volley Use steps:1) Add Internet permissions to the list2) rely on Lib_volley library3) Copy the App_volleyexamples class from the demo and register it in the listcopy Myvolley and Bitmaplrucache at the same time    4) Copy from the Act_simplerequest class of the demo    5) Copy Method      5. Solve garbled characters 6. Parsing JSON1) Create JSON character filenote file to be modified to Utf-8 no BOM format2) Java class that automatically generates encapsulated data based on JSON filesJsonschema2pojo-0.4.8.zipOperation steps:2.1 Unzip to D packing directory2.2 cd/d D:\jsonschema2pojo-0.4.8 into this catalogue2.3 jsonschema2pojo-t json-a NONE--omit-tostring--omit-hashcode-and-equals--target java-gen--annotation-style G SON--sourcejson.txt Note: Replace json.txt with your JSON file name and delete the following two line syntax error statements and add the package3) Copy the Gson.jar file to the project's Libs directory, file location     4) parsing JSON strings using the API of the Gson package 7. Asynchronously download pictures, memory caches, external memory cachesAsynctask + IO + HashMapquestion: 1) Performance2) Strategy LruCachebackground: Android App 16MB 24MB 32MB 48MBHttps://github.com/nostra13/Android-Universal-Image-Loaderprinciple Flowchartbackground: Strict mode StrictmodeTypical: Executing an HTTP operation on the main thread will FC2.3 New, default off, 4.0 on by default 8. Steps to use the UIL library:refer to the Imagelistactivity.java in demo1) Add Internet permissions to the list2) Copy Lib_uil.jar to libs directory in the project3) Copy the Uilapplication from the demo to the project and configure it in the listproblem: Compile error, remove the following code    4) Copy    5) Copy the creation code of the options object         FAQ: 2. The method init (Context) from the type Myvolley are not visible  3. Using UIL

Android's Development learning

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.