Quantcast
Jump to content


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 BGR
      Samsung’s Unpacked press event of summer 2023 is finally here, bringing the company’s newest foldable handsets, tablets, and wearables. The new foldables are the main attractions of the show, as Samsung has finally unveiled the Galaxy Z Fold 5 and Galaxy Z Flip 5.
      We’ve seen the Fold 5 and Flip 5 in several leaks leading up to the launch event, and Samsung confirmed all those rumors. In many ways, the new Fold and Flip foldables are similar to their predecessors. But they also feature several key improvements that make them more exciting than their predecessors, and I’ll explain why.
      Now, for the bad news. Sadly, the Fold 5 and Flip 5 prices aren’t any better than last year. That’s one reason to avoid the new Samsung foldables. The fact that there are other alternatives to Samsung no-risk foldables is another.
      Let’s start with three great reasons to buy Samsung’s new foldable phones.
      The new Galaxy Z Fold 5 and Flip 5 lose the screen gap
      After years of recycling the same Fold and Flip design, 2023 brings us a key improvement for both devices. Samsung introduced a new hinge design that makes possible a Zero Gap Design.
      That’s right, you can now fold the two phones perfectly. That unsightly gap between the two halves of the phone has disappeared, which means the handsets are now thinner than before.
      Samsung isn’t the first to deliver no-gap foldables, with Chinese smartphone vendors having already done it. And we saw Google offer the same design with its recently launched Pixel Fold.
      There’s one other reason to choose Samsung over rivals here. Samsung has taken its time with its design upgrades over the years, but the company did improve the durability of the Fold and Flip phones.
      The Fold 5 and Flip 5 are no different, as they feature Armor aluminum frames and are water resistant.
      The Galaxy Z Fold 5 is lighter and thinner
      Another benefit of that no-gap hinge is the reduced thickness. We’re looking at a 13.4mm profile for the Fold 5, down from 15.8mm at the thickest point for the Fold 4. The Galaxy Z Fold 5 is also lighter, weighing 253g, or 10g lighter than before.
      That makes the Fold 5 slightly more compact and easier to place in a pocket or purse. It should also be easier to handle one-handed, although Samsung is yet to pull off the Honor Magic V2 trick. That brand-new foldable is about as thick as the iPhone 14 Pro when folded.
      Galaxy Z Flip 5’s new 3.4-inch Flex Window screen. Image source: @evleaks The Galaxy Z Flip 5 got its own big external display
      The Galaxy Z Flip 5 is also thinner than before, but this handset was already very pocketable. After all, when unfolded, the handset offers you an internal display about as big as the Galaxy S23, whereas the Fold 5 becomes a 7.6-inch Android tablet.
      The Flip 5’s external display is worth getting excited about. After Oppo and Motorola, Samsung is also ready to maximize the external display to almost the entire real estate space available on one of the handset’s two halves.
      That 3.4-inch Flex Window screen lets you do more on the external display before unfolding the handset. You can chat, use widgets, and take better selfies. That’s because you’d use the Flip 5’s dual-lens camera (12-megapixel wide and 12-megapixel ultra-wide) to take selfies. Come to think of it; you don’t have to ever take selfies using the internal screen now that you get a big external display on the Flip 5.
      Using the external display for more tasks might also improve battery life. The Galaxy Z Flip 5 does get a 3,700 mAh battery. If you want a larger battery pack, you’ll want the Fold 5 and its 4,400 mAh battery pack. Then again, the Fold 5 has larger screens that will use more energy.
      The Fold 5 sticks with a 6.2-inch panel, which should be easier to use thanks to the no-gap design. Since I did say you should be using the external camera for selfies on the Flip 5, you might want to do the same thing with the Fold 5.
      The larger foldable also supports a Dual Preview mode where the subject of your photos will see the preview on the external display. The Fold 5 features a triple-lens camera on the back: 50-megapixel wide, 12-megapixel ultra-wide, and 10-megapixel telephoto. It also has two selfie cameras, including a 10-megapixel cover camera and a 4-megapixel under-display camera.
      Galaxy Z Fold 5 foldable handset and S Pen stylus. Image source: @evleaks Now, we’ll cover two good reasons to avoid purchasing a next-gen foldable smartphone from Samsung.
      The Galaxy Z Fold 5 and Flip 5 are expensive
      The two new foldables rock the best possible hardware Android handsets can offer in 2023. That means the Snapdragon 8 Gen 2 processor paired with 8GB or 12GB of RAM and 256GB of storage. The specs are also on par with what you’d get from other foldables launching this year.
      That means you’ll get the best possible Android experience, delivering Samsung’s vision for foldable handsets. On that note, the Fold 5 is the better option for multitasking, thanks to that tablet-sized foldable display that has room for multiple apps running side by side.
      But the phones aren’t getting cheaper than last year, despite the increased competition in the space.
      The 256GB Galaxy Z Fold 5 starts at $1,799, and the 256GB Flip 5 starts at $999. Various preorder and trade-in deals will be available from Samsung and its carrier partners. And you can take advantage of that $50 registration deal if you’ve signed up to be notified about preorders.
      The two phones are available for preorder and will ship to your door in two weeks.
      As for colors, the Fold 5 is available in Icy Blue, Phantom Blac, and Cream. The Flip 5 comes in Mint, Graphite, Cream, and Lavender.
      Samsung is still playing it safe
      The price isn’t the only reason to avoid the Galaxy Z Fold 5 and Flip 5 this year. Despite the increased competition, Samsung continues to play it safe when it comes to foldables. The new features we see of the new Fold and Flip models were available on competing devices well before Samsung’s Unpacked 2023 event.
      That means competitors have an advantage over Samsung, despite not being the first to market with foldable phones. Also, most rivals will be cheaper than Samsung’s newest phones.
      If you want to live on the bleeding edge of foldables, you might want to wait a while for a new generation of foldable phones to launch in China. Some of those handsets will then move to international markets.
      I’ll also point out the existence of the Pixel Fold. The handset might not be as durable as Samsung foldables, but it comes with an Android OS version that Google customized for foldable screens. And it has Google’s powerful camera software on board.
      Don't Miss: The iPhone is a ticking time bomb in Samsung’s home marketThe post 3 reasons to buy the Galaxy Z Fold 5 and Flip 5, and 2 reasons to avoid them appeared first on BGR.
      View the full article
    • By BGR
      Samsung will unveil the Galaxy Z Fold 5 and Flip 5 foldables next week during an event that’s scheduled to take place earlier than usual. A week before the Galaxy Z Fold 5 event, Samsung boss TM Roh teases upcoming innovations for the two foldables that sound impressive. Too bad Samsung is coming in second in a race it invented. It feels like Samsung is just reacting to the market rather than leading it.
      There’s more competition in the space than in previous years, with Google having just launched its first-gen Pixel Fold handset. Separately, Android vendors from China are selling foldables in international markets. And Honor has just unveiled an incredible Magic V2 device that’s about as thick as the iPhone 14 Pro when folded.
      TM Roh penned a blog post where he teased some of the innovations Samsung will bring to the foldable market with the 2023 models. The new handsets will be thinner and lighter than before, Roh said:
      “Essential” design, by the way, “prioritizes clarity of purpose and ease of daily use.”
      Image source: Christian de Looper for BGR We wouldn’t have a foldable market without Samsung pushing the limits of technology. There’s no question about it. The failed launch of the original Galaxy Fold is a testament to that. The tech and design were almost ready, but not quite. Samsung had to fix several glaring design and durability issues and postponed the launch. Samsung never gave up on that first-gen device.
      Since then, Samsung has iterated on the previous Galaxy Z Fold model, delivering improvements with each generation.
      But Samsung never dared to be the first to offer buyers a better aspect ratio for the external display that makes the handset more usable. It also stuck with the bulky Fold design and its hinge gap. And it made minimal progress with the Flip’s external display size rather than utilizing the available space.
      Foldables from Oppo, Honor, and Google offered these innovations before Samsung could. These companies took the risks that Samsung was too afraid or lazy to pursue in previous years.
      Or it might just be that Roh prioritized cost efficiencies over any sort of “essential” designs while it could. After all, Samsung had nothing to worry about until this year. There were no real alternatives to Fold and Flip phones outside of China.
      Then again, following competitors while pretending you’re leading is what Samsung has been doing in the mobile space since the first iPhone arrived. To this day, Samsung is happier following Apple’s lead than setting standards with its Galaxy devices. If only Apple made foldable iPhones…
      Don't Miss: What is Gmail’s Enhanced Safe Browsing, and should you use it?The post Samsung boss teases Galaxy Fold and Flip innovations rivals already offer appeared first on BGR.
      View the full article
    • By BGR
      Amazon’s Prime Day 2023 sales event is in full swing, but you might want to save some of the money you were going to spend on deals for the Galaxy Z Fold 5 or Flip 5. That is, in case you were looking to buy a new foldable from Samsung this month. The Korean giant will unveil the two devices in a few weeks, and they’re not going to be cheap.
      It’s not that I expected the Fold 5 or Flip 5 to be affordable all of a sudden now that Samsung has more competition. I am referring to the official price tag because Samsung will continue to do whatever it takes to lower the Fold 5 and Flip 5 prices for as much as possible. But with increased pressure from Google and a slew of Chinese Android handset vendors, I thought Samsung would try to lower the prices. Or at least keep them unchanged.
      If a fresh leak is accurate, it turns out that won’t be the case. Samsung isn’t about to make the new Fold and Flip models more affordable. It’s quite the opposite.
      Google unveiled the Pixel Fold a few months ago, and the foldable handset is now available for purchase in select markets. This is the most important competitor to the Galaxy Z Fold since Samsung started making foldables. But Google’s phone still starts at $1,799, which is on par with the Galaxy Z Fold 4.
      Samsung seemed to react to this particular development, the Pixel Fold arrival, by setting the Galaxy Z Fold 5 and Flip 4 event for July 26th. That’s at least a week earlier than usual for Samsung’s mid-summer Unpacked press conferences.
      In addition to the Pixel Fold, international buyers have access to various foldabels from Samsung competitors. Oppo is one such device, with the Find N2 Flip a highlight. More foldables will come out soon, including the OnePlus V Fold, also an Oppo device.
      Fold and Flip fans will see an immediate benefit from the increased competition in the industry. The Fold 5 and Flip 5 will get big design changes that feel overdue. The new Fold will have a no-gap hinge, which should make the handset thinner than before. The Flip 5 will come with a large outer display.
      But the Galaxy Z Fold 5 and Flip 5 prices are going up slightly, according to a French leaker Dealabs.
      Before we look at the purported price tags for France, I’ll remind you that they already contain tax. That’s why the currency conversion will not give us the US price for the new foldabels. Moreover, these are the prices Samsung fans should expect in the European Union.
      According to the report, the 256GB Galaxy Z Flip 5 will cost €1,199 ($1,320). That’s €30 ($33) more than the same capacity Flip 4. You’ll spend €1,399 ($1,541) for the 512GB model.
      Expect higher price tags for the larger Galaxy Z Fold 5. The 256GB model should cost €1,899 ($2,092), or €100 ($110) more than its predecessor. The 512GB variant will reportedly sell for €2,039 ($2,246), which is €120 ($132) more than the 512GB Fold 4. Finally, the 1TB model wil cost €2,279 ($2,510).
      As always, the latest iPhone serves as a good comparison tool for these prices. The base 128GB iPhone 14 starts at €1,019 in France and $829 in the US. The 128GB iPhone 14 Pro costs €1,329 in the region and $999 in the US. Aside from the added VAT for the European prices, I’ll remind you that Apple increased iPhone prices last year in all international markets.
      Getting back to Samsung’s upcoming foldables, you can save $50 when registering to preorder the Galaxy Z Fold 5 and Flip 5. These savings apply on top of preorder deals, and registration is free without actually requiring a purchase. Check out this link to get started.
      Don't Miss: Google can’t fix the Pixel Fold’s biggest problems until the 2nd-gen model is releasedThe post Galaxy Fold 5 and Flip 5 prices leaked, and you’re not going to like it appeared first on BGR.
      View the full article




×
×
  • Create New...