1. 程式人生 > >修改System.UI並編譯

修改System.UI並編譯

作為訂製化的系統,我們有時候需要修改導航欄,在這裡我們以修改導航欄圖示為例,在導航欄新增語音助手的圖示。

2017/6/19

實現

  1. 首先在SystemUI中新增語音助手的資原始檔,路徑如下:
    frameworks/base/packages/SystemUI/res/

  2. 修改導航欄的佈局檔案,路徑:
    frameworks/base/packages/SystemUI/res/layout/navigation_bar.xml
    在返回鍵前面新增語音助手和錄影按鈕的佈局(注意要修改兩個地方一個橫屏的一個豎屏的,如果只修改了上面那段在切換橫屏時候會崩潰):

<?xml version="1.0" encoding="utf-8"?>
<!-- /* apps/common/assets/default/default/skins/StatusBar.xml ** ** Copyright 2011, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ -->
<com.android.systemui.statusbar.phone.NavigationBarView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:layout_height="match_parent" android:layout_width="match_parent" android:background="@drawable/system_bar_background"
>
<FrameLayout android:id="@+id/rot0" android:layout_height="match_parent" android:layout_width="match_parent" > <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="horizontal" android:clipChildren="false" android:clipToPadding="false" android:id="@+id/nav_buttons" android:animateLayoutChanges="true" > <!-- navigation controls --> <View android:layout_width="40dp" android:layout_height="match_parent" android:layout_weight="0" android:visibility="invisible" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back" android:layout_width="@dimen/navigation_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_back" systemui:keyCode="4" android:layout_weight="0" android:scaleType="center" android:contentDescription="@string/accessibility_back" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home" android:layout_width="@dimen/navigation_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_home" systemui:keyCode="3" systemui:keyRepeat="false" android:layout_weight="0" android:contentDescription="@string/accessibility_home" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> <!-- larson modify @dimen/navigation_key_width to 1dp and removed android:layout_weight="0"--> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps" android:layout_width="1dp" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_recent" android:contentDescription="@string/accessibility_recent" /> <!-- code below written by larsonzhong --> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/videoCapture" android:layout_width="@dimen/navigation_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_video_off" android:layout_weight="0" android:contentDescription="@string/accessibility_recent" android:padding="5dp" android:scaleType="center" /> <View android:layout_width="40dp" android:layout_height="match_parent" android:layout_weight="0" android:visibility="invisible" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/voiceAssist" android:layout_width="@dimen/navigation_key_width" android:layout_height="match_parent" android:src="@drawable/rc_statuebar_voiceassist_selector" android:layout_weight="0" android:contentDescription="@string/accessibility_recent" android:padding="5dp" android:scaleType="center" /> <View android:layout_width="40dp" android:layout_height="match_parent" android:layout_weight="0" android:visibility="invisible" /> <FrameLayout android:layout_width="@dimen/navigation_extra_key_width" android:layout_height="match_parent" android:layout_weight="0" > <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu" android:layout_width="@dimen/navigation_extra_key_width" android:layout_height="match_parent" android:contentDescription="@string/accessibility_menu" android:src="@drawable/ic_sysbar_menu" android:visibility="invisible" systemui:keyCode="82" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/ime_switcher" android:layout_width="@dimen/navigation_extra_key_width" android:layout_height="match_parent" android:contentDescription="@string/accessibility_ime_switch_button" android:scaleType="centerInside" android:src="@drawable/ic_ime_switcher_default" android:visibility="invisible" /> </FrameLayout> </LinearLayout> <!-- lights out layout to match exactly --> <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="horizontal" android:id="@+id/lights_out" android:visibility="gone" > <ImageView android:layout_width="80dp" android:layout_height="match_parent" android:layout_marginStart="40dp" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> <ImageView android:layout_width="80dp" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" android:layout_weight="0" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> <ImageView android:layout_width="80dp" android:layout_marginEnd="40dp" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0" /> </LinearLayout> <com.android.systemui.statusbar.policy.DeadZone android:id="@+id/deadzone" android:layout_height="match_parent" android:layout_width="match_parent" systemui:minSize="@dimen/navigation_bar_deadzone_size" systemui:maxSize="@dimen/navigation_bar_deadzone_size_max" systemui:holdTime="@integer/navigation_bar_deadzone_hold" systemui:decayTime="@integer/navigation_bar_deadzone_decay" systemui:orientation="horizontal" android:layout_gravity="top" /> </FrameLayout> <FrameLayout android:id="@+id/rot90" android:layout_height="match_parent" android:layout_width="match_parent" android:visibility="gone" android:paddingTop="0dp" > <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" android:clipChildren="false" android:clipToPadding="false" android:id="@+id/nav_buttons" android:animateLayoutChanges="true" > <!-- navigation controls --> <FrameLayout android:layout_weight="0" android:layout_width="match_parent" android:layout_height="40dp" > <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/ime_switcher" android:layout_width="match_parent" android:layout_height="40dp" android:contentDescription="@string/accessibility_ime_switch_button" android:scaleType="centerInside" android:src="@drawable/ic_ime_switcher_default" android:visibility="invisible" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu" android:layout_width="match_parent" android:layout_height="40dp" android:contentDescription="@string/accessibility_menu" android:src="@drawable/ic_sysbar_menu_land" android:visibility="invisible" systemui:keyCode="82" /> </FrameLayout> <!-- code below written by larsonzhong --> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/videoCapture" android:src="@drawable/ic_sysbar_video_off" android:layout_height="80dp" android:layout_width="match_parent" android:padding="5dp" android:scaleType="center" android:layout_weight="0" android:contentDescription="@string/accessibility_back" /> <View android:layout_height="match_parent" android:layout_width="match_parent" android:layout_weight="1" android:visibility="invisible" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/voiceAssist" android:src="@drawable/rc_statuebar_voiceassist_selector" android:layout_height="80dp" android:layout_width="match_parent" android:padding="5dp" android:scaleType="center" android:layout_weight="0" android:contentDescription="@string/accessibility_back" /> <!-- larson modify 80dp to 1dp and removed android:layout_weight="0"--> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps" android:layout_height="1dp" android:layout_width="match_parent" android:src="@drawable/ic_sysbar_recent_land" android:contentDescription="@string/accessibility_recent" /> <View android:layout_height="match_parent" android:layout_width="match_parent" android:layout_weight="1" android:visibility="invisible" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home" android:layout_height="80dp" android:layout_width="match_parent" android:src="@drawable/ic_sysbar_home_land" systemui:keyCode="3" systemui:keyRepeat="false" android:layout_weight="0" android:contentDescription="@string/accessibility_home" /> <View android:layout_height="match_parent" android:layout_width="match_parent" android:layout_weight="1" android:visibility="invisible" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back" android:layout_height="80dp" android:layout_width="match_parent" android:src="@drawable/ic_sysbar_back_land" android:scaleType="center" systemui:keyCode="4" android:layout_weight="0" android:contentDescription="@string/accessibility_back" /> <View android:layout_height="40dp" android:layout_width="match_parent" android:layout_weight="0" android:visibility="invisible" /> </LinearLayout> <!-- lights out layout to match exactly --> <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" android:id="@+id/lights_out" android:visibility="gone" > <ImageView android:layout_height="80dp" android:layout_marginTop="40dp" android:layout_width="match_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0" /> <View android:layout_height="match_parent" android:layout_width="match_parent" android:layout_weight="1" android:visibility="invisible" /> <ImageView android:layout_height="80dp" android:layout_width="match_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" android:layout_weight="0" /> <View android:layout_height="match_parent" android:layout_width="match_parent" android:layout_weight="1" android:visibility="invisible" /> <ImageView android:layout_height="80dp" android:layout_marginBottom="40dp" android:layout_width="match_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0" /> </LinearLayout> <com.android.systemui.statusbar.policy.DeadZone android:id="@+id/deadzone" android:layout_height="match_parent" android:layout_width="match_parent" systemui:minSize="@dimen/navigation_bar_deadzone_size" systemui:maxSize="@dimen/navigation_bar_deadzone_size_max" systemui:holdTime="@integer/navigation_bar_deadzone_hold" systemui:decayTime="@integer/navigation_bar_deadzone_decay" systemui:orientation="vertical" android:layout_gravity="top" /> </FrameLayout> </com.android.systemui.statusbar.phone.NavigationBarView>

順便把rc_statuebar_voiceassist_selector也貼出來,這個selector用在當用戶長按按鈕的時候,按鈕disable掉:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">     
<!-- disabled -->
    <item android:state_enabled="false" 
          android:state_pressed="false" 
          android:drawable="@drawable/ic_sysbar_voice_off" />
<!-- pressed -->
    <item android:state_enabled="true" 
          android:state_pressed="true"
          android:drawable="@drawable/ic_sysbar_voice_on" />
<!-- focused -->
<!--    <item android:state_enabled="true" 
          android:state_focused="true"
          android:textcolor="@android:color/white" 
          android:drawable="@drawable/list_item_focused" /> -->     
<!-- default -->
    <item android:state_enabled="true" 
          android:state_pressed="false" 
          android:drawable="@drawable/ic_sysbar_voice_on"/>
</selector> 
  1. 接著修改程式碼邏輯,檔案路徑:
    frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.Java
    在private void prepareNavigationBarView() {……}函式中新增點選和長按事件
mNavigationBarView.getVoiceAssistButton().setOnLongClickListener(mLongPressVoiceListener);//larsonzhong@163.com
        mNavigationBarView.getVoiceAssistButton().setOnClickListener(mYuyinClickListener);//larsonzhong@163.com

        mNavigationBarView.getVideoCaptureButton().setOnClickListener(mDvrClickListener);//larsonzhong@163.com

對應的getVoiceAssistButton()要在
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
中實現:

    //[email protected]
    public View getVoiceAssistButton(){  
        return mCurrentView.findViewById(R.id.voiceAssist);  
    }  

    //[email protected]
    public View getVideoCaptureButton(){  
        return mCurrentView.findViewById(R.id.videoCapture);  
    }  
  1. 最後就是功能實現了,在
    frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
    中新增監聽函式:
  ///////////////////*語音按鈕長按*////////////
    private View.OnLongClickListener mLongPressVoiceListener =//[email protected]
        new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            if (!isYuyinSwitchOn()){
                PhoneStatusBar.this.setYuyinSwitch(true);
                showToast("開啟語音助手");
            }else{
                PhoneStatusBar.this.setYuyinSwitch(false);
                showToast("關閉語音助手");
            }

           updateYuyinStatue();
        return true;
        }

    };

    private void updateYuyinStatue() {
         ImageView localImageView;
           if (mNavigationBarView.getVoiceAssistButton() != null){
             localImageView = (ImageView)mNavigationBarView.getVoiceAssistButton();
             localImageView.setEnabled(isYuyinSwitchOn());
           }
    }

    private void showToast(String resString){//[email protected]
      android.widget.Toast.makeText(mContext, resString, android.widget.Toast.LENGTH_SHORT).show();
    }

    private void setYuyinSwitch(boolean paramBoolean){//[email protected]
      android.content.ContentResolver localContentResolver = this.mContext.getContentResolver();
      Settings.System.putInt(localContentResolver, "yuyin_switch", paramBoolean?1:0);
    }

    private boolean isYuyinSwitchOn(){//[email protected]
      return Settings.System.getInt(this.mContext.getContentResolver(), "yuyin_switch", 1) == 1;
    }

    ////***********************[email protected]*************//////////////////////
