• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >Android > Android V7包学习笔记更新中.....

Android V7包学习笔记更新中.....

作者:网友 字体:[增加 减小] 来源:互联网 时间:2017-05-26

网友通过本文主要向大家介绍了Android V7包学习笔记更新中.....等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

Android V7包学习笔记更新中.....


关于V4 V7 V13

VX包介绍转自这里
1, Android Support V4, V7, V13是什么?
本质上就是三个java library。

2, 为什么要有support库?
如果在低版本Android平台上开发一个应用程序,而应用程序又想使用高版本才拥有的功能,就需要使用Support库。

3, 三个Support 库的区别和作用是什么?
Android Support v4 是最早(2011年4月份)实现的库。用在Android1.6 (API lever 4)或者更高版本之上。它包含了相对V4, V13大的多的功能。
例如:Fragment,NotificationCompat,LoadBroadcastManager,ViewPager,PageTabAtrip,Loader,FileProvider 等。
详细API 参考 http://developer.android.com/reference/android/support/v4/app/package-summary.html
Android Support v7: 这个包是为了考虑Android2.1(API level 7) 及以上版本而设计的,但是v7是要依赖v4这个包的,也就是如果要使用,两个包得同时 被引用。
v7支持了Action Bar。
Android Support v13:这个包的设计是为了android 3.2及更高版本的,一般我们都不常用,平板开发中能用到。


sdk\extras\android\support\samples\Support7Demos笔记

FloatingActionButton

这里写图片描述

代码分析:
Logger包
关于log:需要使用Log输出一些信息。那么我们就需要使用到Log FrameWork。使用及注释如下

  public void initializeLogging() {
        //封装android底层log框架
        LogWrapper logWrapper = new LogWrapper();
        // Using Log, front-end to the logging chain, emulates android.util.log method signatures.
        /**
         * Log的消息传递是依据一个链路依次传递的,Log传递到LogWrapper,LogWrapper传递到MessageOnlyLogFilter,MessageOnlyLogFilter传递到LogFragment
         */

        Log.setLogNode(logWrapper);

        // 过滤器
        MessageOnlyLogFilter msgFilter = new MessageOnlyLogFilter();
        logWrapper.setNext(msgFilter);

        // On screen logging via a fragment with a TextView.
        LogFragment logFragment = (LogFragment) getSupportFragmentManager()
                .findFragmentById(R.id.log_fragment);
        msgFilter.setNext(logFragment.getLogView());
        Log.i(TAG, "Ready");
    }

涉及到的主要的类:


package com.example.android.common.logger;

