Page 825 - 2
P. 825

handler = new RecognitionHandler(this);
                            naverRecognizer = new NaverRecognizer(this, handler, "h3JOFQoENqgC3DXlnuIt
                            ");


                            final Vibrator vibe = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);


                            // 레이아웃의 EditText     를 선언
                            editText = (EditText) findViewById(R.id.EditText);
                            // 레이아웃의 Button     을 선언
                            imageButton = (ImageButton) findViewById(R.id.imageButton);
                            imageButton2 = (ImageButton) findViewById(R.id.imageButton2);
                            imageButton3 = (ImageButton) findViewById(R.id.imageButton3);
                            imageButton4 = (ImageButton) findViewById(R.id.imageButton4);
                            // 레이아웃의 TextView      를 선언
                            viewtext = (TextView) findViewById(R.id.viewtext);
                            // 레이아웃의 ImageView      를 선언
                            imgView = (ImageView) findViewById(R.id.imgView);


                            final String clientId = "■■■■■■■■■■■■■■■■■■■■             ";
                            final String clientSecret = "■■■■■■■■■■      ";


                            imgView.setBackgroundResource(R.drawable.chara_ready);
                            checkPermission();


                            // 번역 버튼
                            imageButton.setOnClickListener(new ImageButton.OnClickListener() {
                                public void onClick(View v) {
                                    if(editText.getText().toString().equals(""))
                                    {
                                        imgView.setBackgroundResource(R.drawable.chara_not);
                                        viewtext.setText(" 번역할 문장을 입력해주세요.");              }
                                    else {
                                        Thread thread = new Thread(new Runnable() {
                                            @Override
                                            public void run() {
                                                try {


                                                    String textCatch = editText.getText().toString();
                                                    //EditText 의 내용을 가져와 textCatch      에 넣는다.
                                                    String text = URLEncoder.encode(textCatch.toString(), "U
                                                    TF-8").replaceAll("\\+", "%20");
                                                    URL url;
                                                    //URLEncoder.encode  로 한글을 인코딩해준다.
                                                    if(fromTrans.equals("ja")&&toTrans.equals("ja")){


                                                         - 825 -
   820   821   822   823   824   825   826   827   828   829   830