[Android] 壁紙関連API

| トラックバック(0) |

壁紙を設定するには、setWallpaper() を呼び出すのは、あまりにも有名として、

その他のAPIも紹介。

  • getWallpaperDesiredMinimumWidth() ・・・壁紙の幅取得:HT-03Aだと640pixel
  • getWallpaperDesiredMinimumHeight() ・・・壁紙の高さ取得:HT-03Aだと480pixel
  • setWallpaper() ・・・壁紙設定(android.permission.SET_WALLPAPERが必要)
  • clearWallpaper() ・・・壁紙初期化

 

サンプルソースコード

int w = getWallpaperDesiredMinimumWidth();
int h = getWallpaperDesiredMinimumHeight();
setWallpaper(x); // You can set wallpaper from InputStream or Bitmap
clearWallpaper(); // You can reset wallpaper to default

 

あわせて読みたい

関連記事

トラックバック(0)

トラックバックURL: http://mt.adakoda.com/mt-tb.cgi/293

Android Advent Calendar 2011

2012年2月

      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29