/************ 語音按鈕點選 *********/
    private View.OnClickListener mYuyinClickListener = new View.OnClickListener()// [email protected]
    {
        public void onClick(View paramAnonymousView) {
            // 語音助手關閉,則點選無效
            if (!isSupportYuyinSwitch())
                return;

            if (!isYuyinSwitchOn()) {
                setYuyinSwitch(true);
                updateYuyinStatue();
            }

            sendYuyinDownBroadcast();
        }

    };
    private final String BROADCAST_START_VOICE_ASSIST = "com.larson.systemui.KEYDOWN_VOICE_ASSIST";
    private void sendYuyinDownBroadcast() {
        mContext.sendBroadcast(new Intent(BROADCAST_START_VOICE_ASSIST));
    }
//// ***********************DVR按鈕*************//////////////////////

    private final String BROADCAST_START_DVR = "com.larson.systemui.KEYDOWN_DVR";
    private View.OnClickListener mDvrClickListener = new View.OnClickListener() {
        public void onClick(View paramAnonymousView) {
            mContext.sendBroadcast(new Intent(BROADCAST_START_DVR));
        }
    };
  1. 編譯,在根目錄使用mmm指令,mmm frameworks/base/packages/SystemUI,編譯很快就能完成,如果出現mmm指令不識別,請先source然後lunch一下。

