zoukankan      html  css  js  c++  java
  • Android系列 -- 1、 初识android

    1、为什么要学习android

        首先感叹下,开始接触android 应该是在几年前,当时工作第一次接触到需要做app。当时怀着很大的兴趣去学习,但后来没有坚持下来(在这里鄙视自己一下)。随着移动互联的普及,智能手机的重要性越来越强,公司项目也逐渐开始向移动端发生转变,促使自己不得不掌握相关方便的知识。

    2、制定学习计划

        人是逼出来的,给自己一个月时间,每天至少两个小时进行学习。目标:掌握android开发要领

    3、废话不多说

         从简单的Hello程序开始,哈哈,貌似有点老套路了

         首先认识下清单文件:AndroidManifest.xml

         

     1 <?xml version="1.0" encoding="utf-8"?>
     2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     3     package="com.example.rocky.hello" >
     4 
     5     <application
     6         android:allowBackup="true"        
     7         android:icon="@mipmap/ic_launcher" /*指定图标*/
     8         android:label="@string/app_name"   /*指定标签*/
     9         android:theme="@style/AppTheme" >  /*主题样式*/
    10         <activity
    11             android:name=".MainActivity"
    12             android:label="@string/app_name" >   /*定义一个activity组件*/
    13             <intent-filter>
    14                 <action android:name="android.intent.action.MAIN" />  /*指定该activity是程序入口*/
    15 
    16                 <category android:name="android.intent.category.LAUNCHER" />
    17             </intent-filter>
    18         </activity>
    19     </application>
    20 
    21 </manifest>
    
    
    android:icon="@mipmap/ic_launcher" 和 android:icon="@drawable/icon" 的区别在于:用mipmap系统会在缩放上提供一定的性能优化

    官方介绍:

    Mipmapping for drawables

    Using a mipmap as the source for your bitmap or drawable is a simple way to provide a quality image and various image scales, which can be particularly useful if you expect your image to be scaled during an animation.

    Android 4.2 (API level 17) added support for mipmaps in the Bitmap class—Android swaps the mip images in your Bitmap when you've supplied a mipmap source and have enabled setHasMipMap(). Now in Android 4.3, you can enable mipmaps for a BitmapDrawable object as well, by providing a mipmap asset and setting the android:mipMap attribute in a bitmap resource file or by calling hasMipMap().

  • 相关阅读:
    C#计算两个时间年份月份天数(根据生日计算年龄)差,求时间间隔
    C#四舍五入保留一位小数
    给Editplus去掉.bak文件
    $().each() 与 $.each()解析
    VS 2013+Qt 5.4.1
    HDU 5228 ZCC loves straight flush( BestCoder Round #41)
    产品经理的修炼:如何把梳子卖给和尚
    c++ STL unique , unique_copy函数
    linux定时备份mysql数据库文件
    Python——异常基础
  • 原文地址:https://www.cnblogs.com/wzxiang/p/4489238.html
Copyright © 2011-2022 走看看