Jump to content


Recent Columns

  • James Norton's Photo
    The James Norton Column: MoDaCo reviews and battery tests

    The James Norton column

  • James Norton's Photo
    The James Norton Column: Camera Shoot-out

    The James Norton column

  • James Norton's Photo
    The James Norton Column: The MoDaCo Man

    The James Norton column


Recent Articles

  • icon
    The MoDaCo last-minute gift guide

    PaulOBrien -

  • icon
    Decrypt and (optionally) add double-tap to wake on your Nexus 6

    PaulOBrien -

  • icon
    Sonim XP7 Extreme hits crowdfunding target + Ask MoDaCo

    PaulOBrien -

  • icon
    MMW 89 - Does it spring?

    PaulOBrien -

  • icon
    MMW 88 - So much to discuss

    PaulOBrien -

  • icon
    Motorola Moto G 2nd Gen Review

    Mark Dearlove -


Recent Article Comments

  • PaulOBrien's Photo
    The MoDaCo last-minute gift guide

    PaulOBrien -

  • hecatae's Photo
    Sonim XP7 Extreme hits crowdfunding target + Ask MoDaCo

    hecatae -

  • PaulOBrien's Photo
    Decrypt and (optionally) add double-tap to wake on your Nexus 6

    PaulOBrien -

  • 8eaker's Photo
    LG G Watch R Review

    8eaker -

  • dakarli's Photo
    Motorola Moto G 2nd Gen Review

    dakarli -

  • andybarker's Photo
    Nexus 9 Review

    andybarker -


Recent Topics

  • Bayclove's Photo
    How to root ZTE Kis 3 Max - Mediatek

    Bayclove -

  • erega74's Photo
    Evolve Theme Destoria Blue

    erega74 -

  • PaulOBrien's Photo
    The MoDaCo last-minute gift guide

    PaulOBrien -

  • karec91's Photo
    CoolUI text wrap problem

    karec91 -

  • cypher007's Photo
    how do in get games working? world of tanks won't work

    cypher007 -

  • FlexiPack's Photo
    Thinking of buying a Hudl 2 - could you answer a few questions?

    FlexiPack -


Recent Replies

  • hajj_3's Photo
    Huawei G620s support?

    hajj_3 -

  • gribley's Photo
    How to root your Hudl 2

    gribley -

  • clickmeplz's Photo
    [KK] [4.4.4] CyanogenMod 11.0 [ROM] [ALL] [WEEKLY BUILDS ON FRIDAY]

    clickmeplz -

  • farfix's Photo
    [ROM][4.1.1][B209] AOSP MOD [09/12/2014]

    farfix -

  • tmsiqueira's Photo
    User reported problems for Liquid and Mourta kernel goes here.

    tmsiqueira -

  • aimanmahir's Photo
    [ROM][CM10.1] favaroooo B4 09/05/2013

    aimanmahir -


Sponsored Links



- - - - -

Developers: Add support for Samsung Multi Window to your apps


Samsung's neat Multi Window functionality is making it's way into the wild... first with the Galaxy Note 2 and with the Galaxy S III to follow. This is great, but the downside is that not many apps support the functionality as yet. Developers - here's what you need to do to your app to add support!

It's actually rather easy. In your AndroidManifest.xml, do the following...
  • Make your application appear in the Multi Window bar. Add the MULTIWINDOW_LAUNCHER intent category to your application's main launcher activity... so just below your 'android.intent.category.LAUNCHER' line, add:

    <category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
  • Indicate you're using the Multi Window library. Include the following just before your </application> close tag:

    <uses-library required="false" name="com.sec.android.app.multiwindow"> </uses-library>
  • Add the metadata to indicate your application is Multi Window compatible. Add the following metadata again just before your </application> close tag:

    <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
  • Specify the default window size. You should specify the default sizes for your Multi Window configuration using the additional metadata tags / dimens.xml entries below. The dimens.xml values below show the default values taken from Samsung's Gallery application, adjust for your needs if necessary. ;) Add the metadata again just before the </application> close tag:

    <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" />

    and in your dimens.xml:

    <dimen name="app_defaultsize_w">632.0dip</dimen>
    <dimen name="app_defaultsize_h">598.0dip</dimen>
    <dimen name="app_minimumsize_w">632.0dip</dimen>
    <dimen name="app_minimumsize_h">598.0dip</dimen>
And that's it! Simple eh? Note that you will need to reboot your device for a newly added Multi Window app to appear in the bar.

P

Posted Image

About the author

PaulOBrien's Photo
Paul O'Brien founded MoDaCo in 2002 as a site focused on Windows Smartphones and has grown it since then by concentrating on providing a friendly community for both experienced and beginner mobile enthusiasts.

  • 0


11 Comments

and it is really that easy.
    • 0
@dimen/app_defaultsize_w and the others dont seem to be in the system variables.. I am getting a "No resource found.." error message. Do you have to have those defined somewhere in strings.xml or dimen.xml?
    • 0
Yes, see above, there's a dimens.xml change...

P
    • 0
Hi, I had add the modify into my project. My app icon can show in the Multi-Window Launcher, however I cannot use my app with "multi" mode. When I drop my app icon into the other app, it always shows in full screen mode.
    • 0
Is there any way to test this without having a Note 2? I would add it to my app but I don't want to risk realising a broken implementation.
    • 0
Thanks for the notes to support Galaxy Notes :-)

Minor note for Eclipse users . . . .

Need to change from:
<uses-library required="false" name="com.sec.android.app.multiwindow"> </uses-library>

To this:
<uses-library android:required="false" android:name="com.sec.android.app.multiwindow"> </uses-library>

    • 0
I've used this and also persuaded the LastPass devs to do this. However, in both the case of the LastPass and my app (Who's Got What) when moving the divider it always jumps straight to the top or bottom of the screen and can't be moved. Is this an issue with the dimensions? Or something else?
    • 0
I had the same problem with the divider. I removed the two entries:
[color=#000088]<meta-data[/color] [color=#660066]android:name[/color][color=#666600]=[/color][color=#008800]"com.sec.android.multiwindow.MINIMUM_SIZE_W"[/color] [color=#660066]android:resource[/color][color=#666600]=[/color][color=#008800]"@dimen/app_minimumsize_w"[/color] [color=#000088]/>[/color]

[color=#000088]<meta-data[/color] [color=#660066]android:name[/color][color=#666600]=[/color][color=#008800]"com.sec.android.multiwindow.MINIMUM_SIZE_H"[/color] [color=#660066]android:resource[/color][color=#666600]=[/color][color=#008800]"@dimen/app_minimumsize_h"[/color] [color=#000088]/>[/color]
and all is well. I took apart the Gallery app from v4.1.2 and that is all they had. I later tried using all 4 dimensions but via the value attribute and that worked also.

  <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" />

    • 0
Thanks - that's worked.
    • 0
Photo
hjernemadsen
Jan 03 2013 10:37 AM
Hi,

I've added MultiWindows support to my application, by following the instructions here:

http://developer.sam...chnical-docs-09

However that tutorial doesn't mention the need for the library, and on my Galaxy S3 it seems to work without it. Does anyone know if the library is necessary for it to work on other devices/versions?

Also it seems that if the DEFAULT/MINIMUM settings are left out, the default is to make the app fill half the screen when dragged in, and have a minimum size that corresponds to the height of the actionbar.
    • 0
Photo
Steve Waring
May 23 2013 02:38 PM
How do you tell if when second application is added to a multi window, so that your application now only has (say) half of the screen real estate? The application is not restarted, and the onConfigurationchange method is not invoked?
    • 0