2013-07-07 44 views
1

應用程序開發人員可以爲運行android的任何設備開發多窗口應用程序嗎?我不確定是否僅限Android操作系統(某些版本)支持此操作?還是隻有三星專有? 如果它可以爲運行android的任何設備開發,建議如何開始做這件事?支持多窗口應用程序開發

回答

8

任何人都可以做到。您的活動屏幕區域縮小了。

您可以使用資源限定符爲這些實例選擇不同的佈局。 參見:http://developer.android.com/guide/topics/resources/providing-resources.html#ScreenHeightQualifier

下面是一個支持多窗口支持的AndroidManifest.xml示例。

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

    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> 

    <application 
     android:allowBackup="true" android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" android:theme="@style/AppTheme" 
     > 
     <uses-library android:name="com.sec.android.app.multiwindow" android:required="false" /> 
     <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" /> 
     <activity android:name=".MainActivity" android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
       <category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 
</manifest> 

這僅適用於三星提供的版本。

請官方Android 7.0(APIv24)支持read the docs here

+0

你說的是同時運行(比如說)兩個應用程序(比如一個運行在上半部分,另一個運行在屏幕的下半部分)?我指的是這種情況。 – trish

+1

我編輯了我的答案,包含一個包含更改的示例清單文件,以便FlashBarService可以將您的應用程序檢測爲啓用多窗口。 – Simon

相關問題