Android manifest that will support Galaxy S4, HTC One

[亡魂溺海] 提交于 2019-12-02 01:39:26

问题


Im trying to create Android manifest that Google Play will show to Samsung Galaxy S4, HTC One and so on since current one doesn't list those in compatible devices list.

I did search Stack Overflow, but all advices here didn't help me. Below is manifest that I am using for our app...

We tried also to remove complete <compatible-screens> and leave only <support-screens> but still no-go...

Thanks in advance

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.application.testapp"
android:versionCode="4"
android:versionName="1.01c"
android:installLocation="auto" >
<uses-sdk android:minSdkVersion="8"  android:targetSdkVersion="17"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<supports-screens 
android:anyDensity="true" 
android:largeScreens="true"
android:normalScreens="true" 
android:smallScreens="true"
android:xlargeScreens="true" 
android:resizeable="true" /> 
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<screen android:screenSize="small" android:screenDensity="480" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
<screen android:screenSize="normal" android:screenDensity="480" />
<!-- all large size screens -->
<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<screen android:screenSize="large" android:screenDensity="480" />
<!-- all xlarge size screens -->
<screen android:screenSize="xlarge" android:screenDensity="ldpi" />
<screen android:screenSize="xlarge" android:screenDensity="mdpi" />
<screen android:screenSize="xlarge" android:screenDensity="hdpi" />
<screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
<screen android:screenSize="xlarge" android:screenDensity="480" />
</compatible-screens>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:theme="@android:style/Theme.Light">
<uses-library android:name="com.google.android.maps"/> 
<activity 
android:name=".Main"
android:label="@string/app_name" android:theme="@android:style/Theme.Light.NoTitleBar" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".SplashScreen" android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity>
<activity android:name=".ActivityProducst" android:theme="@android:style/Theme.Light.NoTitleBar" android:screenOrientation="portrait"/>
<activity android:name=".ActivityDetails" android:theme="@android:style/Theme.Light.NoTitleBar" android:screenOrientation="portrait"/>
<activity android:name=".ActivityNews" android:theme="@android:style/Theme.Light.NoTitleBar" android:screenOrientation="portrait"/>
<activity android:name=".ActivityImage" android:theme="@android:style/Theme.Light.NoTitleBar" android:screenOrientation="portrait"/>
<activity android:name=".ActivityAbout" android:theme="@android:style/Theme.Light.NoTitleBar" android:screenOrientation="portrait"/>
</application>
</manifest>

回答1:


in my app i use this manifest (i changed the package and activity names):

<?xml version="1.0" encoding="utf-8"?>
<manifest 
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.blabla"
    android:versionCode="8"
    android:versionName="1.6">

    <uses-sdk android:minSdkVersion="7" 
              android:targetSdkVersion="18"/>

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

    <application 
        android:icon="@drawable/ic_launcher" 
        android:label="@string/app_name">

        <activity
            android:label="@string/app_name"
            android:name="com.blabla.Activity"
            android:configChanges="orientation" >

            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>

        <activity
            android:label="@string/app_name"
            android:name="com.blabla.Optionen" >
        </activity>

    </application>
</manifest>

And the Google Play store says that it is compatible with > 4000 devices, HTC One an SGS4 are included.

I hope i understand your question right.




回答2:


You can do this configurations on Android Developer Console, which will publish the app to only the devices you select.




回答3:


I hope you are looking for this,

Change this in Manifest

<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:xlargeScreens="true"        
/>

Only, this won't help. You want different image sizes, different layouts for different resolutions.

Edit:

http://developer.android.com/guide/practices/screens_support.html

You have to add differnt folder for different layout in res folder --> hdpi,mdpi,ldpi and for large screens you xhdpi(for Tablet) and large-hdpi or xlarge (for NXzoom). and also set Images and textsize different in different layout as per screensize.



来源:https://stackoverflow.com/questions/19380811/android-manifest-that-will-support-galaxy-s4-htc-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!