Quantcast
Jump to content


Recommended Posts

Posted

Meet Galaxy Watch3! With over 120 home workout videos on the Samsung Health app, Galaxy Watch3 helps you get your body moving on your time. Galaxy Watch3's running guide lets you keep pace as you get tips on the go by analyzing how you move to help improve your form. Keep your health in good hands, from your wrist. For more information, visit http://smsng.co/GalaxyWatch3 #GalaxyWatch3 #Watch3 #Howto



  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Similar Topics

    • By Samsung Newsroom
      Play Asset Delivery (PAD) enhances the gaming experience by offering the advantages of application bundles, which are packages that group all necessary resources for efficient delivery, making downloads faster and installations smoother for players. Android App Bundles (AAB) are a type of PAD, the modern way of building and publishing Android applications and games in Google Play Store. The Samsung Galaxy Store recently introduced the option to upload AAB files to Galaxy Store Seller Portal. However, AABs have some Google Play Store proprietary features that might make a game non-functional when it is uploaded to Galaxy Store. This article explores ways in which you can utilize PAD while ensuring your game remains compatible with Galaxy Store.
      Purpose
      PAD is a very useful feature that helps reduce the game's initial download size, as it downloads various game assets at runtime. There are multiple ways of using this feature in Unity games. However, certain PAD configurations may cause the game's assets to fail to load when the game is published to Galaxy Store. In this tutorial, you learn how to properly configure PAD and adjust Unity configurations accordingly, so your game can be successfully published to Galaxy Store.
      In the following sections, PAD functionalities are implemented in an existing coin collector game (referenced in the article Integrating Samsung IAP in Your Unity Game), demonstrating how to download and apply a new set of materials for the floor tile at runtime. Here, you also learn about the adjustments that are necessary for successfully publishing a game using PAD to Galaxy Store.
      Prerequisites
      To follow this tutorial, ensure that your setup has the following:
      Unity Game Engine version 2023.2 or above The "Addressables for Android" package for Unity A Google Play developer account A Galaxy Store Seller Portal commercial seller account A game created using Unity where you want to add the PAD features To implement PAD in your Unity game, you can use the "Addressables for Android" package. This is the easiest and most convenient way to implement PAD in a game. This package is only supported on Unity version 2023.2 or above. If your game is built using a previous version of Unity, please migrate your game to the Unity 2023.2 version first.
      PAD implementation considerations
      There are multitude of ways to implement PAD in games built with the Unity engine. However, the most common method for implementing PAD restricts the game to being publishable exclusively on the Google Play Store and does not provide any easy method of disabling PAD for uploading these games into other storefronts. For the best experience with your game, it is recommended to use PAD to bundle all game assets together. This approach ensures that all necessary resources are downloaded right away, preventing any missing assets which could affect the user experience.
      There are three types of asset packs that can be configured while using PAD: "Install Time," "Fast Follow," and "On Demand." Games that use the "Install Time" asset packs can be uploaded to Galaxy Store without any issues as these assets are installed together with the game and do not require any separate downloads. When Galaxy Store generates a universal APK from AAB files, the "Install Time" assets are directly included in the APK.
      Games that are designed to only use "On Demand" or "Fast Follow" asset packs do not allow downloading their assets when they are uploaded to a storefront that is not the Google Play Store. Thus, for any game that uses either the "On Demand" or "Fast Follow" asset pack delivery method, PAD must be disabled in order to upload the game to Galaxy Store.
      To ensure that your game's PAD functionality can be easily switched off and your game is successfully uploaded to Galaxy Store, the "Addressables for Android" package must be used to implement PAD.
      This article assumes that you have implemented PAD in your game using the "Addressables for Android" package and that you have also configured these two assets with the following configurations:
      A "Grass" asset pack set to be downloaded as a "Fast Follow" asset A "Ground" asset pack set to be downloaded as an "On Demand" asset In the next sections, you learn how to integrate PAD into your existing Unity game using the "Addressables for Android" package so that you can easily publish your game to Galaxy Store with minimal changes.
      Basic steps to implement PAD in your Unity game
      In this section, you learn how to configure your assets using PAD functionality that keeps your game compatible with both Google Play and Galaxy Store.
      In Unity, configure "Build Settings" to run the game on Android and generate the AAB: Click File > Build Settings and then select the Android tab. On the "Android" tab, select the Build App Bundle (Google Play) checkbox.



      Figure 1: Enabling the "Build App Bundle" option

      Install the "Addressables for Android" package from the Unity Package Manager. This additionally installs the "Addressables" package as a dependency. Initialize PAD. Go to Window > Asset Management > Addressables and click Init Play Asset Delivery.



      Figure 2: "Init Play Asset Delivery" option

      Configure the "Addressables Groups" for assets: Select Window > Asset Management > Addressables > Groups. Click New > Play Asset Delivery Assets. This creates a new group. Enter a descriptive name. For the purposes of this walkthrough, name one group "Grass" and then create another group and name it "Ground."



      Figure 3: Creating asset groups

      Assign the assets to the Addressables Group: Select the assets you want to assign to an Addressables Group and in the "Inspector" dialog box, tick the Addressable checkbox. The asset is converted into an "Addressable" and assigned to the default Addressables Group.



      Figure 4: Converting assets into Addressables

      Click the folder name in the "Group" field. In the example, the folder name is "Grass."
      Drag and drop the asset from the default group to the group of your choosing. For the purposes of this exercise, assign the grass material related assets to the "Grass" Addressables Group and ground material related assets to the "Ground" Addressables Group.




      Figure 5: Assigning assets to groups

      Configure the "Play Asset Delivery" schema for these addressable groups to add the PAD functionality to your game: Select any of the top-level Asset Group names in the "Addressables Groups" window to open the inspector window for that group. Scroll down in the "Inspector" window until you find the "Play Asset Delivery" schema. From the "Delivery Type" dropdown list, select Install Time, Fast Follow, or On Demand, based on your requirements. There is a demonstration below on how the game might behave on Galaxy Store when you choose the option "On Demand." For more information, see the Testing your PAD Enabled Game on the Play Store and Galaxy Store section.



      Figure 6: Selecting the delivery type for asset groups

      In the "Addressables Groups" dialog box, select Build > New Build > Play Asset Delivery. Now, the game's addressable-asset configuration is complete. Each asset assigned to an addressable group is packed into an asset pack for that group and the asset pack can be downloaded separately using PAD. Note that asset packs can only be downloaded separately from the Play Store if their delivery type is "On Demand" or "Fast Follow."
      Loading and using the addressable assets with AssetReference
      This section provides a script which details how to load the addressable assets that were implemented with PAD in the earlier sections. Your game is set up to load the addressable assets efficiently. If an asset has not been downloaded yet, the game automatically attempts to download it as an "On Demand" asset using PAD before it loads into the game.
      To complete this setup, use the AssetReference type in your game. This feature enables you to manage and edit addressable assets dynamically at runtime, which gives you more flexibility and control over the assets that your game uses.
      To use two game addressable assets in your script, follow these steps:
      Create two AssetReference instances for the floor types (grass and ground) that you added in the previous section. Add the SerializeField attribute to these AssetReference instances. This enables setting up the assets directly from the Unity editor: [SerializeField] AssetReference Grass_mat; [SerializeField] AssetReference Ground_mat; In the Unity editor, drag and drop the grass and ground assets into the fields in the GameObject script section. Now the AssetReferences specifically reference these two assets during runtime.
      Downloading assets during runtime is necessary for PAD. Use AsyncOperations to load these assets:
      Grass_mat.LoadAssetAsync<Material>().Completed += OnGrassAssetLoaded; Ground_mat.LoadAssetAsync<Material>().Completed += OnGroundAssetLoaded; The OnGrassAssetLoaded and OnGroundAssetLoaded handler functions are defined to use the loaded assets. The LoadAssetAsync method passes the asset using an AsyncOperationHandle, and from there you can access the asset itself using the AsyncOperationHandle.Result parameter.
      In this game, we are using PAD to load the grass and ground assets. Once they are successfully loaded, you can change the floor tile material using the following handler functions.
      In this example, after loading the grass and ground assets, you apply the material change to all the floor tiles in the level:
      void OnGroundAssetLoaded(AsyncOperationHandle<Material> handle) { groundMaterial = handle.Result; foreach (GameObject prefab in floorPrefabs) { prefab.GetComponent<MeshRenderer>().material = groundMaterial; } } Save the script and go back to the Unity editor. The new materials are loaded and applied to the floor tiles in the level.

      Testing your PAD-enabled game on the Play Store and Galaxy Store
      The game configuration for using addressable assets and PAD is complete. Before publishing your game, consider whether to use the "Split Application Binary" option.
      On the Android Player settings, expand "Publishing Settings," and scroll down to the "Split Application Binary" checkbox. This checkbox decides how Unity handles packaging when building the game. If this checkbox is checked, Unity splits the base game files from the asset files when building the AAB and enables you to configure each PAD feature in your game. In the images below, you can see what happens when you choose this option. If this option is unchecked, Unity always generates a singular archive file and disables PAD. This is the safest option for uploading your game to Galaxy Store, if your PAD configuration is using options that are not supported by Galaxy Store.



      Figure 7: "Split Application Binary" option

      To enable PAD, check the "Split Application Binary" option Build the game and upload the generated AAB file to both the Play Store and Galaxy Store to check how the game behaves in both stores. If the game assets load correctly in both stores, the PAD configuration was done correctly. Below is an example of what might happen if "On Demand" configuration is used instead.
      When the game is downloaded from the Play Store, Unity automatically downloads the "On Demand" assets. A notification for an "Additional file download" appears during the download process:




      Figure 8: Additional file download notification

      Once the download is complete, the downloaded asset is loaded in your game, replacing the previous assets. In this example game case, the old ground and grass materials are changed to the new textures configured in the previous section.




      Figure 9: Assets updated in the game

      However, when the same game AAB file is uploaded to Galaxy Store and a user downloads it from this store, the PAD assets are not downloaded. Thus, when the game tries to use these assets, they cannot be loaded into the game's memory and glitches might appear.
      While additional error checking can be done to avoid these glitches, the functionalities which require PAD assets still cannot be used. Internally, the game checks the installation source before trying to download the PAD assets and throws an error if the game is not installed from the Play Store.




      Figure 10: Issues might occur if a PAD-enabled game is uploaded to Galaxy Store

      Making the game compatible with Galaxy Store
      To upload your game to Galaxy Store, you can adjust the asset handling to be compatible with Galaxy Store. The best way to do this is by bundling the assets together with the base game, as explained in the previous sections.
      This method is highly recommended. This ensures that the required assets are always available with the game, as well as allowing you to change the assets during runtime, if necessary. Though this can increase the game download size and require you to upload a separate AAB file to Galaxy Store, the process ensures that the assets are always available with the game for full feature parity across all storefronts.
      To make your game build compatible with all storefronts, choose one of the following approaches.
      Option 1: Uncheck the "Split Application Binary" checkbox
      Go to Build Settings > Player Settings > Publishing Settings and uncheck the Split Application Binary checkbox. When you then compile the game, the new AAB file is compatible with Galaxy Store and all the game's functionalities remain intact.




      Figure 11: "Split Application Binary" unchecked option.

      With this option, the assets are packaged together with the game and no separate download is required.
      Option 2: Change delivery type to "Install Time"
      If you want to keep using PAD, you can achieve compatibility by changing all addressable asset groups' delivery type to "Install Time." Keep in mind that when choosing this option, all assets need to be changed to "Install Time" one by one, while the previous one is a one-click process. Unlike "On Demand" and "Fast Follow" asset packs, "Install Time" asset packs are included in the universal APK. Thus, the assets are downloaded together with the game and work as intended without causing errors.
      From the user's perspective, the main difference between "Install Time" and other PAD options is whether the assets are downloaded when the game is installed or later during gameplay. The initial download size is larger when the assets are packaged together with the game, but on the other hand, the user will not need to wait for the assets to download later during gameplay. This enables offline gameplay as well.
      Conclusion
      In this tutorial, you have learned how to configure a Unity game with PAD so that it can easily be published to Galaxy Store without requiring massive changes or breaking any compatibility. For more information, check out the "Addressables for Android" package documentation page Build content for Play Asset Delivery. If you have any feedback or questions, reach out to us in the Samsung Developers Forum.
      View the full blog at its source
    • By Samsung Newsroom
      Samsung Electronics America has secured #1 rankings in TVs for overall customer satisfaction and #1 in home appliance service experience for the second year in row in the 2024 American Customer Satisfaction Index (ACSI®) survey. Samsung TVs also achieved #1 in product quality, service quality and service experience.1
       
      Samsung research shows that 90% of TV buyers and 94% of home appliance shoppers are more likely to choose a brand known for strong customer service2 — a trust that Samsung has built through consistent commitment to customer care. Building on this trust, Samsung is leading the way in designing AI-enabled products that enhance consumers’ lives, with the cutting-edge Samsung Care team ready to assist when the unexpected happens.
       
      “We’re proud to be consistently recognized by our customers in the ACSI survey, a testament to the improvements we have made to the end-to-end customer experience,” said Mark Williams, Vice President of Customer Care at Samsung Electronics America. “We know that when your TV or appliance isn’t working, you want it fixed quickly, the first time. That is why we’ve invested in AI and digital care innovations, best-in-class training, efficient parts distribution and expanding our Samsung Beyond Boundaries,3 program to provide more customers with quality care in the US.”
       
       
      Samsung TVs: Excellence in Picture and Sound Quality, Value and More
      Samsung received recognition from its customers across several categories for its cutting-edge TVs, powered by AI. This includes #1 rankings in overall quality, picture quality, and sound quality — a clear testament to our continued leadership and innovation.
       
      With AI at its core, the 2024 lineup delivers several value-add features that only Samsung can provide, demonstrated by a #1 ranking in value. This includes AI Upscaling,4 which can transform even lower-resolution content — like old movie classics — into stunning 4K and 8K, and Samsung Gaming Hub,5 letting you experience the best of gaming all in one place, no console required. With Tizen OS, you can stream all of your favorite video services and access Samsung TV Plus, which provides 2,700+ free channels, including 400+ premium channels — all for free.
       
      In a world that is more connected than ever before, Samsung TVs users can effortlessly enjoy entertainment knowing their devices are ranked #1 for connectivity. With seamless access to SmartThings, you can use your TVs as an IoT hub to easily connect and manage devices. Powered by Knox, only Samsung TVs deliver added peace of mind that your personal data is secured across your connected devices while you watch.6
       
      Samsung TVs also earned #1 rankings for ease of use, exterior design and durability. From sustainability-forward packaging and improved energy efficiency to accessibility features — the TV lineup is intentionally designed to elevate your home entertainment experience.
       
       
      Samsung Home Appliances: Leading Customer Satisfaction
      Samsung achieved best-in-class rankings for refrigerators7 and washing machines, and leads in appliances with top scores for service experience, ease of arranging service, technician courtesy, helpfulness and timely repairs. These top rankings reflect the confidence consumers place in Samsung’s AI-enabled products to enhance and simplify their lives.
       

       
      Our latest AI-powered Bespoke appliances were designed to deliver enhanced performance, helping you do more with less effort. The Bespoke Refrigerator with AI Family Hub+ with AI Vision Inside recognizes 33 different food items as they’re added or removed from the fridge, using an internal camera and ‘Vision AI’ technology.8 The Bespoke AI Laundry Combo All-in-One takes the guesswork out of cycle selection by intelligently adjusting washing and drying time and energy.9 The AI Home touchscreen LCD Display simplifies cycle and setting selection while managing other connected Samsung devices. And with SmartThings, the #1 mobile app for appliances according to ACSI,10 AI-equipped devices seamlessly connect, offering smarter home management and easier control.11
       

       
       
      Empowering Customers with Seamless, Next-Generation Care
      Samsung Care continuously invests in ways to give customers choices and easy options for high-quality, convenient care on their terms. Paving the way in next-generation care, Samsung has continued to invest in AI-powered tools to help Care experts resolve issues even faster. Interactive Voice Response (IVR) is one such tool, using AI12 to identify the customer’s intent, product, and issue, ensuring they are routed to the right agent with valuable insights before the call even begins. IVR can also text customers the two nearest Walk-In Service or Authorized Repair Centers based on their zip code and send a link to book an appointment, making the process even smoother.
       
      With connected solutions for home appliances, Samsung makes proactive and preventative care simple and accessible. For example, consumers can use the Home Care service in the SmartThings app, which uses AI to automatically detect and troubleshoot issues. If an error code appears, customers receive an alert with step-by-step instructions for a quick home fix. If further assistance is needed, they can chat with a care professional, schedule a repair with a Samsung-certified technician, or even order replacement parts, like water filters, directly through the app.
       

       
      Samsung provides 99.9%13 of the U.S. with convenient Care coverage for TVs and home appliances. Even in rural areas, people can access next-level care via Samsung Beyond Boundaries. Customers within a 4-hour radius of a Samsung Care Center can receive at-home repairs.
       
      Looking for more news or need additional support from the Samsung Care Team? Visit the Samsung Care YouTube Channel, check out the Samsung Members App and Samsung Communities or text us any time by messaging 1-800-SAMSUNG to start a conversation with a Samsung Care Pro.
       

       
      About the American Customer Satisfaction Index (ACSI®) Survey
      The American Customer Satisfaction Index Survey (ACSI) is the nation’s only cross-industry measure of customer satisfaction. Since 1994, the survey has been recognized as a leader in analyzing consumer sentiment about the products and services used most often. The ACSI Index surveys customers on their own consumer electronics experiences and identifies industry leaders for excellence, based on customer feedback regarding service repair, product durability, and warranty coverage.
      Between July 2023 and June 2024, the ACSI Household Appliance and Electronics Study surveyed over 5,100 U.S. consumers who recently purchased appliances from leading manufacturers to evaluate the quality of their experiences in a variety of categories. Between July 2023 and June 2024, the ACSI TV Study surveyed over 6,000 U.S. consumers who recently purchased TVs from leading manufacturers to evaluate the quality of their experiences in a variety of categories.
      Source: 2024 ACSI® Surveys of customers rating their appliance manufacturer and TV manufacturer. ACSI and its logo are registered trademarks of the American Customer Satisfaction Index. For more about ACSI, visit www.theacsi.org.
       
      1 Samsung tied with 1 other brands for service experience.
      2 Samsung Electronics American Consumer Market Insights, Customer Care Foundational Learnings — March 2024
      3 Coverage includes 99.9% of delivery zip codes (excluding P.O. box, APO/FPO/DPO) by our largest retailer; in-warranty service only.
      4 Utilizes AI-based formulas.
      5 Powered by Tizen, the Samsung Gaming Hub is an all-in-one game streaming discovery platform bridging hardware and software for a better player experience. Instantly play thousands of games from Xbox, NVIDIA GeForce NOW, Amazon Luna, Utomik, Antstream Arcade and Blacknut Cloud Gaming. The Samsung Gaming Hub is the new home for gaming and entertainment with Twitch, Spotify and YouTube Gaming integration that gives players easy access to enhance their experience. No storage limits, no downloads, no console or PC required – all players need is a Bluetooth-enabled gaming controller and internet connection to start playing.
      6 Personal data includes input Pin codes and passwords, and IoT device information through the SmartThings app. The latest software update is required.
      7 Samsung tied with 1 other refrigerator brand.
      8 Available on RF23DB9900. As of March 2024, AI Vision Inside can recognize 33 food items like fresh fruits and veggies. Recognizable food items will be regularly added and updated. If the food is covered by hand and not recognizable, it may be listed as an unknown item, but the user can always revise the item title through the Family Hub or SmartThings. Wi-Fi connection and Samsung account required.
      9 Messages with cycle suggestions are displayed on the control panel or a smartphone with the SmartThings app; available on Android and iOS devices. A Wi-Fi connection and a Samsung account are required. Can be applied on Towels, AI Opti Wash & AI Optimal Dry, Heavy Duty, Super Speed, Small Load cycle only when the selected washing temperature is ‘hot’. Based on internal testing with IEC 8lb load except for Small Load cycle (IEC 4lb load). Results may vary depending on the actual usage conditions.
      10 Samsung tied with one other mobile app for home appliances.
      11 Available on Android and iOS devices. A Wi-Fi connection and a Samsung account are required.
      12 After IVR does the initial triage with the customer, AI analyzes the intent and passes info along to the Care agent to better address the need. IVR continuously learns and improves its accuracy over time, enabling our agents to support customers more quickly.
      13 Coverage includes 99.9% of delivery zip codes (excluding P.O. box, APO/FPO/DPO) by our largest retailer; in-warranty service only.
      View the full article
    • 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





×
×
  • Create New...