Android smartPhone app support for Android Tablet

后端 未结 2 1646
南笙
南笙 2021-01-22 05:55

I am creating an application in Android. Originally i was making it only for smartphones but now i want that same app to uspport for Android Tablet. The problem is of scaling. I

2条回答
  •  一整个雨季
    2021-01-22 06:39

    You want to read this piece of the manual: http://developer.android.com/guide/practices/screens_support.html

    (please, do read it!)

    But you could try adding the screen support in your androidmanifest.xml:

    The platform also provides a manifest element, whose attributes android:smallScreens, android:normalScreens, android:largeScreens, and android:xlargeScreens let you specify what generalized screen sizes your application supports.

    making it look like this:

    
        
        ...
    
    

    The screen-support page also states this: (emph mine)

    Maintain compatibility with existing devices by leaving your application's android:minSdkVersion attribute as it is. You do not need to increment the value of the attribute to support new devices and multiple screens. Extend compatibility for Android 1.6 (and higher) devices by adding a new attribute — android:targetSdkVersion — to the uses-sdk element. Set the value of the attribute to "4". [To support xhdpi and xlarge screens, set the value to "9".] This allows your application to "inherit" the platform's multiple screens support, even though it is technically using an earlier version of the API.

    So the sollution as to update the minSdkVersion seems to be unwanted for the most general case. If you have '3' as a minSdkVersion for your situation, leave it at that, but add the targetSdkVersion for compatibility.

提交回复
热议问题