Build.Version.SDK 를 하면 해당 문구가 적용된 휴대폰의 SDK 버전을 알려줌.
예제소스:
package com.test.CheckSDKVersion;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.widget.Toast;
public class TestCheckSDKVersionActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Toast.makeText(getApplicationContext(), "my Phone SDK Version:"+Integer.parseInt(Build.VERSION.SDK), Toast.LENGTH_LONG).show();
}
}
'스터디 > Android+Java' 카테고리의 다른 글
Android AudioTrack 스피커 출력 디바이스 설정 (2011.11.07) (0) | 2017.10.07 |
---|---|
Android Device Info (2011.10.20) (0) | 2017.10.07 |
Android AudioFX (2011.10.09) (0) | 2017.10.07 |
Android APK Decomplie (2011.09.12) (0) | 2017.10.07 |
Android Toast 메세지 사용방법 (2011.08.06) (0) | 2017.10.07 |
댓글