Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Samsung multi-window support to Android application

I went and tried to add Samsung's multi-window support for my app following this link. My app did appear in Samsung's multi-window applications tab, and I was able to drag and drop it into the screen, however my app did not behave as multi-window supported app should behave, but instead expanded to full screen.

I think there are some other changes that are need to be made to get it work properly, but I have no idea what. Does anyone have any ideas what could be the problem causing this behaviour?

like image 254
Rohit Malish Avatar asked Jan 01 '13 13:01

Rohit Malish


People also ask

Which option is used to add multiple screens in Android application?

# From your home screen, go to the Apps menu and select any app of your choice. #Once you figure out the app you wish to use in split-screen, tap and hold on that app to open a menu. You will see a list of options in the dropdown menu, click on Split Screen.

Did Samsung take away multi window?

But once you upgrade to Android Pie on your Galaxy smartphone, you might start thinking that Multi Window functionality doesn't exist anymore. Well, it does, but the procedure to start apps in Multi Window has changed on Android Pie.

Does Android support multi screen?

In Android 7.0 and higher, devices can display multiple apps simultaneously using multi-window. Android supports three multi-window configurations: Split-screen is the default multi-window implementation, which provides two activity panes where users can place apps.


2 Answers

This xda-developers forum post contains a step-by-step guide, which I've paraphrased here.

Make sure your manifest contains the following somewhere inside the <application> tag:

<uses-library android:required="false" android:name="com.sec.android.app.multiwindow" /> <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" /> <meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:resource="@dimen/app_defaultsize_w" /> <meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:resource="@dimen/app_defaultsize_h" /> <meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:resource="@dimen/app_minimumsize_w" /> <meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:resource="@dimen/app_minimumsize_h" /> 

For the desired activity, add to its <intent-filter> tag:

<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" /> 

Be sure to define the dimensions above in a resource file.

In the comments section of that blog post a user mentions that the minimum size was causing a problem for him and suggested removing com.sec.android.multiwindow.MINIMUM_SIZE_W and com.sec.android.multiwindow.MINIMUM_SIZE_H.

One user pointed out that specifying the dimensions through a dimension resource didn't work for him; he instead hardcoded the value attribute:

<uses-library android:required="false" android:name="com.sec.android.app.multiwindow" /> <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" /> <meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:value="632.0dip" /> <meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:value="598.0dip" /> <meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:value="632.0dip" /> <meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:value="598.0dip" /> 

I'm afraid I can't try myself as I don't have a Galaxy Note.

like image 187
Paul Lammertsma Avatar answered Oct 08 '22 03:10

Paul Lammertsma


After testing my application on Galaxy Note 3 I found out two more things:

MINIMUM_SIZE and DEFAULT_SIZE only works on MultiWindow for Samsung tablets, not in smartphones.

Also if you want to enable Multi-Instance in your application add this line to your AndroidManifest:

<meta-data
            android:name="com.samsung.android.sdk.multiwindow.multiinstance.enable"
            android:value="true" />
like image 25
Tony Ceralva Avatar answered Oct 08 '22 01:10

Tony Ceralva