레이블이 Development인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Development인 게시물을 표시합니다. 모든 게시물 표시

2011년 10월 11일 화요일

Debug certificate expired problem

debug.keystore 파일의 cerificate 가 만료되어 발생하는 디버그 오류 (인증기간이 생성일로부터 1년이다).

이클립스 기준으로

Window > Andorid > Build 에서 debug.keystore의 파일 위치 확인 후 삭제하면 해결됨!

프로젝트를 다시 빌드하면 debug.keystore를 알아서 다시 생성해준다.

2011년 4월 16일 토요일

Custom title bar 만들기 2

2. NoTitleBar 테마 적용 후 title레이아웃 정의 후 배치

(AndroidManfest.xml)

<activity android:name="Settings"
            android:label="@string/sync_settings"
            android:theme="@android:style/Theme.NoTitleBar"/>

(screen_sample.xml)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <include layout="@layout/title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

정의한 title을 레이아웃에 include해준다.

Custom title bar 만들기 1

1.테마 적용하는 방법

(styles.xml)

<resources>
 <style name="CustomTitleTheme" parent="android:Theme">
  <item name="android:windowTitleSize">50dip</item>
  <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item>
 </style>

 <style name="WindowTitleBackground" parent="android:WindowTitleBackground">
  <item name="android:background">@android:color/transparent</item>
 </style>
</resources>

타이틀바 높이를 50dip로 배경은 투명하게 스타일 정의

(AndroidManfest.xml)

<application android:icon="@drawable/icon" android:label="@string/app_name"
     android:theme="@style/CustomTitleTheme">

안드로이드 매니페스트에 정의한 테마적용

public class CustomTitle extends Activity {

   
/**
     * Initialization of the Activity after it is first created.  Must at least
     * call {@link android.app.Activity#setContentView(int)} to
     * describe what is to be displayed in the screen.
     */

   
@Override
       
protected void onCreate(Bundle savedInstanceState) {
       
super.onCreate(savedInstanceState);

        requestWindowFeature
(Window.FEATURE_CUSTOM_TITLE);
        setContentView
(R.layout.custom_title);
        getWindow
().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title_1);
        .......
    }
}


액티비티에 커스텀 타이틀 레이아웃을 적용하면 끝

2010년 10월 15일 금요일

Caliper

Microbenchmarking framework for Java

Caliper is Google's open-source framework for writing, running and viewing the results of JavaMicrobenchmarks.

http://code.google.com/p/caliper/

2010년 10월 14일 목요일

Inkscape v0.48

 Inkscape is a vector graphics editor application. Its stated goal is to become a powerful graphic tool while being fully compliant with the XML, SVG and CSS standards.

 일러스트레이터 정품이 비싸서 대체하기 좋은 벡터 프로그램이다.

GIMP 2.6.11

 The GNU Image Manipulation Program, or GIMP, is a raster graphics editor used to process digital graphics and photographs.

 포토샵 정품이 80~120만원하는 관계로 GIMP를 사용해보자!

2010년 10월 12일 화요일

AppWidgetProvider 와 BroadcastReceiver

AppWidgetProvider에서 Intent계열 Action은 registerReceiver()를 호출하면 에러가 난다.
AndroidManifest.xml에도 intent-filter를 등록해도 제대로 동작하지 않는다.
내가 내린 결론은 AppWidgetProvider에선 AppWidgetManager에 있는 Action만 Broadcast가 가능한 것 같다.
AppWidget제작시 자연스레 Service가 필요한 것 같다.
하지만 사용자가 강제종료하는 경우가 많아 Service가 죽으면 Widget이 제대로 동작하지 않는다.

2010년 10월 2일 토요일

Android Application Fundamentals

http://developer.android.com/guide/topics/fundamentals.html

안드로이드 Fundamental에 대해 설명된 페이지다.
생각보다 알찬 정보가 많다.
보통 책에서도 앞장에서 많이 설명하기는 한데 안드로이드에 대한 경험없이 읽으면 놓치기 쉽다.
필독할 필요가 있는듯!

Notification의 Pending Activity 단일로 실행되게 하기

AndroidManifest.xml에 Activity를 정의할 때 launchMod를 singleTask로 지정하면 된다.

<activity android:name=".SampleActivity" android:launchMode="singleTask" />

안드로이드 ListView에서 리스트 끝에 오면 자동으로 데이터를 추가하고 싶을 때

ListView에서 리스트의 끝에 오면 자동으로 데이터를 추가해서 갱신하고 싶었는데
ListView에 OnScrollListener를 등록해서 해결했다.

OnScrollListener의 onScroll메소드를 재정의하면 된다.

new OnScrollListener() {
  
   @Override
   public void onScrollStateChanged(AbsListView view, int scrollState) {}
  
   @Override
   public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
    if(totalItemCount > 0 && firstVisibleItem + visibleItemCount == totalItemCount) {
      //데이터 처리
    }
   }
}

안드로이드 유튜브 내부 Uri 주소

어플리케이션에서 유튜브 동영상을 재생하고 싶을 때
폰에 내장된 유튜브 어플리케이션을 이용해 재생하면 쉽게 재생할 수 있다.

내부 유튜브 Uri 주소 : vnd.youtube:XXXXX (유튜브 video id)

ex)
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:" + videoId));
startActivity(intent);

당연히 에뮬레이터에서는 돌아가지 않으며 폰에서만 확인할 수 있다.