본문 바로가기

Development

[Android] Dependency Structure [Android] dependency 구조 보기Requireapk-dependency-graph(https://github.com/alexzaitsev/apk-dependency-graph)apk fileant 1.9.9 or newerat least Java 5 Intstall & Run (For Mac) hyogeun.park@xxxxxxxxxxxxx:~$ xcode-select --installhyogeun.park@xxxxxxxxxxxxx:~$ brew updatehyogeun.park@xxxxxxxxxxxxx:~$ brew install ant// move apk-dependency-graph directoryhyogeun.park@xxxxxxxxxxxxx:~$ anthyogeun.park@xx.. 더보기
[Android] android.content.ActivityNotFoundException [Android] android.content.ActivityNotFoundExceptionProblem : AndroidManifest.xml에 Activity 항목을 추가를 안해서 에러가 발생 android.content.ActivityNotFoundException: Unable to find explicit activity class {kr.co.xxxx .viewtest/kr.co.xxxx.viewtest.BlogActivity}; have you declared this activity in your AndroidManifest.xml? at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1820) at an.. 더보기
[Android] View Collapse & Expand Animation Collpase & Expand AnimationCollpase/Expand UI를 만들 때, Animation을 주는 방법TransitionManager를 이용하면 간단하게 만들 수 있다! TransitionManager.beginDelayedTransition(ViewGroup, Transition) // ViewGroup은 root view를 넣어주면 된다.Transition의 종류Android 5.0(API 레벨 21) 이하에서 사용할 경우AutoTransition() : Android가 자동으로 Animation을 설정ChangeBound() : Collpase/Expand AnimationAndroid 5.0(API 레벨 21) 이상일 경우(위 2개 포함)는 아래 주소 참조 https://de.. 더보기
[Android] ViewPager & Fragment ViewPager & Fragment.md ViewPager & Fragment Fragment를 사용하는 것 중에 하나가 ViewPager와 같이 사용하는 것이다.(보통 TabLayout과 같이 사용하는데 이번에는 TabLayout는 다루지 않는다.)기본 예제(Basic)activity_basic.xml ​ fragment_basic.xml ​ BasicActivity public class BasicActivity extends FragmentActivity {​ @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.a.. 더보기
[Android] Debug & Release 동시에 두개 설치하기 Debug와 Release 두 개로 설치하기1. Introductionpackage name을 다르게하면 debug와 release를 동시에 설치할 수 있다. 2. package name에 'debug' 추가하기• build.gradle(app)... ​ buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { applicationIdSuffix ".debug" // 이 부분을 추가하면 release와 별개로 debug 앱이 설치된다. } } ... 3. App name 변경하기strings.xml에 있는 app_name.. 더보기
[Android] Handler & Looper [Handler & Looper] android.os.Looper오직 한개만 있는 메시지 발송자 android.os.Message데이터나 태스크 두가지 중 하나만 옮기는 컨테이너 객체 데이터 메시지 태스크 메시지 여러 개의 매개변수를 담는 메시지(what, [arg1, arg2], obj, data, replyTo, callback) java.lang.Runnable만 포함하고 데이터는 포함하지 않는다. android.os.MessageQueue처리할 메시지들이 담긴 무제한의 연결 리스트. 모든 루퍼와 스레드는 최대 하나의 메시지 큐를 가짐. android.os.Handler큐에 메시지를 삽입 & 메시지 처리 >> 관계도 출처 : Efficient Android Threading(출판사 : 한빛미디어) 더보기
[Android] Google Play Store로 이동시키기 Google Play Store로 이동시키기앱 리뷰 남기기 위한 유도 팝업(MaterialDialog 사용)app/build.grade dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile('com.github.afollestad.material-dialogs:commons:0.8.5.5@aar') { transitive = true } ...} Source public void goPlayStore(String content, String positiveText, String negativeText) { new MaterialDialog.Builder(ReviewActiv.. 더보기
[Android] 선택 되었을 때 Text Color 바꾸기 Change Select Text Color(TextView, Button).md Change Select Text Color(TextView, Button)drawable를 만들지 않고 select text color 변경하기(Util)TextView나 Button에서 press나 select 되었을 때, text color를 바꾸려면 아래와 같이 drawable에 selector를 만들어 줘야한다. 그리고 여러 색을 사용할 경우 사용할 때마다 selector를 만들어 줘야한다. xxxxxxxxxx6123 4 5 6그래서, 코드에서 함수로 만들었습니다.(Util같은 곳에 추가해서 사용하시면 될 것 같습니다.)(단, Button과 TextView만 해놓았습니다. 추가하시려면 if문 조건대로 추가하시면 됩.. 더보기
[Android] Square ImageView (정사각형 ImageView) Square ImageView(Custom) → 프로필 사진이나 기타 사진등을 정사각형으로 보여주기 위해 만들게 됨(특히 LinearLayout에서 비율로 보여줄때) Source Code → 기준(mFit)을 입력 받아 onMeasure함수에서 기준에 따라 크기를 정함. 1) SquareImageView.javaimport android.content.Context; import android.support.annotation.Nullable; import android.text.TextUtils; import android.util.AttributeSet; public class SquareImageView extends android.support.v7.widget.AppCompatImageView .. 더보기
[Android] Spannable [ Spannable ] : TextView를 여러 개 쓰지 않아도 하나의 TextView에서 해당 text를 부분적으로 바꿀 수 있다. SpnnableUtils.javaimport android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.style.AbsoluteSizeSpan; import android.text.style.ForegroundColorSpan; import android.text.style.RelativeSizeSpan; /** * Created by gpark on 2017-01-31. */ public class SpannableUtils { /** * @param text : 적용.. 더보기