後續工作

如果你的應用有使用橫屏模式,務必把layout下的land下的佈局也同步修改了。

SystemUI.apk生成以後,直接重新刷系統是看不到改變的,我們需要把重新生成的SystemUI.apk推送到手機中,具體步驟如下:
我們先確定SystemUI所在的目錄,為了驗證我上一句話是對的,我先把系統裡的SystemUI.apk拉出來,然後看下佈局檔案是否改變,如果沒有改變說明重新刷系統無效。

為了讓系統可讀寫,我們首先執行

#獲取系統許可權,便於執行remount
adb root
#讓系統可讀寫
adb remount
#把SystemUI.apk拖出來
adb pull adb pull /system/priv-app/SystemUI/SystemUI.apk F:\
#進入到修改後的SystemUI.apk所在目錄
adb push SystemUI.apk /system/priv-app/SystemUI/SystemUI.apk
#重起系統檢視效果
adb reboot

2017/4/19

匯入eclipse

匯入eclipse只是在eclipse方便寫程式碼而已,不要在意報錯,因為最終還是要在原始碼樹上除錯。下面這幾步只是為了方便開發,因為記事本寫導包啊啥的挺麻煩的。

  1. 首先從安卓原始碼樹中拿到SystemUI的原始碼,位置在 \原始碼目錄\frameworks\base\packages\SystemUI,我們把這個資料夾拷貝出來。

  2. 把framework的jar包匯入,上面的錯誤大部分是因為缺少依賴導致。framework.jar在編譯好的系統輸出目錄下,out\target\common\obj\JAVA_LIBRARIES\framework_intermediates\classes.jar
    拿到這個檔案,我們改名為framework.jar,加入到SystemUI工程目錄的buildPath中。這個時候我們發現少了很多錯誤。

  3. 按照上面的方式新增以下依賴:
    out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar
    out/target/common/obj/JAVA_LIBRARIES/service_intermediates/classes.jar
    out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar

  4. 發現還有錯誤;
    將/frameworks/base/packages/Keyguard 裡面src下的檔案都拷貝到工程中
    eclipse要選Java 1.7版本。

  5. 發現還有報錯
    //import com.android.systemui.EventLogTags;
    程式碼裡用到EventLog的會報錯,把這個遮蔽掉

  6. 還有資原始檔報錯
    不管了,反正我們到時候是要把程式碼複製到系統原始碼裡面的,不影響寫程式碼就行。

