Quantcast
Jump to content


Recommended Posts

Posted

2021-05-11-01-banner.jpg

The Galaxy Store is one of the top app stores to sell your Android games in many different countries. You can also sell various in-app purchase (IAP) items inside your games using the Samsung IAP SDK. As many of you now use the Unity engine to develop your games, Samsung has introduced a Unity plugin for the Samsung IAP SDK that enables you to implement IAP features. Follow the steps outlined in this blog to easily implement the Unity plugin into your project and utilize the Samsung IAP functionalities.

Prerequisites

It is assumed you are already familiar with the Samsung IAP procedure. If not, please read the IAP Helper programming guide carefully before proceeding further. After that, download the Samsung IAP Unity plugin package and go through its documentation. To avoid compatibility issues, make sure you meet the system requirements.

There are three types of IAP items:

  1. Consumable: can be used only one time and re-purchasable
  2. Non-consumable: can be used any number of times and not re-purchasable
  3. Subscription: can be used any number of times while it is active

For this example, we have developed a basic coin collecting game in Unity for Android and added UI buttons that allow users to buy IAP items (consumable and non-consumable), and a subscription. The “Buy Super Jump” button initiates purchasing a super jump item from the Galaxy Store using the Samsung IAP SDK. Super jump is a consumable item which enables the player to jump higher than normal. Similarly, the “Upgrade Player” button initiates purchasing a player upgrade, which is a non-consumable item. This blog only covers consumable and non-consumable purchases, we’ll discuss subscriptions in a future blog.


2021-05-11-01-01.jpgFigure 1: Preview of the sample game developed in Unity.


Note: You are required to develop your game/application in Unity beforehand to integrate the IAP Unity plugin into it.

Integrate the Samsung IAP Unity plugin

After creating the game in Unity, you need to enable Samsung IAP functionalities in your project. Follow the steps below:

  1. Import the Samsung IAP Unity plugin package into the project. In Unity, click Assets -> Import Package -> Custom Package and select the downloaded plugin package.
  2. You can now see the Plugins folder under your Assets folder and the “SamsungIAP.cs” script at Assets/Plugins/Script.
  3. Copy or move the “SamsungIAP.cs” script into the default scripts folder (where all the scripts are kept together) of your project so that other scripts can access it easily. If you don’t already have a scripts folder, create a new one and keep all your project scripts together along with “SamsungIAP.cs”.
  4. Create an empty game object in the Hierarchy tab and drag-and-drop the “SamsungIAP.cs” script onto it. In our sample project, we have renamed the game object as “SamsungIAP”.
  5. Click on the “SamsungIAP” game object and check whether the IAP functionality is enabled in the Inspector, as shown below:

2021-05-11-01-02-v2.jpgFigure 2: Samsung IAP is enabled for the project.


Set the IAP operation mode

IAP supports three operational modes. The production mode is for enabling billing for item purchases and the other two are for testing IAP functions without billing the game users for item purchases. The default operation mode is set to OPERATION_MODE_TEST with the return value as Success, but you can set the return value to Failure instead, or switch to OPERATION_MODE_PRODUCTION by checking (√) the Production Build checkbox in the Inspector as shown in figure 2. You can learn more about the IAP operation modes and how they work from here.

Register the game and IAP items in the Seller Portal

To process/test the Samsung IAP operations, both your game and any IAP items need to be registered in the Seller Portal. Follow the steps below:

  1. Ensure you have switched the platform of your game to Android and the package name is different from the apps registered in other app stores. You can rename the package name of your project from Player Settings -> Other Settings.
  2. Save your Unity project and build the APK file. In Unity, go to File -> Build Settings and then click the Build button.
  3. Follow the steps listed in Register an app and in-app items in Seller Portal and complete the registration of your game and IAP items accordingly. For our sample game, we have registered a consumable and a non-consumable item with the IDs “BuySuperJump” and “BuyUpgradedPlayer” respectively. Keep the item IDs in mind as they will be required when initiating the purchases.
  4. You can add testers (non-licensed and licensed) in the Binary tab of the Seller Portal while registering your game in the manner covered in the previous step. Licensed testers are not be charged for purchasing any IAP items. You can register the licensed testers in your Seller Portal profile. See IAP Testing for more information.

