private boolean isMobile(HttpServletRequest request) {
String userAgent = request.getHeader("user-agent");
boolean mobile1 = userAgent.matches(".*(iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson).*");
boolean mobile2 = userAgent.matches(".*(LG|SAMSUNG|Samsung).*");
if(mobile1 || mobile2) {
return true;
}
return false;
}
반응형
'Javascript' 카테고리의 다른 글
| Windows8.1 + IE11 화면배율 자동변경 문제! (0) | 2014.10.31 |
|---|---|
| JSON.parse() - Uncaught SyntaxError: Unexpected token (3) | 2014.10.24 |
| [JAVA] request Header 정보보기 (0) | 2014.07.04 |
| [Jquery] jquery.cookie.js - 쿠키 (0) | 2014.06.25 |
| [Javascript] 변수값 null 체크 - isNull (0) | 2014.03.20 |