子持ちプログラマーの日記

子持ちのプログラマーがWeb関連の技術、育児、ガンプラのことを書くブログ

Android

端末の画面サイズを取得

端末の画面サイズを取得するには以下のソースで取得可能。 WindowManager wm = (WindowManager)getSystemService(WINDOW_SERVICE); Display disp = wm.getDefaultDisplay(); int width = disp.getWidth(); int height = disp.getHeight();

一番上のViewを取得する方法

IDを指定すればいいのですが、IDを指定せずに取得する方法があったのでメモ ViewGroup decor = (ViewGroup)this.getWindow().getDecorView(); View a = (View)decor.getChildAt(0);※Viewは、layout.xml内のもの(デフォは、LinearLayoutクラスかな?)に合わせ…

Androidその1 概要・環境設定

概要 開発はJAVA Marketに登録するには初回$25必要 開発環境設定 JDK6 Eclipseに同梱しているので必要ない Eclipse3.5(Ultimate) http://mergedoc.sourceforge.jp/ AndroidSDK http://developer.android.com/sdk/index.html 各種設定 Eclipseを任意の場所に…