9

I was reading the following article about updating an app to take full advantage of devices like the Galaxy S8 or LG G6

https://android-developers.googleblog.com/2017/03/update-your-app-to-take-advantage-of.html

And what I want to do is to test the app in an emulator of these screens and test it before and after adding the line of code the article suggests:

<meta-data android:name="android.max_aspect" android:value="2.1" />

I have tried creating an AVD inside of Android Studio with a screen size of 5.8 and a resolution of 2960x1440 (Galaxy S8 screen resolution), and my app runs fine without any black bars, even though it's a portrait-only app, and due to that it'd be expected to show black bars, so I think I'm not configuring the emulator appropiately.

Any ideas?

Thank you.

Ernestina Juan
  • 957
  • 1
  • 9
  • 24
  • 1
    My guess is that the "letterbox" effect is something that the manufacturers did, and that the emulator does not have an option for toggling that on. Samsung and LG would love it if you would buy one of their devices... :-) – CommonsWare Apr 16 '17 at 22:06
  • 1
    AFAIK, the emulators don't have such an aspect-ratio flag, you just set whatever resolution and the app will take up the entire screen area. I guess that attribute is for certain kind of apps that are designed to work with fixed aspect ratios, so you shouldn't worry about it. – andreszs Apr 16 '17 at 22:06
  • 1
    It seems that apps that have multi-window support (declared android:resizableActivity="true") are compatible out of the box. My app targets API 25, but since it's fixed on portrait orientation, it doesn't support multiwindow, so from what I'm reading I think my app is affected. – Ernestina Juan Apr 16 '17 at 22:09
  • 1
    @ErnestinaJuan - from documentation: *Note: You do not need to set a maximum aspect ratio if an activity's android:resizeableActivity attribute is set to true. If your app targets API level 24 or higher, this attribute defaults to true.* – Maris B. Jun 05 '17 at 12:42
  • I know this is not guidance on using an emulator, but have you considered trying to use the Firebase Device Test Lab? You upload your apk and the test will install and run the app on a real physical device, making a video of it while the app runs. Maybe that's an approach that would be useful. https://firebase.google.com/docs/test-lab/overview – albert c braun Jun 13 '17 at 05:06

2 Answers2

1

I have been looking for similar thing to test my app and found that Samsung provides online test lab like firebase.

You can go http://developer.samsung.com/rtlLanding.do and check it out. They give 5 minutes free if you don't have developer account.

As per samsung you can get following

  • 20 credits are provided to each Samsung Developer user every day.
  • With 1 credit, users can use the Remote Test Lab service for 15 minutes.
  • Minimum reservation: 30 minutes (2 credits)
  • Maximum reservation: 10 hours a day (40 credits)

More details : http://developer.samsung.com/remotetestlab/rtlAboutRTL.action

aksdch11
  • 683
  • 6
  • 14
0

You can change your targetSdkVersion to 24,The default is already available。

Tong Tracy
  • 111
  • 1
  • 6