메뉴 건너뛰기

app

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

lispro062015.05.15 11:25조회 수 2789댓글 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 조회 1632
lispro06
2015.05.15 조회 1600
lispro06
2015.05.15 조회 2492
lispro06
2014.08.16 조회 1739
lispro06
2014.02.08 조회 3979
lispro06
2013.12.11 조회 1648
lispro06
2013.12.10 조회 2953
suritam9
2013.12.06 조회 2249
suritam9
2013.12.02 조회 3424
suritam9
2013.11.30 조회 2139
suritam9
2013.11.26 조회 1626
suritam9
2013.08.23 조회 7292
suritam9
2013.08.23 조회 1826
suritam9
2013.06.28 조회 2313
첨부 (0)
위로