zoukankan      html  css  js  c++  java
  • Android 學習之旅!(2)

    早幾天因爲學車,弄了幾天時間和精力過去,今天終於考過了(科目二,還是補考的...)嗯..不管這麼多了..今天又開始我的android 學習之旅!!

    筆記:

    platform-tools目錄下的文件:

    adb.exe : android debug bridge(android調試橋)

      devices 列出所有連接設備

      kill-server 殺掉 adb

      start-server 啓動 adb

    dx.bat : 打包生成dex文件

    tools目錄下的文件:

    emulator.exe : 模擬器

    項目文件目錄下:

    .setting  保存配置信息(eclipse)

    assets  資產目錄(存放文件,會打包到APK.例:圖片,數據庫...

    bin  編譯後的文件目錄

    gen  (Generated Java File)(自動生成的文件目錄)

      BuildConfig.java  適配信息

      R.java  存放資源id的引用

    Android x.x.x  (x.x.x版本號)

      android.jar(SDK)好吧,前面說的"夾包"是jar包...終於懂了..

    project.properties  編譯版本

      target=android-x  (x版本號)

    libs  支持的jar,會被添加到android depend目錄下

      android-support-v4.jar  (補錄API)

    res  資源目錄

      drawable-xxxx(hdpi,ldpi,mdpi,xhdpi,xxhdpi...)  存放應用程序圖標  會自動生成id到R.java文件

      layout

        activity_main.xml  (MVC中的View)   

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >
    <TextView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="@string/hello_world" />
    </RelativeLayout>
    View Code

           RelativeLayout(相對佈局)

          xmlns(命名空間)

          Layout_width,Layout_height(控件的寬高)  match_parent(填充)

          wrap_content(包裹內容)

          centerHorizontal(水平居中)

          centerVertical(垂直居中)

          @(代表res,res又會編譯成R.java)  string(內部類)會在  res/values*/strings.xml 中有對應定義的字符串

      AndroidMainfest.xml  (當前應用程序的清單文件,程序的配置信息={"啓動圖標","應用程序名稱","包名","版本號","..."})

    <?xml version="1.0" encode="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.itheima.helloworld"
    android:versionCode="1"
    android:versionName="1.0" >
    
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />
    
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@strings/app_name"
        android:theme="@style/AppTheme" >
    <activity
        android:name="com.itheima.helloworld.MainActivity"
        android:label="@string/app_name" >
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
    </application>
    </manifest>
    View Code

        package="com.itheima.helloworld"  (手機應用依靠包名標識)

        android:versionCode="1",android:versionName="1.0"  (應用版本號)

        android:minSdkVersion="8"  (系統要求最低版本)  android:targetSdkVersion="17"  (系統最高版本?)

        android:icon="@drawable/ic_launcher"  (圖標)

        android:label="@string/app_name"  (應用程序名稱)

        android:theme="@style/AppTheme"  (應用程序樣式)

        <activity>應用程序界面  

        (在桌面生成圖標...)<intent-filter>額外的配置<action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" />

        這裏我自己百度了一..

    第一种情况:有MAIN,无LAUNCHER,程序列表中无图标
    原因:android.intent.category.LAUNCHER决定应用程序是否显示在程序列表里 
    第二种情况:无MAIN,有LAUNCHER,程序列表中无图标
    原因:android.intent.action.MAIN决定应用程序最先启动的Activity,如果没有Main,则不知启动哪个Activity,故也不会有图标出现

      今天就這樣先吧..好多關鍵字都不懂啊..有點吃力

  • 相关阅读:
    Oracle SQL FAQ
    miniasp(no encode)
    请看用javascript设置和读取cookie的简单例子
    asp流下载(Stream)
    (企业公司)网站开发方案
    asp发消息并代多个附件上传(多对多关系)
    tabpage1
    crystal report (asp调用水晶报表实例)
    上海万千文化传播有限公司(网站项目策划书)
    访问和更新Cookies集合
  • 原文地址:https://www.cnblogs.com/kazehanaai/p/4513219.html
Copyright © 2011-2022 走看看