Get previously purchased items

Make sure to retrieve any previously purchased non-consumable and unconsumed items every time the user starts the game. Use the GetOwnedList() method of the IAP plugin to get information about the items the user has already purchased. However, please note there is a script “player.cs” in our project which is added to the main player game object as a component. From now on we will be editing the codes into this “player.cs” script to enable all the Samsung IAP functions for this project. Follow the steps below:

  1. Add the following line at the beginning to access the Samsung IAP libraries in this script.
    using Samsung; 
    
  2. Call the GetOwnedList() method whenever the game launches, by adding the following line at the beginning of the Start() method. Learn more about the GetOwnedList() method here.
  3. After the processing of the GetOwnedList() method is completed, the OnGetOwnedList callback is triggered, which receives information about the specified purchased items and API call processing. We need to implement this callback method under the same class as in the following;
    void OnGetOwnedList(OwnedProductList _ownedProductList){
            if(_ownedProductList.errorInfo != null){
                if(_ownedProductList.errorInfo.errorCode == 0){// 0 means no error
                    if(_ownedProductList.results != null){
                        foreach(OwnedProductVo item in _ownedProductList.results){
                        if(item.mConsumableYN == "Y"){
                        //consume the consumable items and OnConsume callback is triggered afterwards                                                                       SamsungIAP.Instance.ConsumePurchasedItems(item.mPurchaseId, OnConsume);
                        }
                        if(item.mItemId == "BuySuperJump"){
                             superJump++;
                        }
                        else if(item.mItemId == "BuyUpgradedPlayer"){                         
                        playerMaterial = Resources.Load<Material>("playerMaterial");
                        MeshRenderer meshRenderer = GetComponent<MeshRenderer>();
                        meshRenderer.material = playerMaterial;                        
                        }                    
                    }
                } 
            }
        }
    }
    

As you can see, some actions have been taken inside the game depending on the respective item IDs. For example, the super jump counter has been increased and the material of the player gets changed. If there is any consumable item which has not been reported as consumed, then the ConsumePurchasedItems() method is invoked. We describe this method in the next section.

Consume purchased consumable items

Use the ConsumePurchasedItems() method to report the purchased consumable item as consumed, which enables the item to be purchased again. See Acknowledge a purchased consumable item to understand this process better. When the process of the ConsumePurchasedItems() method in the previous section is finished, the item data and processing results are returned to the OnConsume callback method. We need to implement this method in the same way under the same class as we implemented the OnGetOwnedList method earlier.

void OnConsume(ConsumedList _consumedList){
         if(_consumedList.errorInfo != null){
             if(_consumedList.errorInfo.errorCode == 0){
                 if(_consumedList.results != null){
                     foreach(ConsumeVo item in _consumedList.results){
                             if(item.mStatusCode == 0){
                                 //successfully consumed and ready to be purchased again.
                             }
                     }
                 }
             }
         }
}

Get purchasable IAP items

