Android 學習之旅!(2)

來源:互聯網
上載者:User

標籤:

早幾天因爲學車,弄了幾天時間和精力過去,今天終於考過了(科目二,還是補考的...)嗯..不管這麼多了..今天又開始我的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,故也不會有表徵圖出現引自

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

Android 學習之旅!(2)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.