Canvas에서 Matrix를 이용하여 화면의 회전, 이동, 스케일 조정이 가능하다.
Posted by 암리타 :

public CountDownTimer (long millisInFuture, long countDownInterval)
millisInFuture : 카운트 할 시간
countDownInterval : interval후에 onTick 호출

CountDownTimer 시작 : timer.start();
CountDownTimer 종료 : timer.cancel();

아래 예제는 1초 간격으로  6초동안 진행된다.
public CountDownTimer timer = new CountDownTimer(6000, 1000) {

	@Override
	public void onFinish() {
		//TODO : 카운트다운타이머 종료시 처리
	}

	@Override
	public void onTick(long millisUntilFinished) {
		//TODO : 카운트다운타이머 onTick구현
	}
};


Posted by 암리타 :
// 안드로이드 네트워크 연결상태 확인 (Mobile/Wifi) 
ConnectivityManager manager = 
	(ConnectivityManager) getSystemService (Context.CONNECTIVITY_SERVICE);

// 3G(모바일 네트워크) 연결 상태 
boolean isMobile = 
	manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnectedOrConnecting();

// Wifi 네트워크 연결 상태 
boolean isWifi = 
	manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnectedOrConnecting
Posted by 암리타 :
안드로이드의 raw, asset 폴더의 개별 파일의 크기가 1MB 이상인 경우 Data exceeds UNCOMPRESS_DATA_MAX 에러가 발생한다.
해당 파일의 확장자를 변경하여 해결할수 있다.

Data exceeds UNCOMPRESS_DATA_MAX
It seems that android has put a limit of 1 MB on the size of the files that yo can put in your asset folder, which can be accessed through the Context. The reason for this is the "aapt" tool that Android uses to compress files into your apk install file. 

Eclipse doesn't not allow one to set complier options such as "aapt -0". One would have to edit the Ant file that Android uses or manually build the apk package from scratch which is the work that Ant would do.

I tried copying my 1.5 MB file to a raw folder but that didn't seem to work. Ultimately I used one of the following file extensions which are not compressed by default by the "aapt" command. These are:

/* these formats are already compressed, or don't compress well */
static const char* kNoCompressExt[] = {
".jpg", ".jpeg", ".png", ".gif",
".wav", ".mp2", ".mp3", ".ogg", ".aac",
".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",
".rtttl", ".imy", ".xmf", ".mp4", ".m4a",
".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",
".amr", ".awb", ".wma", ".wmv"
};

My application is now working fine with the large_file.jet extension from the assets folder.
출처 : http://www.nutprof.com/2010/12/data-exceeds-uncompressdatamax.html
Posted by 암리타 :
public TimerTask myTimer = new TimerTask() {
	public void run() {
		Log.d("neo", "run timer");
	}
};

timer = new Timer();
timer.schedule(myTimer, 500, 1000);


public void schedule (TimerTask task, long delay, long period)

timer.schedule 설명
TimerTask : 작업할 내용
delay : 몇 ms 후에 호출할 것인지
period : 몇 ms 간격으로 호출한것인지

[원문]
task the task to schedule.
delay amount of time in milliseconds before first execution.
period amount of time in milliseconds between subsequent executions.
Posted by 암리타 :

이클립스에서 에뮬레이터로 데이터 전송시 java.io.IOException: Unable to upload file: null 오류가 발생할 경우는 apk 파일의 크기가 커서 파일 전송시 문제가 발생한 경우이다.
이클립스 메뉴의 Window -> Preferences -> Android -> DDMS -> "ADB connection time out (ms) 값을 크게 잡으면 문제가 해결된다.
Posted by 암리타 :
안드로이드 Landscape / Portrait 모드

화면 자동 회전이 되는 경우 screenOrientation항목을 설정하여 자동 화면 회전이 되지 않도록 설정한다.

Manifest.xml에서 screenOrientation항목을 설정해준다.

<activity android:name=".Main" android:screenOrientation="portrait"></activity>


코드상에서 
Landscape / Portrait 변환 해주는 경우
onConfigurationChanged() 사용

emulator 화면 전환 키
Ctrl + F11
Posted by 암리타 :
1. HangulKeyboard.apk 파일을 다운 받는다.
2. 안드로이드 SDK  설치 경로의 tools 폴더에 1번 파일을 복사한다.
3. 윈도우 실행창에서 cmd를 실행하여 안드로이드 SDK tools 폴더로 이동한다.
4. 다운로드 받은 apk 파일을 설치한다.

c:\Android\android-sdk-windows\tools> adb install HangulKeyboard.apk

5. 안드로이드 에뮬레이터를 실행한다.
6. 첫화면에서 [메뉴버튼]-[설정]-[언어 및 키보드]를 선택한다.
7. Android 키보드와 한글 접촉식 키보드를 선택한다.
8. 구글 검색창에서 한글 자판이 보이는 지 확인한다.

Posted by 암리타 :