I’m writing a program for android. I read that the layout-swNdp notation could be used only on SDK 13 level ..But I want the app to adapt to screens 540×960 also on older android versions..like 2.0 2.2
It’s possible to do this without using the layout-swNdp folder ?
I’m writing a program for android. I read that the layout-swNdp notation could be
Share
If you want to do that programatically, you can get the height and width with the Display object:
And get the current API level with:
And then you can use a specific layout for those devices by calling
setContentView()under an if condition:Hope that helps!