2011년 5월 10일 화요일

Live Wallpaper 미리보기인지 아닌지 확인

WallpaperService.Engine의 

isPreview() 함수로 확인이 가능합니다.

if(isPreview()){
    Log.d("DEBUG","현재 미리보기 실행 중입니다.");   
}else{
    Log.d("DEBUG","실제 배경화면이 실행 중입니다."); 

}
 

2011년 5월 6일 금요일

갤러리 호출하여 이미지를 선택하고 받아오는 방법

갤러리 관련 제어
 - 내장되어 있는 갤러리를 호출하여 사진을 선택 후 내가 어떤 사진을 선택했는지 URI로 가지고 데이터를 설정한다. 
 
 - 갤러리 리스트뷰 호출 
Intent i = new Intent(Intent.ACTION_PICK);
i.setType(android.provider.MediaStore.Images.Media.CONTENT_TYPE);
i.setData(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); // images on the SD card.

// 결과를 리턴하는 Activity 호출
startActivityForResult(i, REQ_CODE_PICK_PICTURE);
 - 갤러리 리스트뷰에서 사진 데이터를 가져오는 방법
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQ_CODE_PICK_PICTURE) {
if (resultCode == Activity.RESULT_OK) { 
ImageView img = (ImageView)findViewById(R.id.image);
img.setImageURI(data.getData()); // 사진 선택한 사진URI로 연결하기 
}
}





Bold 지정

TextViewObject.setTypeface(Typeface.DEFAULT_BOLD, Typeface.BOLD);

2011년 5월 5일 목요일

Android Dialog

http://mainia.tistory.com/555


private void DialogSimple(){
 AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);
 alt_bld.setMessage("Do you want to close this window ?").setCancelable(
  false).setPositiveButton("Yes",
  new DialogInterface.OnClickListener() {
  public void onClick(DialogInterface dialog, int id) {
   // Action for 'Yes' Button
  }
  }).setNegativeButton("No",
  new DialogInterface.OnClickListener() {
  public void onClick(DialogInterface dialog, int id) {
   // Action for 'NO' Button
   dialog.cancel();
  }
  });
 AlertDialog alert = alt_bld.create();
 // Title for AlertDialog
 alert.setTitle("Title");
 // Icon for AlertDialog
 alert.setIcon(R.drawable.icon);
 alert.show();
}

Design a God of War III Inspired Cracked Text Effect in Photoshop



http://www.psdvault.com/inspirations/design-a-god-of-war-iii-inspired-cracked-text-effect-in-photoshop/

Create a Funky Retro Wavy Text Effect in Photoshop



http://designinstruct.com/text-effects/create-a-funky-retro-wavy-text-effect-in-photoshop/

Create Stone Text Inside Water Using The Filter Gallery



http://www.psawesome.com/tutorials/create-stone-text-inside-water-using-the-filter-gallery