Quantcast
Jump to content


Avoid Common Mistakes When Using the S Pen Remote SDK


Recommended Posts

2020-06-12-01-banner.jpg

The S Pen is a stylus exclusive to Samsung’s Note series devices, powered by Bluetooth technology. The S Pen for Note10 devices has accelerometer and 3D gyroscope modules, which enable the stylus to detect air actions, such as single and double button presses, and directional gestures, such as up, down, left, right, clockwise circle, and counter-clockwise circle gestures. You can use the S Pen Remote SDK to map S Pen actions and gestures to features in your application.

To help you avoid making the same mistakes as I did when I was developing my application with the S Pen Remote SDK, this article describes some common implementation mistakes and their solutions.

Note: The S Pen for Note9 devices do not support the S Pen Remote SDK, but you can implement single and double button press actions for it in the application configuration file.

Mistake #1: Too many remote action activities

The S Pen Remote SDK allows one remote action activity for each application. If you define multiple remote action activities, only one activity is functional.

Figure 1: Remote action activity in the AndroidManifest.xml file

Figure 1: Remote action activity in the AndroidManifest.xml file

Mistake #2: Air actions are disabled

When you install an application on a device, such as to test it, you must manually enable air actions for the application before the application can respond to S Pen gestures.

To enable air actions for your application, on the device, go to Settings > Advanced features > S Pen > Air actions, select the application from the App actions list, and toggle the Off switch to On.

2020-06-12-01-02.jpg 2020-06-12-01-03.jpg 2020-06-12-01-04.jpg 2020-06-12-01-05.jpg

Figure 2: Enable the application in the Air actions settings

If you want the application to have air actions enabled by default, you need special permission from Samsung to add the enable_key attribute to the remote-actions element in the remote_action.xml file. To obtain permission, submit the following information about your application to [email protected]:

  • Application name
  • Package name
  • Information about how air actions are used in your application:
    • Does the application use the media session?
    • Does the application support background playback?
    • Describe the user scenarios in which air actions are used.

Mistake #3: Remote_action.xml configuration problems

If your application is installed on the device but does not appear in the Air actions settings, check that the remote_action.xml file content is defined correctly.

Common problems include:

  • Duplicate action priorities: The priority attribute is a mandatory part of the action element. A smaller number denotes a higher priority. Make sure each action has a unique priority number.

 Figure 3: Priority attributes in action elements

Figure 3: Priority attributes in action elements

  • Incorrectly defined action labels: In the remote_action.xml file, make sure that the label attributes of the action elements refer to resource IDs. You cannot directly implement a text string in the label attribute. You must first define the string as a resource in the strings.xml file within the values directory, then refer to the string’s resource ID in the label attribute of the action element.

Figure 4: Assign resource IDs to label strings

Figure 4: Assign resource IDs to label strings

Figure 5: Refer to resource IDs in the label attribute
Figure 5: Refer to resource IDs in the label attribute

Hope this blog helps you to integrate the S Pen Remote SDK smoothly by avoiding these mistakes. You can also study the sample application for guidance.

View the full blog at its source

Link to comment
Share on other sites



  • 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 BGR
      Rumors said a couple of years ago that the second-gen Galaxy Z Fold foldable will support an S Pen stylus. That turned out not to be the case, as the foldable screen was too fragile to accommodate a stylus. A year later, the Galaxy Z Fold 3 brought a more robust layer of thin glass on top of the foldable display and a special stylus that could work with the handset. Then, early Galaxy Z Fold 4 rumors claimed that Samsung will deliver the next logical S Pen upgrade, incorporating the stylus into the next-gen phone.
      However, a leaker claims that won’t be the case, as the Fold 4 should have a thinner, lighter design than before. The claim isn’t without merit, considering that various Android vendors have released their first-gen flagship handsets in the past few months. And some of these devices already challenge Samsung’s dominance in the foldable market, proposing better designs and/or better specs.
      Don't Miss: Monday deals: 99¢ Echo Dot, $290 iPad, huge Roomba sale, Bic pens, more Will the Galaxy Z Fold 4 have S Pen support?
      Phones like the Oppo N Find feature a better aspect ratio for the external screen. The handset is easier to operate when folded than the Galaxy Fold design.
      The recently released Vivo X Fold features several specs upgrades over the Fold 3. That includes a dual in-display fingerprint sensor system. Furthermore, the Vivo handset has no gap when folded. And the phone’s design aims to prevent the appearance of a crease in the middle.
      None of these phones feature stylus support, however. The stylus is exclusive to the Galaxy Z Fold 3 for the time being. The Galaxy Z Fold 4 should also support the S Pen, a feature that some fans will continue to appreciate. However, well-known insider Ice Universe said on Twitter that Samsung won’t change the phone’s internal design to fit the S Pen.
      Reports from Korea said a few months ago that the Galaxy Z Fold 4 will feature a built-in stylus. But the leaker says that the Fold 4 will be smaller and thinner than before. Foldable handsets are already thicker than traditional smartphones when folded. Adding a built-in S Pen might increase that thickness.
      Moreover, a built-in S Pen will occupy space that could otherwise be reserved for the battery. In turn, this could impact battery life on a device with a very large screen.
      Also, the built-in S Pen forced Samsung to alter the Galaxy S22 Ultra design to fit the stylus. That’s why the Ultra has a curved display that’s more prone to accidents and flat top and bottom edges. Placing a stylus inside a foldable device might directly affect the phone’s design.
      Samsung’s Galaxy Z Fold 3 phones in various colors. Image source: Samsung The stylus is already in the works
      A separate report from a different leaker says the Galaxy Z Fold 4 S Pen stylus has reached the manufacturing stage.
      If this rumor is accurate, Samsung has begun production for the Fold 4 accessory already. That said, we have no details on the purported design changes or features of the next-gen S Pen stylus for foldable handsets.
      Also, the leaker makes no mention of the Fold 4’s design while referring to the S Pen stylus.
      The company should unveil the Galaxy Z Fold 4 and Flip 4 in early August. It makes sense for Samsung to have started manufacturing parts for the new foldables, especially considering the new supply chain issues from China. Several lockdowns are in place in China in response to a new COVID-19 wave. They could disrupt manufacturing for all sorts of devices.
      The post Galaxy Z Fold 4 might not have a built-in S Pen stylus appeared first on BGR.
      View the full article





×
×
  • Create New...