Report
-
Similar Topics
-
By Samsung Newsroom
Samsung Galaxy Fold devices have taken the mobile industry by storm, offering users a revolutionary way to interact with their applications. One of their key features is the rear display mode that enables users to continue their tasks seamlessly on the cover display while the main display remains turned off. Jetpack WindowManager has introduced APIs to enable this mode programmatically, and starting from One UI 6.0, developers can now utilize these APIs to integrate rear display mode into their applications, enhancing usability and maximizing the potential of foldable devices.
In this blog post, we dive deeper into implementing Jetpack WindowManager's rear display mode in a camera application. By leveraging this mode, users can take selfies with superior image quality using the rear camera instead of the front camera. Join us as we explore the exciting possibilities of foldable technology and uncover how to optimize your applications for the Samsung Galaxy Fold.
You can download the sample camera application here.
CameraXApp.zip (623.3 KB) Sep 26, 2024 Step 1: Add the WindowManager library into the project
WindowManager, a Jetpack library introduced by Google, supports rear display mode starting from version 1.2.0-beta03. To add the WindowManager library, go to Gradle Scripts > build.gradle (Module: app) and enter the following to the dependencies block:
implementation "androidx.window:window:1.3.0" Step 2: Implement the WindowAreaSessionCallback interface in MainActivity.kt
The WindowAreaSessionCallback interface updates an Activity about when the WindowAreaSession is started and ended. Using the onSessionStarted method, this interface provides the current WindowAreaSession as soon as a new window session is started.
class MainActivity : AppCompatActivity() , WindowAreaSessionCallback { … override fun onSessionEnded(t: Throwable?) { if(t != null) { println("Something was broken: ${t.message}") } } override fun onSessionStarted(session: WindowAreaSession) { } } Step 3: Declare variables
The WindowAreaController provides information about the moving windows between the cover display and the main display of the Galaxy Fold device.
The WindowAreaSession interface provides an active window session in the onSessionStarted method.
WindowAreaInfo represents the current state of a window area. It provides a token which is used later to activate rear display mode.
WindowAreaCapability.Status represents the availability and capability status of the window area defined by the WindowAreaInfo object. We utilize this status to change the UI of our application. The status of the Galaxy Fold device can be one of the following:
WINDOW_AREA_STATUS_ACTIVE: if the cover display is currently active.
WINDOW_AREA_STATUS_AVAILABLE: if the cover display is available to be enabled.
WINDOW_AREA_STATUS_UNAVAILABLE: if the cover display is currently not available to be enabled.
WINDOW_AREA_STATUS_UNSUPPORTED: if the Galaxy Fold device is running on Android 13 or lower.
private lateinit var windowAreaController: WindowAreaController private var windowAreaSession: WindowAreaSession? = null private var windowAreaInfo: WindowAreaInfo? = null private var capabilityStatus: WindowAreaCapability.Status = WindowAreaCapability.Status.WINDOW_AREA_STATUS_UNSUPPORTED private val operation = WindowAreaCapability.Operation.OPERATION_TRANSFER_ACTIVITY_TO_AREA Step 4: Create an instance of WindowAreaController in the onCreate method
windowAreaController = WindowAreaController.getOrCreate() Step 5: Set up a flow to get information from WindowAreaController
In the onCreate() method, add a lifecycle-aware coroutine to query the list of available WindowAreaInfo objects and their status. The coroutine executes each time the lifecycle starts.
lifecycleScope.launch(Dispatchers.Main) { lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) { windowAreaController.windowAreaInfos .map { info -> info.firstOrNull { it.type == WindowAreaInfo.Type.TYPE_REAR_FACING } } .onEach { info -> windowAreaInfo = info } .map { it?.getCapability(operation)?.status ?: WindowAreaCapability.Status.WINDOW_AREA_STATUS_UNSUPPORTED } .distinctUntilChanged() .collect { capabilityStatus = it updateUI() } } } Step 6: Update the UI according to the device's WindowAreaCapability.Status
private fun updateUI() { if(windowAreaSession != null) { viewBinding.switchScreenButton.isEnabled = true } else { when(capabilityStatus) { WindowAreaCapability.Status.WINDOW_AREA_STATUS_UNSUPPORTED -> { viewBinding.switchScreenButton.isEnabled = false Toast.makeText(baseContext, "RearDisplay is not supported on this device", Toast.LENGTH_SHORT).show() } WindowAreaCapability.Status.WINDOW_AREA_STATUS_UNAVAILABLE -> { viewBinding.switchScreenButton.isEnabled = false Toast.makeText(baseContext, "RearDisplay is not currently available", Toast.LENGTH_SHORT).show() } WindowAreaCapability.Status.WINDOW_AREA_STATUS_AVAILABLE -> { viewBinding.switchScreenButton.isEnabled = true } WindowAreaCapability.Status.WINDOW_AREA_STATUS_ACTIVE -> { viewBinding.switchScreenButton.isEnabled = true Toast.makeText(baseContext, "RearDisplay is currently active", Toast.LENGTH_SHORT).show() } else -> { viewBinding.switchScreenButton.isEnabled = false Toast.makeText(baseContext, "RearDisplay status is unknown", Toast.LENGTH_SHORT).show() } } } } Step 7: Toggle to rear display mode with WindowAreaController
Close the session if it is already active, otherwise start a transfer session to move the MainActivity to the window area identified by the token.
While activating rear display mode, the system creates a dialog to request the user’s permission to allow the application to switch screens. This dialog is not customizable.
private fun toggleRearDisplayMode() { if(capabilityStatus == WindowAreaCapability.Status.WINDOW_AREA_STATUS_ACTIVE) { if(windowAreaSession == null) { windowAreaSession = windowAreaInfo?.getActiveSession( operation ) } windowAreaSession?.close() } else { windowAreaInfo?.token?.let { token -> windowAreaController.transferActivityToWindowArea( token = token, activity = this, executor = displayExecutor, windowAreaSessionCallback = this ) } } } Step 8: Start the camera preview
Call startCamera() when onSessionStarted is triggered by the WindowAreaSessionCallback interface.
override fun onSessionStarted(session: WindowAreaSession) { startCamera() } Step 9: Add a button and set a listener to it for activating rear display mode
<Button android:id="@+id/switch_screen_button" android:layout_width="110dp" android:layout_height="110dp" android:layout_marginStart="50dp" android:elevation="2dp" android:text="@string/switch_screen" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toTopOf="@+id/horizontal_baseline" app:layout_constraintStart_toEndOf="@id/vertical_centerline" /> viewBinding.switchScreenButton.setOnClickListener{ updateUI() toggleRearDisplayMode() } Incorporating rear display mode into your application can significantly enhance user experience by providing more intuitive control and greater flexibility. By following the outlined steps, you can create a more dynamic and user-friendly interface. As technology continues to evolve, staying ahead with features like rear display mode can set your application apart and offer users a seamless, professional-quality experience. To learn more about developing applications for Galaxy Foldable devices, visit: developer.samsung.com/galaxy-z.
View the full blog at its source
-
By Samsung Newsroom
Game, work and relax. For those who want a monitor that does it all, Samsung Electronics presents the Odyssey OLED G8. Samsung Newsroom invited “Gamer S” to preview the Odyssey OLED G8 with a walk-through of a day in her actual life.
S describes herself as a “jack of all trades” gamer. From FPS, RTS and RPG, to racing and sports games, she plays across all platforms, including PC and consoles. She also likes to watch professional gamers play just as much as she enjoys playing herself. Let’s take a look at Gamer S’ day with the Odyssey OLED G8.
▲ Snap-on stand doesn’t require additional parts or dedicated tools.
Upon first glance in the morning, the Odyssey OLED G8 is quite the spectacle. Its super slim metal design measuring draws immediate attention as it measures 3.9mm at its thinnest point. Even though it is a 32-inch monitor, it does not take up much space thanks to its slim design, so it can be conveniently placed anywhere. The unique silver color harmonizes with peripherals like controllers, PCs and consoles, plus mice and keyboards.
▲ An ultra-slim metal design
You can adjust the monitor to fit your posture for comfortable gameplay. The Odyssey OLED G8 provides ergonomic adjustments, including height, tilt, rotation and pivot, to prevent pressure on your body during long play time.
▲ Samsung Odyssey OLED G8(G80SD)
FPS games are the answer to getting your hands ready for a day of gaming and entertainment. The basic formula for FPS games is to catch your opponent off guard, and overwhelm them before they even realize what is happening. Lightning quick response speed and refresh rate are vitally important in a monitor when playing FPS games. The Odyssey OLED G8 has a 4K UHD resolution that gives you the advantage when searching for enemies. S enjoys the edge that comes from a 240Hz refresh rate and a 0.03ms(GtG) response speed.
▲ Enjoy ‘The FINALS’ with the Odyssey OLED G8 featuring 240Hz refresh rate and 0.03ms response time(GtG), while offering users an edge in fast-action gaming.
Core Lighting+ on the back of the monitor is also something you don’t want to miss out on. It provides a more immersive ambiance to the gaming environment. With the CoreSync function, the monitor’s rear lights change color, mimicking the games scenes’ colors. This creates a more dramatic gaming environment and extends the mood and colors of your game to the outside world.
▲ Upgraded Core Lighting+ provides a more immersive ambiance to the gaming environment.
The impressive visual value of the Odyssey OLED G8 can be witnessed in RPG games with dark backgrounds and contrasts. The Odyssey OLED G8 helps you fully immerse yourself in the gaming world, as it displays brilliant graphics, superior brightness of 250 nits(typ) and a wide DCI-P3 99% color gamut. Every scene comes alive in vivid detail with the consistently brilliant imagery.
Especially in Game mode, the Dynamic Black Equalizer automatically increases the visibility of dark areas, while still maintaining bright zones. This enables gamers to uncover every secret while experiencing the best visuals a game has to offer.
Players can spot hidden enemies in the dark as they can see through the shadows with purer dark levels. You can even find small details hidden in the shadows without pixel light bleed, providing incredible color and depth in every game. There is no need for any additional actions or tinkering with the settings. All you have to do is focus on the game.
▲ Play ‘SOLO LEVELING: ARISE’ with 4K OLED and experience a brighter, more detailed world.
For too long, external light sources such as natural sunlight or ambient lighting have reflected off the monitor to disrupt gameplay. The Odyssey OLED G8 however, applies ‘OLED Glare Free’ technology to minimize light reflection. It delivers vivid and clear colors, even without a monitor hood. With a screen 54% less glossy than conventional Anti-Reflection film, you can see your full game environment and focus solely on gameplay.
▲ The Odyssey OLED G8 minimizes light reflection through its OLED Glare Free technology.
High-end games require the highest performing graphic cards. However, these graphics cards generate large amounts of heat. Gamers want to keep their devices performing at their peak. But the longer they play, the greater their concerns are of the heat and burn-in.
The Odyssey OLED G8 is built with Dynamic Cooling System, which evaporates and condenses coolant to diffuse the monitor’s heat five times better than the previously used graphite sheet method. So the Odyssey OLED G8 reduces temperature at the core. Also, with Thermal Modulation System,1 the algorithms predict surface temperature and automatically control brightness accordingly to reduce heat.
The Odyssey OLED G8 is the first monitor in the world to apply a Pulsating Heat Pipe that prevents burn-in.
▲ The Dynamic Cooling System and Pulsating Heat Pipe
The Odyssey OLED G8 has built-in Smart TV apps that allow users to enjoy various streaming services as well as Samsung TV Plus, Samsung’s FAST (Free Ad-supported Streaming TV). No need to connect external devices. Just turn on your monitor, sit back and enjoy.
▲ With Smart TV Apps, use the Odyssey OLED G8 as an extra TV when it’s time to take a gaming break. It also comes with a SolarCell Remote, which negates the need for disposable batteries.
Upgrade your gaming skills by watching pro gamers’ livestreams. With the Odyssey OLED G8, you’ll see the tactical and dynamic gameplay with minute-to-second details.
The Odyssey OLED G8 is powered by an AI processor, the NQ8 AI Gen3, which upscales content to near-4K when using Samsung Gaming Hub and the built-in Smart TV apps.2 Users can now enjoy higher resolution in both gaming and entertainment content.
The Odyssey OLED G8 is also equipped with ‘AI Motion Enhancer Pro,’ which enables you to enjoy content at a higher level.3 AI technology captures the movement of small objects as they move across the screen. It then calibrates accordingly to provide a smooth and more realistic viewing experience of sporting events.
▲ ‘AI Motion Enhancer Pro’ delivers clearer action through its AI processor.
The Odyssey OLED G8 has now transformed into a TV for gaming. Now, instead of using a PC, S decides to enjoy console games in a more comfortable position. The Odyssey OLED G8 automatically recognizes the connected console and activates ‘Game Bar,’ supporting useful functions such as showing the heads-up display to provide performance information, displaying aiming points and enlarging mini maps.
The monitor features AI Auto Game Mode too.4 Just input a game into the console, and set the genre to “Auto” in the game bar. AI Auto Game Mode will analyze the game title and automatically switch the setting to display the optimal image quality and sound for the genre of the game.
You can feel the difference in the audio and visual experience as the screen’s color becomes clear and rich sound fills the space. The three-dimensional and lively sound creates a high sense of immersion as if you’re entering the gaming world.
Before, gamers had to manually switch the setting based on the game they were playing. Now, players can save time and minimize disruptions when a new game is started, while also enjoying the game in its optimal state.
▲ When playing ‘Cyberpunk 2077’, gamers can experience AI Auto Game Mode, which analyzes the game title and automatically switches the setting to display the optimal image quality and sound.
▲ (Left) AI Auto Game Mode, (Right) Original
And since the Odyssey OLED G8 supports the ‘Samsung Gaming Hub,’ you can even play console games without downloading. No console required. Now, when you turn on the game controller, you’re automatically connected to the Gaming Hub.5
The Odyssey OLED G8, Your All-Around Companion, Guiding You to Gamer’s Utopia
From gaming to streaming to 4K video content viewing, the Odyssey OLED G8 delivers the best experience for gamers everywhere. If you are a gamer who wants to elevate your skills with a single monitor, look no further. With the Odyssey OLED G8, your gaming room will turn into a utopia.
▲ The Odyssey OLED G8 invites gamers to utopia.
1 When “Adjust Logo Brightness” setting is on “Off” or “Low,” Thermal Modulation is active in pre-set picture modes only. When “Adjust Logo Brightness” setting is on “High,” Thermal Modulation is always active.
2 AI upscaling works only when using the built-in Smart TV apps and Samsung Gaming Hub (PQ priority mode).
3 AI Motion Enhancer Pro is only available in the built-in Smart TV apps. Viewing experience may vary according to types of content and format.
4 AI Auto Game Mode is available for certain console games only. Availability may vary according to gaming content and format.
5 Gaming Hub is available in limited countries, with app availability differing by country. Accessing Gaming Hub is free of charge. Subscription may be required to access content offered by game-stream providers on the Gaming Hub platform.
View the full article
-
By Samsung Newsroom
The end of a year is the perfect time to gather friends and family and celebrate the year that has passed as well as the one that is to come. When it comes to planning the perfect year-end party, curating the perfect playlist is a must — but so is ensuring that your audio devices are able to set the tone all night long for that perfect celebratory mood.
In order to help you make your celebration unforgettable, Samsung Newsroom has put together some ideas of ways you can ensure your party is the best in town with Samsung’s sound technologies.
Ultra Slim Soundbar: Rock Out in Style
For those who prioritize style as well as great audio quality, Samsung’s Ultra Slim Soundbar (S801B) is the perfect choice for your year-end celebrations. As its name suggests, the Ultra Slim Soundbar features an incredibly slim design of just 38mm in height and 40mm in thickness — a size equivalent to that of a soda can — meaning that its wall-mounted design is sure to stand out. You can also install it freely around your space thanks to its wireless connectivity to ensure your sound system blends seamlessly into your surroundings.
If you’re looking to further personalize your space, you can give your Soundbar a boost with the Ultra Slim Soundbar Skin (SCFBS8[BW/TK]) released earlier this year, which comes in warm brown and teak colors. Paired with your The Frame and its elegant, modern design, you are set to enjoy not only top-level audio experiences but also a cozy, festive feel.
Despite its slim appearance, the Ultra Slim Soundbar is capable of powerful sound. Designed with 3.1.2-channel technology that features seven front speakers and one subwoofer centered on the top two speakers, the Ultra Slim Soundbar provides complete and truly surround-sound experiences. Dolby Atmos support also further contributes to providing you with captivating entertainment experiences.
S-Series Soundbar: Envelop Your Space With Truly Immersive Sound
For those who love to set the scene with truly immersive sound experiences during a celebration or party, the S-Series Soundbar is the soundbar for you.
The S-Series Soundbar delivers rich, room-filling surround sound able to reach every person in the room. This compact, 67cm, all-in-one 5.0-channel soundbar has an impressive four built-in woofers and three tweeter speakers, providing you with a fully immersive, 3D sound experience — all without the need for a subwoofer.
In addition, Adaptive Sound technology is able to analyze the source of any sound in order to automatically deliver optimized audio based on its specific genre. Experience the best, most immersive audio for each and every type of content you’re enjoying, whether it’s a sports game, a classical performance or an action movie.
Your S-Series Soundbar can be easily connected to your Samsung Smart TV and is the first soundbar in the industry to support Dolby Atmos connection for room-filling, optimized 3D sound.
Q-Series Soundbar: Bring the Cinema Experience Into Your Home
If you’re looking to celebrate the year-end season with your favorite movies or TV shows, you can transform your home into a cinema with the room-filling sound of Samsung’s premium soundbar, the Q-Series Soundbar (Q990B).
With an astounding 17 front surround sound speakers, one subwoofer and four up-firing speakers, the Q-Series Soundbar fills the room with truly cinematic surround sound. Synced with your Samsung Neo QLEDs, these 22-channel speakers can deliver truly immersive surround sound experiences like no other.
Samsung’s proprietary Q-Symphony technology allows for compatible TVs and soundbars to play audio at the same time, in sync, taking your listening experiences to the next level through powerful sound quality. Meanwhile, Spacefit Sound technology optimizes your audio based on the structure and layout of your room, providing you with sound that is perfectly crafted for your space and rivals a VIP seat in a movie theater.
In addition, the Q-Series Soundbar has been recognized by renowned global media outlets for its immersive sound experiences, as well as its sleek design.
Sound Tower: Take the Party Spirit to the Next Level
If you’re planning to celebrate the year-end with a bang and throw a party, the Sound Tower (MX-ST90B) is a must-have. This oval Sound Tower fills up virtually any space with 3D audio. The 24.5cm speaker with a built-in woofer provides the perfect punching bass experience, with up to 1700W bass boosting for a beat that sets the party mood perfectly.
In addition to its powerful audio capabilities, the Sound Tower’s various light modes provide an audio-visual harmony that truly matches the mood of the night. Its Bluetooth multi-connection, which allows for two smart devices to be connected simultaneously, and its Group Play functionality, which connects up to 10 Sound Towers, really help you get the party started both indoors as well as outdoors.
Be sure to finish your year strong with Samsung’s range of soundbar and Sound Tower devices. Once you’ve chosen your perfect soundbar based on your own preferences and purposes, enjoy enriching sound during your year-end festivities and beyond.
View the full article
-
-