본문 바로가기

ANDROID

(27)
Google Proximity Beacons https://newcircle.com/s/post/1755/2015/08/31/google-proximity-beacons---part-1https://newcircle.com/s/post/1761/2015/09/11/google-proximity-beacons---part-2
Retrofit 한국어 API 문서 크리스마스 기념으로 Retrofit의 API 문서를 번역하였다.번역 실력이 매우 구져서 걱정이다. 아래 링크에서 볼 수 있다. http://devflow.github.io/retrofit-kr/
Picasso를 LinearLayout의 배경 설정으로 사용하기. Picasso 라이브러리의 핵심기능 중 RequestCreator의 into() 함수에는 Target이라는 인터페이스를 파라미터로하는 함수가있는데, 이를 이용하면 간단하게 해결이 가능하다. Target을 implements하는 클래스로 만들어 주면 된다. public class PicassoableLinearLayout extends LinearLayout implements Target { public PicassoableLinearLayout(Context context) { super(context); } public PicassoableLinearLayout(Context context, AttributeSet attrs) { super(context, attrs); } public Picasso..
DrawerLayout의 드래그 가능부분(엣지) 변경하기 public void setDrawerLeftEdgeSize( DrawerLayout drawerLayout, float displayWidthPercentage) { try { // find ViewDragHelper and set it accessible Field leftDraggerField = drawerLayout.getClass().getDeclaredField( "mLeftDragger"); leftDraggerField.setAccessible(true); ViewDragHelper leftDragger = (ViewDragHelper) leftDrag..
ViewPager의 Fragment 안에 DrawerLayout 사용시 문제. ViewPager의 Fragment 페이지 안에서 DrawerLayout을 사용할시(ViewPager의 Swap기능은 OFF라고 가정.), 드래그해서 Drawer를 여는 부분에 문제가 생기게 된다. 이유는 ViewPager가 DrawerLayout의 바로 Parent가 되면 발생하는 문제이다. 이때 DrawerLayout을 Root로 지정하지말아야한다. 간단하게 LinearLayout을 Root로 한 후, 바로 아래에 DrawerLayout이 되는 형태를 사용하여야 한다. 예) ViewPager -> Fragment -> LinearLayout -> DrawerLayout -> Content, DrawerView
Android 기기 식별에 대해 Identifying DevicesSuppose you feel that for the needs of your application, you need an actual hardware device identifier. This turns out to be a tricky problem.In the past, when every Android device was a phone, things were simpler: TelephonyManager.getDeviceId() is required to return (depending on the network technology) the IMEI, MEID, or ESN of the phone, which is unique to that piece of har..
Android WebView clearHistory 사용하는 법 WebView에서 History를 지워야할 때 가 있는데 아무곳(필자의 예로써 onBackPressed)에서는 작동을 하지 않습니다. 아니 정확히는 작동을 합니다. 하지만 반드시 WebViewClient의 onPageFinished에 넣어 줘야합니다. 아래는 해당 히스토리를 제거하는 코드입니다. webView.setWebViewClient(new WebViewClient(){ @Override public void onPageFinished(WebView view, String url) { if(isClearHistory){ isClearHistory=false; view.clearHistory(); } super.onPageFinished(view, url); } }); 중략 private void L..
Android WebView 텍스트(Input) 입력시 확대/리사이징 문제 WebView에서 ViewPort Metatag를 가지고 있어도. Form이나 기타 TextField(input)을 입력할때 확대가 되는 버그가 발생하는데. 이때 viewport meta tag의 값을 아래와 같이 설정해 주면 TextField가 Focus되도 확대가 되지 않아 정상적으로(Y스크롤만 진행)됩니다. width=device-width, initial-scale=1.0, user-scalable=no, height=device-height, maximum-scale=1.0, target-densityDpi=device-dpi 참고로 필자는 아래와 같은 WebView 세팅을 설정하였습니다. set.setJavaScriptEnabled(true); set.setJavaScriptCanOpenWin..