忍者ブログ

からすまる日誌

20200220pm03 エクリプス日本語化/android stadio

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

20200220pm03 エクリプス日本語化/android stadio

android stadio日本語化
 
①dlして展開
②setup.exeを実行
 
③C:\Program Files\Android\Android Studio\bin\
studio64.exeを選択
日本語化する
 

プロジェクトのなかに1つでもエラーのクラスがあるとプロジェクト全体がうごかないらしい
 
エラーは赤い文字のとこがあやしい
 
実行させたいファイルを、マニフェストファイルに入力更新するのをわすれないように
 


ここ。(青く反転)
 

Sample3
 package com.example.lesson1;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class Sample3 extends AppCompatActivity {
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        TableLayout t1 = new TableLayout(this);
        setContentView(t1);
        TableRow[] tr = new TableRow[10];
        TextView[] tv = new TextView[10];
        Button[] bt = new Button[10];
        for (int i=0; i<tr.length; i++){
            tr[i] = new TableRow(this);
            tv[i] = new TextView(this);
            tv[i].setText("商品"+i+"---");
            bt[i] = new Button(this);
            bt[i]. setText("購入");
            tr[i]. addView(tv[i]);
            tr[i].addView(bt[i]);
            t1.addView(tr[i]);
        }
    }
}
 
 
 

じかいUMLとかいうのもやるらしい
 

Sample4
package com.example.lesson1;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class Sample4 extends AppCompatActivity {
    TextView tv;
    Button bt;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LinearLayout l1 = new LinearLayout(this);
        l1.setOrientation(LinearLayout.VERTICAL);
        setContentView(l1);
        tv = new TextView(this);
        tv.setText("いらっしゃいませ");
        bt = new Button(this);
        bt.setText("購入");
        //
        l1.addView(tv);
        l1.addView(bt);
        bt.setOnClickListener(new SampleClickListener());
    }
    class SampleClickListener implements View.OnClickListener{
        public void onClick(View v){
        //
        tv.setText("thanks");
    }
    }
}

sample5
 
package com.example.lesson1;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class Sample5 extends AppCompatActivity {
    TextView tv;
    Button bt;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LinearLayout l1 = new LinearLayout(this);
        l1.setOrientation(LinearLayout.VERTICAL);
        setContentView(l1);
        tv = new TextView(this);
        tv.setText("いらっしゃいませ");
        bt = new Button(this);
        bt.setText("購入");
        l1.addView(tv);
        l1.addView(bt);
        bt.setOnTouchListener(new SampleTouchListener());
    }
    class SampleTouchListener implements View.OnTouchListener{
        public boolean onTouch(View v, MotionEvent e){
            if(e.getAction()==MotionEvent.ACTION_DOWN){
                tv.setText("hi");
            }else if(e.getAction()==MotionEvent.ACTION_UP){
                tv.setText("bye");
            }
            return true;
        }
    }
}
構造が一つも分からない
 
なにをみればいいんだ
→アンドロイドスタジオ用のapiみたいのがあるらしい
例のリンク集にある
今度みかたをやるらしい
  

Rensyu1
 
package com.example.lesson1;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class Rensyu1 extends AppCompatActivity {
    TextView tv;
    Button bt;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LinearLayout l1 = new LinearLayout(this);
        l1.setOrientation(LinearLayout.VERTICAL);
        setContentView(l1);
        tv = new TextView(this);
        tv.setText("いらっしゃいませ");
        bt = new Button(this);
        bt.setText("購入");
        l1.addView(tv);
        l1.addView(bt);
        bt.setOnTouchListener(new SampleTouchListener());
    }
    class SampleTouchListener implements View.OnTouchListener{
        public boolean onTouch(View v, MotionEvent e){
            if(e.getAction()==MotionEvent.ACTION_DOWN){
                bt.setText("THANKS");
            }
            return true;
        }
    }
}

Rensyu2
  
package com.example.lesson1;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class Rensyu2 extends AppCompatActivity {
    TextView tv;
    Button bt;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LinearLayout l1 = new LinearLayout(this);
        l1.setOrientation(LinearLayout.VERTICAL);
        setContentView(l1);
        tv = new TextView(this);
        tv.setText("いらっしゃいませ");
        bt = new Button(this);
        bt.setText("購入");
        l1.addView(tv);
        l1.addView(bt);
        bt.setOnTouchListener(new SampleTouchListener());
    }
    class SampleTouchListener implements View.OnTouchListener{
        public boolean onTouch(View v, MotionEvent e){
            if(e.getAction()==MotionEvent.ACTION_DOWN){
                bt.setText("こんにちは");
            }else if(e.getAction()==MotionEvent.ACTION_UP){
                bt.setText("さようなら");
            }
            return true;
        }
    }
}
PR

コメント

ブログ内検索

カレンダー

03 2025/04 05
S M T W T F S
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30