/**
 * Helper class for a list (or tree) of LoggerNodes.
 *
 * 

When this is set as the head of the list, * an instance of it can function as a drop-in replacement for {@link android.util.Log}. * Most of the methods in this class server only to map a method call in Log to its equivalent * in LogNode.

*/ public class Log { // Grabbing the native values from Android's native logging facilities, // to make for easy migration and interop. public static final int NONE = -1; public static final int VERBOSE = android.util.Log.VERBOSE; public static final int DEBUG = android.util.Log.DEBUG; public static final int INFO = android.util.Log.INFO; public static final int WARN = android.util.Log.WARN; public static final int ERROR = android.util.Log.ERROR; public static final int ASSERT = android.util.Log.ASSERT; // Stores the beginning of the LogNode topology. private static LogNode mLogNode; /** * Returns the next LogNode in the linked list. */ public static LogNode getLogNode() { return mLogNode; } /** * Sets the LogNode data will be sent to. */ public static void setLogNode(LogNode node) { mLogNode = node; } /** * Instructs the LogNode to print the log data provided. Other LogNodes can * be chained to the end of the LogNode as desired. * * @param priority Log level of the data being logged. Verbose, Error, etc. * @param tag Tag for for the log data. Can be used to organize log statements. * @param msg The actual message to be logged. * @param tr If an exception was thrown, this can be sent along for the logging facilities * to extract and print useful information. */ public static void println(int priority, String tag, String msg, Throwable tr) { if (mLogNode != null) { mLogNode.println(priority, tag, msg, tr); } } /** * Instructs the LogNode to print the log data provided. Other LogNodes can * be chained to the end of the LogNode as desired. * * @param priority Log level of the data being logged. Verbose, Error, etc. * @param tag Tag for for the log data. Can be used to organize log statements. * @param msg The actual message to be logged. The actual message to be logged. */ public static void println(int priority, String tag, String msg) { println(priority, tag, msg, null); } /** * Prints a message at VERBOSE priority. * * @param tag Tag for for the log data. Can be used to organize log statements. * @param msg The actual message to be logged. * @param tr If an exception was thrown, this can be sent along for the logging facilities * to extract and print useful information. */ public static void v(String tag, String msg, Throwable tr) { println(VERBOSE, tag, msg, tr); } /** * Prints a message at VERBOSE priority. * * @param tag Tag for for the log data. Can be used to organize log statements. * @param msg The actual message to be logged. */ public static void v(String tag, String msg) { v(tag, msg, null); } /** * Prints a message at DEBUG priority. * * @param tag Tag for for the log data. Can be used to organize log statements. * @param msg The actual message to be logged. * @param tr If an exception was thrown, this can be sent along for the logging facilities * to extract and print useful information. */ public static void d(String tag, String msg, Throwable tr) { println(DEBUG, tag, msg, tr); } /** * Prints a message at DEBUG priority. * * @param tag Tag for for the log data. Can be used to organize log statements. * @param msg The actual message to be logged. */ public static void d(String tag, String msg) { d(tag, msg, null); } /** * Prints a message at INFO priority. * * @param tag Tag for for the log data. Can be used to organize log statements. * @param msg The actual message to be logged. * @param tr If an exception was thrown, this can be sent along for the logging facilities * to extract and print useful information. */ public static void i(String tag, String msg, Throwable tr) { println(INFO, tag, msg, tr); } /** * Prints a message at INFO priority. * * @param tag Tag for for the log data. Can be used to organize log statements. * @param msg The actual message to be logged. */ public static void i(String tag, String msg) { i(tag, msg, null); } /** * Prints a message at WARN priority. * * @param tag Tag for for the log data. Can be used to organize log statements. * @param msg The actual message to be logged. * @param tr If an exception was thrown, this can be sent along for the logging facilities * to extract and print useful information. */ public static void w(String tag, String msg, Throwable tr) { println(WARN, tag, msg, tr); } /** * Prints a message at WARN priority. * * @param tag Tag for for the log data. Can be used to organize log statements. * @param msg The actual message to be logged. */ public static void w(String tag, String msg) { w(tag, msg, null); } /** * Prints a message at WARN priority. *
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

相关文章

  • 2017-05-26Android MediaPlayer 音乐播放
  • 2017-05-26Android 颜色Color,android颜色color
  • 2017-05-26Android蓝牙技术Bluetooth初体验
  • 2017-05-26Android中Activity运行时屏幕方向与显示方式详解,androidactivity
  • 2017-07-22Android 6.0 Phone"通话显示"查询流程
  • 2017-05-26安卓的主要几大布局,安卓布局
  • 2017-05-26Linux内核系列—9.操作系统开发之Loader,linuxloader
  • 2017-05-26Android触摸事件(三)-触摸事件类使用实例
  • 2017-05-26Android,androidstudio
  • 2017-05-26Android Butterknife 8.4.0 使用方法总结,butterknife8.4.0

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • AndroidUSB转串口通信开发基本流程
    • Android简单的ListViewDemo及每个控件的点击事件,listview控件点击事件
    • Android入门(九)文件存储与SharedPreferences存储,
    • 关于视频编辑SDK的接入说明,视频编辑sdk接入
    • Android系统四层架构分享,android四层架构
    • android:Activity数据传递之基本数据类型
    • Android View体系(五)从源码解析View的事件分发机制
    • Android:手把手教你 实现Activity 与 Fragment 相互通信(含Demo)
    • 说说Android6.0动态申请权限的那些坑,android6.0动态权限
    • android studio java.io.IOException:setDataSourse fail.,androidctsfail

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有