2013年11月16日 星期六

環境整合內容















1.Android 環境
2.WAMP環境
3.網際網路環境
4.JQuery函數庫引入 JQery UI 函數庫引入
 5.JQueryMobil函數庫引入

Android 程式架構
 import android.app.Activity; //App 機動程式函數庫
 import android.os.bundle; //App 訊息函數庫,1.保留訊息‧2.參數資料傳輸
 import android.widget.*; //組件函數庫,視覺元件
 class 類別名稱(自訂) extends(繼承) Activity(父類別機動程式)
{
 protected void onCreat(Bundlw s) //建立生命週期開始
 { super.onCreate(s);

 }
 }
 環境建立
 1.Android IDE for eclipse ->JDK6.0 or JDK7.0(Android Studio)
2.Android SDK 到 http://developer.android.com/sdk/index.html 下載
3.建立workspace資料夾,例:myproject
4.模擬器建立 用5.4 SD卡指定1024 
第一個專案建立
1.建立專案
1.new Android App Project 2.other/Android/android application programe 名稱:TheoryProject1
2.建立檔案 建好專案急建立檔案
      1.刪掉AActivity 及 xml layout 檔
      2.建立自訂Activity及xml layout 檔
      src/theoryproject1下new/class Name:Hope1 superclass:android.app.Activity 按下finish
     *自訂Activity package com.example.theoryproject1;
       import android.app.Activity;
       import android.os.Bundle; //overwite 後增加
       public class Hope1 extends Activity
      {
          // 按右建sourse/Overwrite/implement Methods  @Override
         protected void onCreate(Bundle savedInstanceState)
         {
                 // TODO Auto-generated method stub
                    super.onCreate(savedInstanceState);
           }
      }
   *自訂xml layout name:hope1 與Hope1配合
    <?xml version="1.0" encoding="utf-8" ?>
   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/bg1" >

   </LinearLayout>
   @+drawable/bg1
   @drawable/bg1
   以上兩者不同意義
   *在Hope1.java設定R檔相關
       setContentView(R.layour.hope1);
 3.了解環境
      1.src:Java原始檔
      2.gen:R關聯檔=>layout與src的連結,用findViewById()
      3.assets:網頁檔或其他非編譯資源檔
      4.bin:值行檔和APK封裝檔
      5.libs:第三方函數庫檔
      6.res:資源檔
           string:字串資料
           drawable:圖片,動畫資料 800dp mdpi大於120 大於1000
           menu:選單資料
           layout:版面
          raw:影片,音樂
          animation:動畫 手機像素單位dp及兩個pixl 字型單位sp
      7.AndroidManifast.xml:主設定檔
        java+layout==>  R ==> AndroidManifast.xml ==>RUN==>apk

沒有留言:

張貼留言