The users may want to see details of the available IAP items in the store for the game. The GetProductsDetails() method helps to retrieve detailed information (for example, item name, price, ID, etc.) about the IAP items registered in your game that are available for users to purchase. There is a UI button “Available Items” in our sample game for querying the purchasable items. After clicking this button, brief information for each item is presented in a simple dropdown list next to the button (see figure 3). To get the list of available items:

  1. Declare a button variable and a dropdown variable in the beginning of the “player.cs” script.
    public Button getProductsButton;
    public Dropdown itemList;
    
  2. Add a listener method for the “Available Items” button at the end of the Start() method.
    getProductsButton.onClick.AddListener(OnGetProductsButton);
    
  3. To initiate the GetProductsDetails() method, we need to implement the listener OnGetProductsButton() method.
    void OnGetProductsButton(){
             //get all the product details
             SamsungIAP.Instance.GetProductsDetails("", OnGetProductsDetails); 
    }  
    
  4. After the processing is completed on the server side, the OnGetProductsDetails callback is triggered, which contains information about the available IAP items. Implement this callback method and add information of each item to the dropdown method so that the users can see them easily. In the example, we show only the item name and price.
    void OnGetProductsDetails(ProductInfoList _productList){
             if (_productList.errorInfo != null){
                  if (_productList.errorInfo.errorCode == 0){// 0 means no error
                       if (_productList.results != null){
                            itemList.ClearOptions();
                            List<string> optionItems = new List<string>();
                            int i = 1;
                            foreach (ProductVo item in _productList.results){
                                   string temp = i+ ". " + item.mItemName + ": $ " + item.mItemPrice;
                                   optionItems.Add(temp);
                                   i++;
                            }
                            itemList.AddOptions(optionItems);
                       }
                  }
             }
    }
    

2021-05-11-01-03.jpgFigure 3: Showing the available IAP items in the game.


The information of all IAP items is shown in the dropdown menu as a list. You can show only one specific item or more items by specifying their IDs in the GetProductsDetails() method if you want. Learn more about the method here.

View the full blog at its source

  • 2 years later...


  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

I am writing to request the sample project mentioned in your blog post, "Integrating Samsung IAP in Your Unity Game." I am currently working on integrating Samsung IAP into my own Unity game and would find the sample project incredibly helpful in understanding the process and implementation details.

I have already followed the steps outlined in the blog post, including:

  • Importing the Samsung IAP Unity plugin package
  • Enabling Samsung IAP functionalities in my project
  • Attaching the "SamsungIAP.cs" script to a game object

However, having a complete sample project to reference would provide invaluable insights into how these elements work together in a practical scenario. It would be especially beneficial to see how the code interacts with different aspects of the IAP process, such as product initialization, purchase requests, and transaction handling.

I would be grateful if you could share the sample project or provide any alternative resources that offer a similar level of detail. I am confident that having access to this information will significantly accelerate my development process and ensure the successful integration of Samsung IAP into my game.

