메뉴 건너뛰기

app

안드로이드 스튜디오 사용 및 웹뷰 ssl(https) 에러

lispro062015.05.15 11:25조회 수 2831댓글 0

    • 글자 크기

안드로이드 스튜디오를 설치하고 실행했는데, VM 어쩌고 에러가 발생했다.


파일 > 세팅 > 컴파일러에 가면 VM options 가 있다.


-Xmx512m -XX:MaxPermSize=512m


위 값을 넣어 준다.


activity_main.xml을 design으로 보려는데, rendering error 가 발생했다.


아래 그림처럼, 레벨을 낮추면 보인다.


 그림 (복구하지 못함)


웹뷰를 이용해 https 경로를 호출했는데, 인증서 에러로 접근이 되지 않는다.


    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        webview = (WebView)findViewById(R.id.webView);


        webview.setWebViewClient(new WebViewClient() {

                                     public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {

                                         handler.proceed();

                                     }

                                 });


~~~~~~~~~~~~~~~~~~~~~~~~~~하략~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

웹뷰 클라이언트 생성 부분을 sslerror 에 대한 함수를 오버라이드 시켜 넘겨 버린다.


일반적으로는 아래와 같은 코드였는데, 오버라이드 함수를 넣어 생성한 것이다.


webview.setWebViewClient(new WebViewClient());


->

webview.setWebViewClient(new WebViewClient() {

                                     public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {

                                         handler.proceed();

                                     }

                                 });

lispro06 (비회원)
    • 글자 크기
[SWIFT] 아이콘 뱃지(숫자) 표시 (by lispro06) Google form trigger (by lispro06)

댓글 달기

lispro06
2015.05.15 조회 1676
lispro06
2015.05.15 조회 1650
lispro06
2015.05.15 조회 2541
lispro06
2014.08.16 조회 1793
lispro06
2014.02.08 조회 4053
lispro06
2013.12.11 조회 1712
lispro06
2013.12.10 조회 3015
suritam9
2013.12.06 조회 2295
suritam9
2013.12.02 조회 3483
suritam9
2013.11.30 조회 2188
suritam9
2013.11.26 조회 1684
suritam9
2013.08.23 조회 7348
suritam9
2013.08.23 조회 1891
suritam9
2013.06.28 조회 2368
첨부 (0)
위로