본문 바로가기

프로그래밍/Android 짜투리 지식

[android] google analytics 에 대해 알게 된 것들. Dispatch1. dispatch는 analytics.xml의 ga_dispatchPeriod 값을 세팅하면된다.2. ga_dispatchPeriod 의 단위는 sec다.3. dispatch는 Dispatcher class(Abstract)에 의해 실행되고, 한번에 최대 40개의 hit을 불러온다.4. Dispatch는 http 통신이다. 5. Dispatch는 for 반복에 의해 순차적으로 진행된다.6. Dispatch는 pending 된다. Log1. Log는 LogLevel에 따라 보여진다.2. v3 에서 Default level 은 warning이다. 더보기
[android] google Analytics google analytics google analytics를 처음 접했을때는 이걸 어떻게 해야하는지 감도 않오고, api는 수시로 바뀌고 method들은 시도때도없이 deplicate되어서 뭐가 뭔지 감도 잘 안왔다.그런데 막상 알아가보면 너무나도 간단하다. 1. 뭐할때 쓰나 - 특정 View(activity)에 대한 표시 - 특정 Event에 대한 표시 2. 범위는? - app version(androidmanifest.xml에 있는 version code) - 기기 모델 - os version - 등등 3. 어디서 보면되나 http://www.google.com/analytics/ android reference : https://developers.google.com/analytics/devgui.. 더보기
[android] listView의 touch 순서를 바꾸고자 할때 보통은 listview -> child item 순서인데descendantFocusability 로 해결가능본문Defines the relationship between the ViewGroup and its descendants when looking for a View to take focus.Must be one of the following constant values.ConstantValueDescriptionbeforeDescendants0The ViewGroup will get focus before any of its descendants.afterDescendants1The ViewGroup will get focus only if none of its descendants want it.. 더보기
[android] facebook multi image swipe facebook의 swipe ImageView 사진 좌우로 이미지가 있음을 알려주고, 좌우 스와이프가 가능한ViewFlow를 약간 수정해서 작성했다.ViewFlow sample에 교체하면된다.titleindicator와 sync는 안맞음.. viewpager 에서 slide 조정http://stackoverflow.com/questions/13194666/how-to-set-viewpager-size 더보기
[android] imageView.setColorFilter imageView.setColorFilter(0xFF2899D5, Mode.MULTIPLY); 더보기
[android] TextView 부분색상 String str = "검정 빨강 검정";하면 검정 빨강 검정 이 됩니다.는 즉, html로 빨강 이 된다. TextView txt = new TextView(context);txt.setText(Html.fromHtml(str)); 현재 string이 html 폼을 가진다고 해주면 된다. String str = "검정 빨강 검정";TextView txt = new TextView(context);txt.setText(Html.fromHtml(str)); 더보기
[android] 연속적 이미지 보여주기(gif효과) 3.0 허니콤 이하 imgGif = (ImageView)findViewById(R.id.img_gif); aim = (AnimationDrawable) imgGif.getBackground(); imgGif.post(new Runnable() { @Override public void run() { aim.start(); } }); 허니콤 이상 AnimationDrawable frame = (AnimationDrawable)imgGif.getBackground(); if(frame.isRunning()) { frame.stop(); } else { frame.stop(); frame.start(); } animation define .xml 더보기
[android] 제자리에서 도는 애니메이션 주소록에 sync 맞추기 위해 작성한 애니메이션Animation anim = new RotateAnimation(360, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);anim.setDuration(1000); anim.setStartOffset(0); //anim.setFillEnabled(true); // animation 종료 후, 뷰의 위치를 유지하는 것을 컨트롤 할것인가 //anim.setFillAfter(true); // animation 종료 후, 뷰의 위치를 유지하겠는가 anim.setInterpolator(AnimationUtils.loadInterpolator(mOwnerActivity.getApplicat.. 더보기
[androd] animation 적용 Interpolator 사용 시 두가지 애니메이션을 혼용하는 방법1. animationSet.addAnimation2. setStartOffset1번의 경우 setInterpolator를 animationSet에다 해줘야됨 package sun.toy.animations; import sun.toy.R; import sun.toy.parents.ToyActivity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListene.. 더보기
[android] toast text 위치 toast 를 사용할 때 TEXT가 한쪽에 치우쳐 지는 경우가 있다. 바로 글자가 toast의 초기 사이즈 보다 작을 경우.. 왼쪽이라던가, left라던가, 왼쪽이라던가..어떻게 해야하나? gravity 를 조정하든, margin을 조정하든 하면된다.margin은 변수이니 상수인 gravityf르 사용하자.toast의 뷰의 형태는toast - LinearLayout - TextView 이다. LinearLayout 의 Gravity 를 center 로 둬 보자. 그럼 정상적으로 나온다. 더보기