1. 程式人生 > >eclipse轉androidstudio時as的配置

eclipse轉androidstudio時as的配置

前言:

    以前用慣了eclipse覺得別人都用as,覺得as這也不好,那也不行。比如執行卡,快捷鍵用不習慣,沒eclipse的有些程式碼提示,快速修正什麼的,後面查了資料把as配置成eclise類似的快捷鍵後覺得還是as用起來舒服,as雖然開始執行起來卡,但是執行穩定之後就好了,不會像eclipse那樣老是提示adb掉了什麼的,又要重啟,很麻煩,而且程式碼提示功能只要自己設定好了跟eclipse用起來差不多,最方便的還是程式碼提醒功能,不用像eclipse老是去alt+/去提示程式碼,而是輸入相關api的首字元就可以提示出來,而且佈局中也是自動補全,很方便。總的來說用慣了as後就會覺得確實比eclipse好用。

以下為個人當初eclipse轉as時的一些配置:

1.設定as與eclipse功能類似的快捷鍵:

1.1設定滑鼠移動到程式碼上面時懸浮提示:Settings(扳手圖示)-Editor-General-other-show quick doc on mouse move 打鉤

1.2設定顯示的主題風格:Settings(扳手圖示)-Appearance -Theme-Darcula 預設的黑色;IntelliJ和windows都為白色
1.3設定快捷鍵與eclipse大部分一樣:Settings(扳手圖示)-Appearance -Keymap-下來選擇eclipse copy
1.4設定程式碼提示功能(不區分大小寫):Settings-Editor-General-Code Completion 右側Case sensitive ...設定為none

1.5設定註釋程式碼快捷鍵:Settings(扳手圖示)-Appearance -Keymap-搜尋comment-找到對應的地方設定相應的快捷鍵;即搜尋裡面輸入comm找到commnet with line comment即設定註釋的快捷鍵,雙擊選擇新增快捷鍵,然後設定ctrl+shift+c,之後彈出確定是否移除重複的快捷鍵,確定;搜尋輸入comp找到completion下面的smarttype設定程式碼提示快捷鍵alt+/

1.6其他快捷鍵:alt +enter 為自動導包/快速修正,需放在錯誤提示的控制元件的後面,不像eclipse在這一行也能修正;alt +ctrl + space 提示補全匿名內部類;Alt+Insert  生成構造/set/get方法;ctrl+shift+alt+s彈出導jar包module的structure

2.彈出DDMS:Tools-Android-Android Device Monitor

3.設定程式碼塊:Settings-Editor-Live Templates-點選右側加號.新增後記得defin為java,然後apply,然後點選ok即可使用。其中Abbreviation裡面設定自己喜好的提示簡寫字元。右邊那個描述可加可不加,下面的空白地方設定程式碼提示模組,然後一個個加,加完後define為java,然後apply

Log.i(TAG, "");

private static final String TAG = "TAG";
private static final boolean DEBUG = true;
tv=(TextView)findViewById(R.id.tv);
bt=(Button)findViewById(R.id.bt);
toggleButton=(ToggleButton)findViewById(R.id.toggleButton);
et=(EditText)findViewById(R.id.editText);
gridView=(GridView)findViewById(R.id.gridView);
listView=(ListView)findViewById(R.id.listView);
imageView=(ImageView)findViewById(R.id.imageView);
imageButton=(ImageButton)findViewById(R.id.imageButton);
seekBar=(SeekBar)findViewById(R.id.seekBar);
progressBar=(ProgressBar)findViewById(R.id.progressBar);
spinner=(Spinner)findViewById(R.id.spinner);
webView=(WebView)findViewById(R.id.webView);
rg=(RadioGroup)findViewById(R.id.rg);
rl=(RelativeLayout)findViewById(R.id.rl);
ll=(LinearLayout)findViewById(R.id.ll);
fl=(FrameLayout)findViewById(R.id.fl);
sv= (ScrollView)findViewById(R.id.scrollView);
Toast.makeText(mContext,"",Toast.LENGTH_SHORT).show();
switch (view.getId()){
    case R.id.:


        break;
    default:
        break;
}
Thread.currentThread().getId();
try {
    
}catch (Exception e){
    e.printStackTrace();
}