相關推薦

修改System.UI編譯

作為訂製化的系統,我們有時候需要修改導航欄,在這裡我們以修改導航欄圖示為例,在導航欄新增語音助手的圖示。 2017/6/19 實現 首先在SystemUI中新增語音助手的資原始檔,路徑如下: frameworks/base/package

QT Creator 使用 design 修改 ui介面編譯後介面未更新問題的解決 From EricQu

轉載於:http://blog.csdn.net/cokewei/article/details/6639960 今日遇到一個奇怪的問題,描述如題。 網上搜索了一些解決方案,說的不是很清楚,經過一些時間的摸索,這裡總結一下解決方法。 ui原始檔到介面顯示的原理可

ubuntu修改用戶名修改home對應的目錄名

use 一個 -c ubunt username .net 修改 修改用戶名 logo 1.新建一個新的用戶user2 sudo adduser temporary sudo adduser temporary sudo 2.從user1 logout。進入新建用戶u

selenium Python自動化 筆記 根據xpath找定位的響應屬性 修改鏈接打開

print ram main import ttr body username div method # coding=utf-8import timeimport unittestfrom framework.browser_engine import BrowserEn

cocos2d-x命令行生成項目編譯運行

cocos2d-x命令行生成項目並編譯運cocos2d-x命令行生成項目並編譯運行

QEMU修改及安裝包編譯

payload tail clock nss rac vra vmdk 復制 完整 轉載自 靈躍雲 :原文鏈接 1. 前言 上一篇文章《虛擬化環境搭建及虛擬機創建》中,我們簡單介紹了虛擬化環境的搭建和虛擬機創建過程,本文

oracle rac 11g修改開啟歸檔修改歸檔日誌路徑

