Action Coin

정확하게는 재생이 안되는 것이 아니라 재생은 되는데, 화면이 안보일때 해결 방법

webview의 layter type을 softwore로 설정했다면 이를 삭제한다

webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

와 같이 설정한 곳이 있으면 삭제 또는 LAYER_TYPE_HARDWARE  로 변경

LAYER_TYPE_SOFTWARE 는 Android version에 따라서 webview 성능 향상을 위해 사용하라는 의견들이 많다

Posted by incree

2017/02/10 05:49 2017/02/10 05:49
, , , ,
0 Trackbacks , 0 Comments

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

안드로이드 웹뷰 회전시 상태 유지


screenSize 는 Android 3.2(API level 13) or higher device

Posted by incree

2016/06/01 22:16 2016/06/01 22:16
0 Trackbacks , 0 Comments

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[Android] Cookie 버그 - WebView, HttpClient

Android에서 쿠키 공유할때(로그인 Activity -> WebView) 보통 아래와 같은 방법으로 처리한다

01    DefaultHttpClient client;
03    //gets all cookies from the HttpClient's cookie jar
04    List<Cookie> cookies = client.getCookieStore().getCookies();
06            if (! cookies.isEmpty()){
08                CookieSyncManager.createInstance(YourContext.this);
09                CookieManager cookieManager = CookieManager.getInstance();
11                            //sync all the cookies in the httpclient with the webview by generating cookie string
12                for (Cookie cookie : cookies){
14                    sessionInfo = cookie;
16                        String cookieString = sessionInfo.getName() + "=" + sessionInfo.getValue() + "; domain=" + sessionInfo.getDomain();
17                        cookieManager.setCookie(YOUR_DOMAIN, cookieString);
18                        CookieSyncManager.getInstance().sync();
19                }
20            }
출처 :

위 방식으로 예전에 개발할때는 잘 작동을 했는데,

이번 개발에서는 쿠키가 사라져 버리는 증상이 발생을 했다.

로그는 WebView를 호출한 이후에도 CookieManager에 쿠키가 남아 있었다

WebView에만 cookie가 전달이 안되는 증상이었다.

결론은 Android Cookie에 버그 때문.

Cookie 표준대로 작동안하니 버그라고 해도 될듯

Cookie 생성할때 모든 서브도메인까지 같이 적용되게 하려면 형식으로 도메인을 지정한다(맨 앞에 쩜 중요)

그런데 Android에서 이 형태의 도메인을 인식하지 못한다

2.1, 2.2, 2.3.3 까지 테스트 해 봤지만 모두 처리가 안됐다.

어쩔수 없이 고정 서브 도메인 하나만 지정하는 방법으로 처리했다.

일주일간 고생한걸 생각하면 ㅠㅠ.

p.s : 오늘 미국에 먼일 있나?? 오픈 소스 사이트들이 전부 이상한 안내 메시지 띄워 놓고
접속이 안되게 해놨네. 2011.01.18

Posted by incree

2012/01/18 20:30 2012/01/18 20:30
, , ,
0 Trackbacks , 0 Comments

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

I recently encountered this problem while trying to develop a WebView that is supported on Doughnut (1.6) and above. When presented with a https url the WebView just renders a blank page.

It seems that until Froyo, Android didn’t provide a public API to let you manually decide if you wanted to proceed to an untrusted web site via a WebView.

Note that in this case it is not even that the web site was untrusted (in the conventional sense) – it is because Thawte is not in the default list of trusted certificate authorities on Android. If you use the standard web browser on Android, the browser presents a typical warning dialog (as presented below) that enables you to accept the certificate and carry on.

Invalid certificate warning

If you are using Froyo as the target SDK then you can use:

1engine = (WebView) findViewById(;
2engine.setWebViewClient(new WebViewClient() {
3 public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
4 handler.proceed() ;
5 }

However, if you are not using Froyo then it seems you are out of luck. After some research, I concluded that I had the following options:

a) intercept all page requests and forward to external web browser if url begins with https (not a clean or nice user experience and totally unnecessary for Froyo and above)
b) add certificate of website to local keystore (in this case I am serving multiple web pages and the origin of many of these is not known until runtime)
c) make Froyo the minSDK and discard previous versions of Android (not a suitable option)
d) hack and use some private apis (the option described below)

To solve this problem we have to use a private interface (not published on SDK but present in real SDK runtime). As you can see in the Android src tree, the onReceivedSslError is indeed present (and used – it simply cancels the request) in Doughnut. However, this method is not presented to us in the SDK  - it is hidden because it contains a parameter type SslError which is located in a hidden package.  Therefore, we need to copy these src files into our project so that we can access them:

1) Copy into the package “android.webkit” within your src folder.
2) Copy into the package “” within your src folder.

Src files

3) Since we replicated the paths to the src files in the SDK, our code to override onSslError above now works on Android 1.6.

Caution: bear in mind that we are using a private API and Google reserve the right to change private APIs at any time – though in this case it is unlikely since they’ve now made this available in Froyo.

Posted by incree

2011/12/29 10:27 2011/12/29 10:27
, , ,
0 Trackbacks , 0 Comments

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다