Quantcast
Jump to content


Recommended Posts

Posted

2021-04-13-01-banner.jpg

The Galaxy Store Developer API provides programmatic access to key functions of Seller Portal, such as managing your apps and in-app items or checking app performance. It is made up of a set of server-to-server APIs that access different areas of Seller Portal:

Before you can start using these APIs, you must meet all the requirements for access and authentication. Read on to find out more about these requirements.

Basic requirements

The following are the basic requirements are required to use all of these APIs.

  • Seller Portal account. A Samsung account is required to register for a Seller Portal account. You can sign up for a Samsung account when you register for a Seller Portal account.

  • Commercial seller status, to manage paid apps or in-app purchase items. If you want to manage paid apps or paid in-app items, your Seller Portal account must have commercial seller status.

  • Apps registered in Seller Portal. The Galaxy Store Developer API does not support new app registration. You must first register your apps in Seller Portal before you can manage them using the API.

  • Access token. The access token is used for authentication. A summary of the steps needed to create an access token are included in this blog.

Create an access token

An access token is sent in the authorization header of every API call. It defines the scope (which APIs you can call) and can only be used from a valid service account.

2021-04-14-01-01.jpg

Complete the following steps to create an access token:

  1. Create a service account. Log in to Seller Portal and go to Assistance > API Service. When you create a service account, you generate a private key (used to create your JSON web token) and service account ID (used in the authorization header of the Content Publish and IAP Publish APIs).
  2. Create a JSON Web Token. Create a JSON Web Token (JWT) by providing a header and registered claims to a site that generates the token or programmatically using a JavaScript JWT library.
  3. Request an access token. Request an access token from the Galaxy Store authentication server.

Click on the linked step to see more detailed information about how to complete each step.

Use the Content Publish API

The Content Publish API is used to view, modify, submit, and change the status of apps registered in Galaxy Store Seller Portal. When you have met the basic requirements and have your service account ID and access token, use the following headers:

curl -X <content-publish-api-request> \
  -H  "content-type: application/json" \
  -H  "Authorization: Bearer <your-access-token>" \
  -H  "service-account-id: <your-service-account-id>"

See Content Publish API for more information about available requests.

Use the IAP Publish API

The IAP Publish API is used to view, register, modify, and remove Samsung In-App Purchase (IAP) items. In addition to meeting the basic requirements, the following is also required:

  • The IAP Publish API must be connected with the content in the In App Purchase tab area of Seller Portal. To create this connection, you must either initially distribute your content using the Content Publish API or the content must be in the For Sale state in Seller Portal. If this connection does not exist, matching product information cannot be retrieved.
  • You must integrate IAP Helper into your app. All binaries registered in your content must support IAP.

When you have met all the requirements, use the following:

curl -X <iap-publish-api-request> \
  -H  "content-type: application/json" \
  -H  "Authorization: Bearer <your-access-token>" \
  -H  "service-account-id: <your-service-account-id>"

See IAP Publish API for more information about available requests and request parameters.

Use the GSS API

The GSS (Galaxy Store Statistics) Metric API is used to get statistics about apps registered in Galaxy Store. In addition to meeting the basic requirements, the following is also required:

  • Four cookie values required for authentication (see Get cookie values for more information)
  • sellerID, obtained by using the GSS User API
  • The statistics to view and other attribute values used to filter the response data (see GSS Metric API for more information)

When you have met all the requirements, use the following:

curl -X POST <gss-api-request> \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-access-token>" \  
  -H "Cookie:<gss-api-cookie-values>" \
  -d '{"<gss-api-attributes-and-values>"}' 

See GSS User API and GSS Metric API for more information about available requests.

Next steps

After you have met all the requirements, you are ready to start using the Galaxy Store Developer API. See Galaxy Store Developer API for a list of all requests available. Each request also includes examples showing usage and expected results.