oracle rac 歸檔1、修改歸檔路徑參數sqlplus / as sysdbaSQL> alter system set log_archive_dest_1='location=+ASMARCH' scope=spfile sid='*';2.關閉數據庫,全部節點

修改maven項目的編譯版本

bsp In AS compile -c text ext art config 在pom.xml中添加如下代碼 <build> <!-- 配置了很多插件 --> <p

ubuntu16.04生成c++文件編譯

文本 ubuntu 一個 color -s span spa 回車 6.0 創建存放cpp文件的文件夾,並進入:   mkdir test   cd test 創建cpp文件:   vi test_cpp.cpp 輸入   :x 按回車,保存文本 輸入     g++ te

修改element ui 默認樣式最好的解釋

html key git xxx card har def 默認 vuejs KedAyAyA 17年10月 https://forum.vuejs.org/t/elementui/19171/5 首先添加了scoped的style標簽會在vue-loader

vue組件樣式添加scoped屬性之後,無法被父組件修改。或者無法在本組件修改element UI樣式

lang tro att orm 宋體 ttr 符號 Language 避免 在vue開發中,需要使用scoped屬性避免樣式的全局幹擾,但是這樣在父組件中是無法被修改的,不僅如此如果項目中用了UI框架比如element Ui,這個時候在本組件也無法修改樣式,因為權重問題。

下載編譯Chrome瀏覽器For Android

最近因為公司專案,需要對Chrome的某一模組進行修改後,相容公司的Android裝置,現記錄下Chrome的原始碼下載過程,作為筆記。 1. 準備Ubuntu系統,最好是物理機上安裝,因為Chrome首次編譯耗時較長,對硬體要求較高。我使用的Ubuntu版本為14.04.1。 2. 下載C

Windows上檢出編譯Chromium

Checking out and Building Chromium for Windows 其它平臺的嚮導,請移步get the code頁面。 Google員工 如果你是Google員工,請參考go/building-chrome-win。 系統需求 一臺英特

vue元件樣式新增scoped屬性之後,無法被父元件修改。或者無法在本元件修改element UI樣式

在vue開發中,需要使用scoped屬性避免樣式的全域性干擾,但是這樣在父元件中是無法被修改的,不僅如此如果專案中用了UI框架比如element Ui,這個時候在本元件也無法修改樣式,因為權重問題。但是想要修改還是有方法的: 1. 在不去掉scoped的情況下,在全域性樣式中覆蓋,這種解法,有弊端,可能會汙

如何在ubuntu中寫一個簡單的C語言程式碼編譯執行

首先需要安裝一個編譯器 因為筆者也是剛剛開始學習ubuntu所以不知道各個編譯器之間的區別,筆者所用的是gcc就簡單介紹一下gcc的安裝方法吧。 方法一: 開啟控制檯輸入以下程式碼: sudo apt-get build-dep gcc; sudo apt-get bui

RK3126-6.0SDK修改預設桌布旋轉居中

6.0SDK修改預設桌布是在替換/framewoks/base/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.jpg檔案,如果客戶要求裝置旋轉為豎屏時還要求桌布不拉申並居中顯示,那麼在\packages\apps\Launcher3\sr

RK關於修改system分割槽大小

關於修改3126-6.0SDK的system系統分割槽大小:\device\rockchip\common\BoardConfig.mk檔案裡得BOARD_SYSTEMIMAGE_PARTITION_SIZE數值是十進位制,除以3個1024就得到多少個G,但是parameter.txt裡的syste

一個能夠自動匹配檔案編譯的makefile

AllDirs := $(shell ls -R | grep '^\./.*:$$' | awk '{gsub(":","");print}') . Sources := $(foreach n,$(AllDirs) , $(wildcard $(n)/*.cpp)) Objs := $(pats

Vue修改mint-ui預設樣式(預設風格)

加入my-mint.css 我這裡用的postcss的變數定義,如果親們用的是其他前處理器,要改成其他處理器的定義方式 覆蓋mint-ui的primary顏色,改為自己UI的主題色 --main-color: #f76349; /* 橙色 主色調 */ .mint-header { backgrou

使用idea匯入非maven專案編譯執行

1 匯入專案  (1) new -> project from exiting sources   (2)選擇要匯入的專案   (3)非maven專案選擇以eclipse方式匯入,一直點下一步就行  2 編譯  (1)右