Previously summary (previously)
In the first battle, we created the first app project, HelloWorld, and analyzed the project structure and how it works.
Link here: Android Studio single Brush The first line of code series 01--First Battle HelloWorld
Summary (abstract)
Required skills, use the Log tool LogCat, and try to solve the problem of real machine debugging without logs.
Log tool (LogCat)
Logs play a very important role in the development of any project, and in Android projects you have to use the LogCat tool if you want to view the logs.
Find 6:android in the Status Bar at the bottom of Android Studio and click on her. Such as
- Choose Devices here, of course, generally do not need to choose, if only one device connected.
- Here, log level is selected. Includes: Verbose, Debug, Info, Warn, Error, Assert. The above levels are raised sequentially.
- The filter is selected here, and the default is to automatically generate a filter that is the package name is a filter for the project name.
Using LogCat
The Log tool class in Android is log (ANDROID.UTIL.LOG), which provides several ways for us to print the logs.
- LOG.V () corresponds to Verbose
- LOG.D () corresponds to Debug
- LOG.I () corresponding Info
- LOG.W () corresponds to Warn
- LOG.E () corresponds to Error
- LOG.WTF () Prints the execution path (the call stack) at this point in the code at the same time as the output log.
The introduction is over, let's play a little bit. Open helloworldactivity, add a line of print log statements in the Oncreat () method, in order to make the log obvious I added some underscores, as follows:
www.cz001.com.cn/kpzx/ysmz/8274295447.html
www.citygf.com/hyzx/rdtj/8273857210.html
www.cnncw.cn/hyzx/yyzq/8273305418.html
www.cjn.cn/hyzx/jkzd/8274847878.html
www.51etong.com/kpzx/ldyz/7687698930.html
www.cjn.cn/hyzx/jkzd/8272786336.html
www.cnncw.cn/hyzx/yyzq/8273442155.html
www.zhiyin.cn/ylzx/tslf/8273408663.html
www.hebiw.com/zixun/yangsheng/8273621257.html
www.citygf.com/hyzx/jkxz/8273924015.html
www.zhiyin.cn/ylzx/tslf/8273718581.html
www.cnncw.cn/hyzx/yyzq/8273510998.html
www.cjn.cn/hyzx/jkzd/8272967328.html
www.51etong.com/kpzx/ysyz/7687699118.html
www.haianw.com/xgzx/jjyt/8274767318.html
www.cz001.com.cn/kpzx/zszb/8274715732.html
www.cnncw.cn/hyzx/yyzq/8273658892.html
www.cjn.cn/hyzx/jkzd/8273411555.html
www.51etong.com/kpzx/ldyz/7687699228.html
www.haianw.com/xgzx/jfss/8274928068.html
www.baike.com/hyzx/zyys/8287184237.html
www.zhiyin.cn/ylzx/tslf/8274626261.html
www.cnncw.cn/hyzx/yyzq/8273708996.html
www.cjn.cn/hyzx/jkzd/8273603183.html
www.haianw.com/xgzx/jjyt/8275433759.html
www.haianw.com/xgzx/jfss/8272871247.html
www.cjn.cn/hyzx/jkzd/8273921569.html
www.zhiyin.cn/ylzx/tslf/8272699328.html
www.hebiw.com/zixun/yangsheng/8274271153.html
www.citygf.com/hyzx/rdtj/8274427347.html
www.baike.com/hyzx/zyys/8287560598.html
www.zhiyin.cn/ylzx/tslf/8273018324.html
www.cnncw.cn/hyzx/yyzq/8273837343.html
www.cjn.cn/hyzx/jkzd/8274088985.html
www.haianw.com/xgzx/jjyt/8272921932.html
www.cjn.cn/hyzx/jkzd/8275240698.html
www.yltvb.com/xwbk/xunyiwenyao/8272895094.html
www.haianw.com/xgzx/jjyt/8273938243.html
www.zhiyin.cn/ylzx/mryc/8274309377.html
www.lzbs.com.cn/yszx/sjst/8273390557.html
www.zhiyin.cn/ylzx/tslf/8274637127.html
www.yltvb.com/xwbk/redianxinwen/8273148575.html
www.cjn.cn/hyzx/jkzd/8272834008.html
www.haianw.com/xgzx/pcwx/8274073087.html
www.lzbs.com.cn/yszx/sjst/8273633227.html
www.zhiyin.cn/ylzx/fmzs/8274832866.html
www.yltvb.com/xwbk/xunyiwenyao/8273402957.html
www.cjn.cn/hyzx/jkzd/8273014919.html
www.haianw.com/xgzx/pcwx/8274231232.html
www.lzbs.com.cn/yszx/jbys/8273911041.html
www.baike.com/hyzx/zyys/8288709902.html
www.zhiyin.cn/ylzx/tslf/8272834297.html
www.yltvb.com/xwbk/xunyiwenyao/8273559706.html
www.haianw.com/xgzx/pcwx/8274398507.html
www.lzbs.com.cn/yszx/sjst/8274148855.html
www.haianw.com/xgzx/jjyt/8273375182.html
www.yltvb.com/xwbk/stys/8275315080.html
www.lzbs.com.cn/yszx/sjst/8273307751.html
www.zhiyin.cn/ylzx/tslf/8274849797.html
www.hebiw.com/zixun/yangsheng/8273362052.html
www.baike.com/hyzx/zyys/8289724823.html
www.zhiyin.cn/ylzx/tslf/8275021477.html
www.cjn.cn/hyzx/jkzd/8274745214.html
www.haianw.com/xgzx/pcwx/8273433457.html
www.lzbs.com.cn/yszx/sjst/8273425043.html
www.020.com/ys/sjys/8274418787.html
www.rznews.cn/hyzx/yszy/8275507062.html
www.wfnews.com.cn/hyzx/qzbt/8036929505.html
zx.zynews.com/hyzx/yskt/8275933670.html
www.zhiyin.cn/ylzx/fmzs/8275207852.html
www.lzbs.com.cn/yszx/sjst/8273700276.html
www.cz001.com.cn/kpzx/zszb/8276489938.html
www.haianw.com/xgzx/jjyt/8273997430.html
www.lzbs.com.cn/yszx/jbys/8274099883.html
www.zhiyin.cn/ylzx/tslf/8273827398.html
www.yltvb.com/xwbk/redianxinwen/8275813771.html
www.lzbs.com.cn/yszx/jbys/8274594192.html
www.yltvb.com/xwbk/stys/8273573296.html
www.51etong.com/kpzx/ldyz/7687699669.html
www.zhiyin.cn/ylzx/tslf/8274013057.html
www.baike.com/hyzx/zyys/8290116192.html
www.baike.com/hyzx/zyys/8290440296.html
www.zhiyin.cn/ylzx/tslf/8274319408.html
www.yltvb.com/xwbk/stys/8273680213.html
www.haianw.com/xgzx/pcwx/8274509706.html
www.lzbs.com.cn/yszx/sjst/8274625623.html
www.zhiyin.cn/ylzx/fmzs/8274561863.html
www.yltvb.com/xwbk/redianxinwen/8273853436.html
www.51etong.com/kpzx/ldyz/7687699712.html
www.lzbs.com.cn/yszx/sjst/8274788981.html
www.wfnews.com.cn/hyzx/qzbt/8036930202.html
www.51etong.com/kpzx/ysyz/7687699746.html
www.cjn.cn/hyzx/jkzd/8275941604.html
www.cnncw.cn/hyzx/yyzq/8275302807.html
www.baike.com/hyzx/zyys/8290819942.html
In the first battle, we created the first app project