Thank you for your time and consideration.

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
      January 2025 Unveiling Invites to "Galaxy Unpacked 2025" Ushering in a New Era of Mobile AI
      New Galaxy products are unveiled at Galaxy Unpacked 2025! Galaxy Unpacked 2025 commences on January 23, 3 AM KST (January 22, 10 AM local time) in San Jose, USA. It is streamed live online via the Samsung Electronics Newsroom, Samsung.com, and Samsung Electronics YouTube channel. Samsung Electronics' innovations are going to usher in a new era of the mobile AI experience with the natural and intuitive Galaxy UI. See for yourself.
        Learn More Highlights from the CES 2025 Samsung Press Conference
      On January 6, Samsung Electronics held the CES 2025 Samsung Press Conference under the theme "AI for All: Everyday, Everywhere," unveiling its technological visions. The full inter-device connectivity and hyper-personalized user experience through AI, both introduced at the conference, have attracted media attention from all over the world. Check out the innovative technologies that will change the future in our video.
        Learn More Updates for Samsung In-App Purchase: Resubscription and Grace Period Features
      Managing subscriptions is now more convenient with the new Samsung in-app purchase (IAP) updates. The newly updated features are resubscription and grace period.
      Users can now reactivate their canceled subscription in Galaxy Store using the resubscribe feature. Even if there is a problem with the payment when renewing a subscription, the subscription is not canceled if the problem is resolved during the set grace period. If the developer activates the grace period feature in the item settings of Galaxy Store's Seller Portal, the system automatically retries the payment and sends the information about the failed automatic payment to the user so that they can change their payment method.
      Developers can also see new information in the subscription API and ISN services, such as the subscription API's response parameters and ISN service events. Manage your subscriptions more effectively using these new features. Tutorial: Manage the Purchase/Subscription of Digital Items with Samsung In-App Purchases
      The hassle of managing digital item purchases and subscriptions is no more! Samsung in-app purchase (IAP) is a powerful tool that provides a more secure and convenient payment environment for users and expands commercialization opportunities for developers. This tutorial covers how to smoothly and efficiently implement item purchase/consumption processing and subscription management. A step-by-step guide and practical code examples are used to walk developers through the complex API integration process even if they're just starting out. Check out the tutorial on the Samsung Developer Portal.
        Learn More Tutorial: Step into Galaxy Watch Application Development Using Flutter
      Did you know that you can develop an application for Galaxy Watches with a single codebase? The tutorial shows software developers how they can develop applications for Galaxy Watch using the Flutter framework. Flutter is an open-source framework for building multi-platform applications from a single codebase. An easy step-by-step guide that can be followed without much preparation is provided for beginners, as well as practical tips and a code example for Flutter developers who are new to developing Galaxy Watch applications. Check out the tutorial and start developing Galaxy Watch applications!

      Learn More Tutorial: Monitoring Your Cards in Samsung Wallet in Real Time
      Do you want to monitor the status of cards added to Samsung Wallet on user devices in real time? Samsung Wallet provides the Send Card State API to make it easy to track the cards, as the API notifies the server of any changes whenever a card is added, deleted, or updated.
      The tutorial covers how to set up server notifications, how to receive notifications to a Spring server, and how to securely verify the received notifications. Learn how to monitor the status of cards in Samsung Wallet in real time.

      Learn More Samsung Electronics Demonstrates AI-RAN Technologies, Paving the Way for the Convergence of Telecommunications and AI
      Telecommunications technology is evolving beyond just improvements in data transmission speed, moving towards emphasizing user experience, energy efficiency, and sustainability. Samsung Electronics is accelerating the emergence of the era of future communications by showcasing the AI-RAN technology which integrates AI technology with the Radio Access Network (RAN), which is the core technology for communications networking.
      In particular, at the Silicon Valley Future Wireless Summit held in November 2024, Samsung Electronics demonstrated the results of the AI-RAN PoC to global communications providers, the first in the industry to do so. The technology indicated a possibility to greatly improve data throughput, communication coverage, and energy efficiency compared to the existing 5G RAN. It also proved the convergence of communications and AI could significantly enhance network performance. Learn more about Samsung Electronics' AI-RAN technology that goes beyond the boundary of communications and creates smarter networks with AI.

      Learn More Building a Trusted Execution Environment on RISC-V Microcontrollers
      In embedded systems such as IoT devices, it is crucial to protect sensitive data. For this, a Trusted Execution Environment (TEE) is required. It creates an isolated environment within the processor, so that security-sensitive tasks can be executed without risk of external threats.
      Samsung Research is conducting a study on how to implement the TEE technology on RISC-V-based microcontrollers (MCU), an open-source hardware architecture, and has introduced mTower, a core project related to this study. Learn more about stronger security for IoT devices on the Samsung Research blog.

      Learn More   
      https://developer.samsung.com

      Copyright© %%xtyear%% SAMSUNG All Rights Reserved.
      This email was sent to %%emailaddr%% by Samsung Electronics Co.,Ltd.
      You are receiving this email because you have subscribed to the Samsung Developer Newsletter through the website.
      Samsung Electronics · 129 Samsung-ro · Yeongtong-gu · Suwon-si, Gyeonggi-do 16677 · South Korea

      Privacy Policy       Unsubscribe

      View the full blog at its source
    • By Samsung Newsroom
      Samsung is expanding its partnership with Art Basel to Art Basel Miami Beach. Following the debut as Art Basel’s first-ever Official Visual Display partner in Basel, Switzerland earlier this year, complete with an immersive Collectors Lounge experience. Through this unique partnership, Samsung is also launching a new initiative with Art Basel to bring curated collections of contemporary artworks from Art Basel’s renowned exhibiting galleries exclusively to the Samsung Art Store. A new collection will be shared once a quarter with the first collection launching today.
       
      ▲ Fred Tomaselli’s Irwin’s Garden (detail) (2023) shown on The Frame by Samsung. Photo: Samsung
       
      The Samsung Art Store is available on The Frame, the best-selling lifestyle TV from Samsung that doubles as a piece of art. Subscribers around the world can experience gallery highlights from Art Basel, which joins other renowned collections such as those from The Metropolitan Museum of Art, The Museum of Modern Art and The Musée d’Orsay available on the Samsung Art Store. The latest partnership with Art Basel underscores Samsung’s commitment to making world-class art accessible to anyone with The Frame through its innovative platform. 
       
       
      Samsung Art Store Subscribers Get an Exclusive Look
      Art Basel Miami Beach is the premier global art fair of the Americas with cultural significance attracting thousands of art enthusiasts every year. For the first time, this exclusive experience is being delivered directly to the screens of millions of people through The Frame.
       
      Ahead of Art Basel Miami Beach, Samsung Art Store subscribers will have access to a curated collection of 15+ select works from Art Basel’s galleries, some of which will be displayed at the highly anticipated fair, taking place from December 6-8, 2024 at the Miami Beach Convention Center. The collection features pieces from international contemporary galleries, including James Cohan, Kasmin, moniquemeloche, mor charpentier, Nara Roesler, Roberts Projects and Tina Kim, offering subscribers a unique, front-row look at some of Art Basel’s incredible works of art.
       
      ▲ Candida Alvarez’s Mostly Clear (detail) (2023) shown on The Frame by Samsung. Photo: Samsung
       
      Founded in 1970 by gallerists from Basel, Art Basel is the world’s premier art fair for modern and contemporary art. This year in Miami Beach, Art Basel will bring together 286 leading international galleries from 38 countries to present artworks of the highest quality across all media — from painting and sculpture to photography and digital works. Art Basel will once again reaffirm its unparalleled position as a platform for discovery and encounters that drive the art world.
       
      “Art Basel’s mission is to power the world of art by connecting leading artists and galleries with art loving audiences,” said Noah Horowitz, CEO of Art Basel. “Our collaboration with Samsung allows us to extend that reach like never before by broadening access to leading galleries and significant works from established artists to a new generation of emerging talents.”
       
      Yong Su Kim, EVP and Global Head of Video Services and Partnerships at Samsung, echoed the excitement surrounding this partnership. “Art Basel represents the pinnacle of contemporary art, and we are thrilled to amplify that experience with leading display technology that brings art to millions of people,” Kim said. “Through the Samsung Art Store and the lifelike visuals of The Frame, we are making it possible for anyone to experience Art Basel and take part in an iconic cultural moment.”
       
       
      Samsung Art Store Collectors Lounge to Feature Industry Panels, Interactive Activation and More
      As the Official Display Partner of Art Basel Miami Beach, Samsung is hosting a dedicated Samsung Art Store Collectors Lounge from December 4-8 under the concept, “Bringing Art Home,” where attendees can enjoy remarkable artworks on The Frame’s museum-worthy display. In addition, visitors will see The Frame showcased with unique bezels in various colors and designs from DecoTVFrames, an official Samsung partner exclusively available for The Frame.
       
      The Frame will also be installed throughout the fair to present visitors with a variety of vivid screen experiences.
       
      In addition to its dynamic Collectors Lounge experience, Samsung is hosting a series of panel discussions featuring influential voices from the contemporary art world. These sessions include:
       
      Celebrating Women in Art and Technology — Innovation and Expression
      An engaging panel led by Daria Greene, Head of Global Curation at Samsung. This discussion celebrates the journey of female artists and innovators who are redefining the intersection of art and technology. Gain insights into how digital platforms are amplifying voices and breaking new ground in contemporary art. The Future of Digital Art — Innovation, Rights and Connectivity
      Explore the future of digital art in this thought-provoking panel, moderated by Maya Harris, Head of Business Development and Strategic Partnerships at Samsung. This session delves into how technology is reshaping artistic rights, accessibility and the ways institutions and artists connect with global audiences.  
      As the home for Samsung Art Store, The Frame has been refreshed in 2024 to deliver an even more complete artistic and aesthetic experience. That includes Pantone Validated ArtfulColor Certification,1 the industry leading color experts. The Frame is the world’s first and only art TV to achieve this validation, ensuring natural and realistic visuals that wouldn’t look out of place in a gallery. It also sports an Anti-Reflection with Matte Display, helping you limit light distractions so your artwork appears even more true-to-life. The Frame hangs just like a picture flush against the wall and is available in class sizes ranging from 32 to 85 inches.
       
      The Frame also delivers value-add features that you can only find from Samsung — the #1 global TV brand for 18 years and counting.2 Samsung technology makes everything you watch look clearer and crisper, while you enjoy access to 2,700+ free channels, including 400+ premium channels on Samsung TV Plus.3 You can also game without a console through Samsung Gaming Hub,4 use your TV as your smart home hub and ensure your personal data is protected by Samsung Knox security.
       
       
      1 Pantone company provides a universal language of color, called Pantone Matching System, that enables color-critical decisions through every stage of the workflow for brands and manufacturers.
      2 Source: Omdia, Jan 2024. Results are not an endorsement of Samsung. Any reliance on these results is at the third party’s own risk.
      3 Available for free on Samsung Smart TVs released after 2016, Galaxy devices, Smart Monitors, Family Hub refrigerators and the web.
      4 Available games and content may vary by country and model and are subject to change without notice. Certain games require a separate controller. Internet connection and subscription may be required. Requires a Samsung account.
      View the full article
    • By Samsung Newsroom
      The Samsung Galaxy Watch is an essential gadget for modern health-conscious people. It provides health-related data that helps to prevent health issues. These Galaxy Watch features are driving its rapid rise in popularity and encouraging application developers to create applications specifically for it.
      The Galaxy Watch offers a great user experience and performance. This is where the Flutter framework plays a crucial role. It is a top choice when it comes to a beautiful UI, good performance, and rapid development. Flutter offers cross-platform support, which means we can build applications for multiple platforms using a single code base. With Flutter’s strong community support, developers can make production-grade applications with little effort.
      This blog outlines the steps involved in creating an application for the Galaxy Watch using Flutter, allowing you to explore the possibilities it offers.
      Set up your environment
      Please follow the official Set up Flutter guide to install the Flutter framework correctly on your device. After the installation, please check the status by running the following command. It tells you if any component is missing or suggests what to do next.
      flutter doctor NoteIf the above command provides suggestions or fixes, follow those to solve any problems before continuing. Get started with Flutter projects
      To simplify this application example, we are retrieving the battery levels from a Galaxy Watch to make it easy to understand the development process.
      In this blog, we use Android Studio as the IDE. But, if you are comfortable with VS Code, you can follow this Official Codelab to build your first Flutter application with that instead.
      To start, install the Flutter and Dart plugins on Android Studio. These plugins make it easier to manage Flutter development using the UI instead of the CLI.
      Figure 1: Install Flutter and Dart plugins
      After completing the setup, it is time to create the Flutter Project for Galaxy Watch.
      Go to File > New > New Flutter Project. Note that this method only appears if you installed the plugins mentioned above. Select Flutter from the left side panel and set the Flutter SDK path where it was installed during the Flutter setup, and click the Next button. Enter a project name and location, and choose the language according to your preferences. Uncheck all platform options except Android and keep the other options as they are. Click the Create button, and a new window should open with the project. You are now done. Next, we need to modify the code for Galaxy Watch.
      Break down the elements of a Flutter project
      A simple Flutter project for the Android platform contains the following folders:
      android/: Contains Android platform code and configurations. lib/: The main folder for a Flutter application. It contains your Dart code. The main.dart file is the entry point of a Flutter application. pubspec.yaml: A configuration file for Flutter. It manages the application’s dependencies and assets. Configure the project to support Galaxy Watch
      Let’s modify the generated code to include the battery level, allowing it to be displayed. Open the pubspec.yaml file and add the following plugins under dependencies:
      dependencies: flutter: sdk: flutter wear: ^1.1.0 battery_plus: ^6.0.3 We use the wear and battery_plus plugins for this project. The wear plugin provides APIs for wear-related functionality, and battery_plus is for accessing battery information from the OS. Both plugins were developed by the Flutter Community. You can even get battery information or trigger Wear OS native APIs using the Method Channel, which we will cover in our future blogs.
      Change the value of minSdk to 23, which is required for the plugins that we are using. Go to android > app > build.gradle and change the minSdk property value under defaultConfig.
      defaultConfig { applicationId = "com.example.flutter_app" minSdk = 23 targetSdk = flutter.targetSdkVersion versionCode = flutterVersionCode.toInteger() versionName = flutterVersionName } Add the following code to your AndroidManifest.xml file, above the <application> tag. This tag defines that we are building the application for watches.
      <manifest xmlns:android="http://schemas.android.com/apk/res/android"> <uses-feature android:name="android.hardware.type.watch" /> <application android:label="galaxy_watch_battery_info" Build the watch application
      The main challenge is crafting your application to fit a tiny screen. We must be aware of good practices regarding UI, UX, and compactness at the same time. But as mentioned, this application is a simple one.
      Here we work with the build function of the MyHomePage class, where the UI implementation is applied. The main() function is the starting point for a Flutter application. It triggers the build function sequentially. Refer to the following build method for an example.
      @override Widget build(BuildContext context) { return MaterialApp( title: 'Galaxy Watch Demo', theme: ThemeData( visualDensity: VisualDensity.compact, useMaterial3: true, colorSchemeSeed: const Color(0x9f4376f8), ), home: Scaffold( body: SafeArea( child: _getWatchView(context), ), ), ); } The widgets we use are:
      MaterialApp: The root widget that contains all the contents of the application UI and provides application functionalities like home, theming, navigations, localizations, and so on. Scaffold: It provides a visual layout structure for an application, which has options like an app bar and body. SafeArea: A widget that encircles its child to ensure it avoids overlap with the OS interface. Tailor the UI
      We can now access the WatchShape widget since we converted our application to a watch application. WatchShape is the key widget for watch UI design. It provides the basic interface shapes for watches along with ambient modes of the watch. As mentioned earlier, the UI has a simple button that queries the battery level and shows it in a dialog.
      Widget _getWatchView(BuildContext context) { return WatchShape( builder: (BuildContext context, WearShape shape, Widget? child) { return Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [const Text("Hello from Galaxy Watch"), ElevatedButton(onPressed: () { _battery.batteryLevel.then((batteryLevel) { showDialog<void>(context: context, builder: (_) => AlertDialog( content: Text('Battery: $batteryLevel%'), actions: <Widget>[ TextButton( onPressed: () { Navigator.pop(context); }, child: const Text('OK'), ) ])); }); }, child: const Text('Get battery level'))]) ); }, ); } The widgets we use are:
      WatchShape: This widget makes the UI compact to fit the watch’s small screen. battery.batteryLevel: To access the battery information, we need to create an instance of the Battery class. Please refer to the following code as an example. final Battery _battery = Battery(); Test the application
      Now it’s time to see how your application works. Save all the changes and run the application by clicking the Run button from the “Main Toolbar.” You should see a new UI titled “Hello from Galaxy Watch” with a single button. You have created a Flutter application for a Galaxy Watch. Congratulations!
      Figure 2: Sample application
      Conclusion
      This blog walked you through building an application for Galaxy Watch. Flutter offers an amazing toolkit for crafting beautiful UIs. Within a short time you can build applications on a device to accomplish what you want.
      Don’t forget to experiment with building applications and enjoy the journey of creating something new for Galaxy Watches. For more tips and tricks on Galaxy Watch application development, please keep your eyes on the Samsung Developer portal.
      View the full blog at its source
    • By Samsung Newsroom
      Samsung Electronics today announced the installation of its Outdoor LED Signage XHB Series (P8) at the flagship location of Shinsegae Department Store in Seoul, South Korea. Unveiled during the “2024 Lights Up SEOUL, KOREA” event today, the installation is set to establish Myeongdong Square in Seoul as Korea’s new premier landmark, featuring a stunning media lighting display that illuminates the heart of Seoul’s iconic shopping district.
       
      “Our LED displays present unlimited possibilities for places like Myeongdong to bear new elements of cultural significance,” said Hoon Chung, Executive Vice President of the Visual Display Business at Samsung Electronics. “This installation gives us an opportunity to showcase in the biggest way possible that our outdoor digital displays are built to engage, built to deliver impactful content, and built to last.”
       
      Located within the Myeongdong Special Tourist Zone Area, Shinsegae Department Store is uniquely positioned as a free outdoor advertising zone that enables creative and expansive installations. Samsung’s massive outdoor LED signage featuring an anamorphic 8K display, wraps around the entire outer wall of the building, measuring 71.8 meters in width and 17.9 meters in height — equivalent in size to three basketball courts.
       

       
      Spanning a total area of 1,285 square meters, the display is designed for resilience in harsh weather, featuring an IP66 rating for dust and water resistance, and UL 48 and UL 746C certifications1 for year-round durability. The installation is engineered for high visibility and vibrant color accuracy, with support for HDR10+ technology to deliver sharp contrast and rich visuals. With a max brightness of 8,000 nits,2 the display ensures exceptional clarity even in direct sunlight. Its high refresh rate of 7,680Hz minimizes flicker and the moiré effect,3 ensuring a stable display that remains visually crisp, even through camera lenses.
       
      Samsung’s track record of success with digital signage spans prominent venues worldwide. In South Korea, Samsung provided the country’s largest ever high-definition LED signage to Coex SM Town, while transformative installations at New York’s Citi Field and Houston’s Minute Maid Park set new standards for in-stadium displays. At Citi Field, Samsung installed the largest scoreboard in professional baseball, featuring over 29,800 square feet of LED screens that immerse fans in the action from every angle. Similarly, at Minute Maid Park, Samsung’s high-definition LED technology redefined the fan experience with massive outdoor displays and a dynamic new main scoreboard, all designed to enhance the excitement of the game.
       

       
      In Myeongdong, the new installation will not only host engaging advertisements and dynamic video content, but also transform into a breathtaking annual Christmas media façade, creating a festive atmosphere for visitors.
       
      “Shinsegae’s media façade, beloved by global customers for the past 10 years, has now been recreated as Shinsegae Square. This transformation paves the way for it to become an iconic landmark of Seoul, making it not only a must-visit attraction but also a central hub for K-culture. We are excited to partner with Samsung to bring our customers unique experiences that blend heritage and digital technology,” Shinsegae spokesperson said.
       
      Samsung’s Outdoor LED Signage is renowned for exceptional performance in demanding environments, evidenced by award-winning deployments at iconic venues such as Inglewood, California’s SoFi Stadium, which boasts the world’s largest LED videoboard ever built for sports, and the Formula 1 Las Vegas Grand Prix, where Samsung installed a 481-foot-long rooftop LED display in the shape of the F1 logo. As Myeongdong evolves into a global tourism destination, Samsung continues to lead with solutions that inspire and engage.
       
       
       
      1 UL 48 and UL 746C certifications, issued by Underwriters Laboratories (UL), verify compliance with safety standards for electric signs and durability of materials in outdoor environments, including UV and weather resistance.
      2 Maximum brightness measured post-calibration; actual values may vary with conditions.
      3 The moiré effect is an undesirable visual phenomenon that occurs when repetitive patterns, such as lines, are captured in photographs.
      View the full article





×
×
  • Create New...