zoukankan      html  css  js  c++  java
  • 今日小结 4.13

    • RecyclerView
    • 动画
    • CardView
    • AutoLoadRecyclerView_gao_chun例程的组成模块:Fragment,RecyclerView,CardView,动画,ImageLoader 都要学!!
      • ImageLoader     OK
        •   http://blog.csdn.net/vipzjyno1/article/details/23206387
      • RecycleView    OK
        •    http://blog.csdn.net/lmj623565791/article/details/38173061/
      • CardView     
        •   http://developer.android.com/training/material/lists-cards.html
        •   http://blog.csdn.net/xyz_lmn/article/details/35644799
        •   http://developer.android.com/design/material/index.html?q=imageloader#q=imageloader
        •       http://blog.csdn.net/xyz_lmn/article/details/35552103

    1.加载大量的(列表显示的)图片需要考虑多线程,缓存,OOM问题。

    异步加载图片两种方法:

    (1)ImageLoader库,已经考虑了多线程,缓存,内存溢出等

    (2)OKhttp库 异步下载

    2.Uri 和 URL 区别

     Uri = Uniform resource identifier, 统一资源标识符

    URL = Uniform resource locator, 统一资源定位器

    URN = Uniform resource name, 统一资源命名

    Uri 既唯一标识了一个资源 又指明了资源的定位 location

    URL 通过位置来指明资源,只是指明了资源的定位 location (file:// or http://),但并不保证资源的唯一性。(因为同一个文件资源可以同时存在在多个位置)

    URN 通过命名来指明资源,如mailto:java-net@java.sun.com

    也就是说 Uri是一种宏观的资源标识符,URL和URN都是具体的资源标识方式,都是一种Uri 

    3.

    asset 资产  Android中asset目录下存放应用无法直接访问的原生资源,只能通过文件流形式访问

    assert 断言

    4.找个好例程  认真研习

    Android UI-开源框架ImageLoader的完美例子  http://blog.csdn.net/wwj_748/article/details/10079311

     ImageLoaderDemo1_Android UI-开源框架ImageLoader的完美例子.rar

    5.

    启动顺序应该是先Application 再Activity

    onCreate Application

     onCreate Activity

    但是要注意在AndroidManifest中加入Application的名字

    <application
    android:name=".MyApplication"

    6.ImageLoader的开发流程

    ImageLoader常用于大量图片的列表显示(列表,网格,图库)

    (1)先建立一个MyApplication的java文件,在里面完成ImageLoader的初始化

    (2)修改AndroidManifest文件,添加权限 , 添加Application的name

    (3)在主活动中实例化ImageLoader,然后配置图片显示效果DisplayImageOptions

    (4)最后在容器中显示图片 imageLoader.displayImage(imageUrls[0],imageView_clothes,options);

    see:ImageLoaderDemo2_1显示一张SD卡上面的照片.rar

    
    
  • 相关阅读:
    STL源码剖析之_allocate函数
    PAT 1018. Public Bike Management
    PAT 1016. Phone Bills
    PAT 1012. The Best Rank
    PAT 1014. Waiting in Line
    PAT 1026. Table Tennis
    PAT 1017. Queueing at Bank
    STL源码剖析之list的sort函数实现
    吃到鸡蛋好吃,看看是哪只母鸡下的蛋:好用的Sqlite3
    cJSON
  • 原文地址:https://www.cnblogs.com/Chongger/p/5385564.html
Copyright © 2011-2022 走看看