View the full blog at its source



  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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
      February 2025 Certify your Matter Products with SmartThings – Fast & Easy
      Showcase your Matter products to over 380 million SmartThings users. Getting Works with SmartThings (WWST) certification is easier than ever. Our Developer Center offers many tools to help you certify, including Test Suite. Leverage the Test Suite to easily test your products; many products can even be self-tested without sending them to a lab. Once certified, you can display your products in the SmartThings application and on our website and unlock opportunities for co-marketing.

      Want to learn more? Fill out this form, and we’ll share more details on certifying your Matter products with SmartThings. Samsung Mobile Advance Applications Are Now Open!
      Call for innovators: Applications for our Samsung Mobile Advance Startup Incubation Program are now open. Turn your idea into reality with our 6-month Proof-of-Concept project with Samsung. Visit us for more information.

      Learn More Simple yet Impactful: Emulator Skins for the Galaxy S25 Series are Now Available
      The latest Galaxy emulator skins have been designed specifically for the Galaxy S25 lineup, allowing you to bring the premium look and feel of Samsung’s newest flagship devices to your Android application development. These sleek skins showcase the stunning design, rounded display, and bold style of the Galaxy S25 series. Building applications has never been easier. Download the emulator skins today and start creating applications that truly stand out.
        Download Tutorial: Elevate Your Watch Face with Stunning Weather Forecast Features
      Want to take your smart watch experience to the next level with our dynamic weather forecast features? With Watch Face Studio (WFS), you can seamlessly integrate real-time weather updates, making it easy for users to check hourly and daily conditions at a glance. Smart features like weather tags let you display forecasts while keeping the last update time visible, ensuring users always have access to the latest information. Ready to try it? This blog includes a sample project to help you bring these innovative features to life. Check out the full blog and give your watch face a fresh, weather-smart upgrade!

      Learn More Discover the New Samsung Tizen TV SDK v9.0.0
      The Samsung Tizen TV SDK v9.0.0 is now available! This SDK provides a suite of tools to help you start developing applications for the Tizen TV platform, including an IDE, a lightweight TV simulator for testing web applications, and a TV emulator. Download the new Samsung Tizen TV SDK now from the Samsung Developer Portal and start developing today.

      Learn More Deep Learning for CSI Feedback: One-Sided Model and Joint Multi-Module Learning Perspectives
      In 5G networks, massive MIMO (Multiple Input, Multiple Output) technology is essential for high-speed data transmission and enhanced reliability. To maximize MIMO performance, base stations (BS) require downlink Channel State Information (CSI) feedback from user equipment (UE). However, limited uplink channel resources can lead to overload issues. Therefore, maintaining CSI feedback accuracy while minimizing overhead is a critical challenge.

      To address this, Samsung Research proposes an AI-based One-Sided CSI Feedback method. This approach applies a deep learning model solely at the base station, reducing feedback overhead and protecting data privacy. This solution enables operation without collaboration among vendors. Learn more about the innovative potential of AI-based CSI feedback on the Samsung Research blog.

      Learn More FiRa Consortium Release 3.0 - UWB Core Specification and Certification Program Launch
      Ultra-wideband (UWB) technology is being used in various applications; including localization between smart devices, secure access, and tap-free payment. As recently released at the FiRa Consortium, the wireless communication, energy efficiency, precision measurement, and network connectivity technologies in the UWB Core Specification 3.0, are expected to be more efficiently utilized across various industries, including car access digital keys, public transport services, and path tracking.

      With the Samsung Galaxy S24 Plus models adopted as the Reference Devices for the FiRa 3.0 Certification Program, Samsung Electronics will demonstrate strong interoperability with devices featuring enhanced UWB chipsets. Learn more about the advancements in the UWB technology ecosystem and UWB Core Specification 3.0 certification program, both of which Samsung Electronics are actively involved in.

      Learn More Samsung Instant Plays: Off-Policy Selection for Optimizing Advert Display Timing in Mobile Games
      Samsung Instant Plays is a mobile application that gives users instant access to free games that can be played without installation. The application generates revenue by displaying adverts to users during gameplay. However, displaying adverts too often can lead to user churn, while displaying them too infrequently can result in revenue loss. Therefore, having a strategy for advert delivery timing is crucial.

      To address this, Samsung R&D Institute Poland has adopted an Off-Policy Selection (OPS) method. OPS aims to select the best policy available from a set of policies trained using Offline Reinforcement Learning, remedying the reliability issues in the existing Off-Policy Evaluation (OPE) methods. Find out more about optimizing advert delivery timing using OPS and its results 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
      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





×
×
  • Create New...