A Realization About Samsung S6 Power Saving Access

In a previous posting, I had remarked that the (famous) “Tasker” app has a 3rd-party plugin named “Secure Settings”, which has a sub-section named “Samsung ROM”, under which there is a function named “Enable / Disable Power Saving”.

The general context of this is, that Tasker is a task Acceleration / Automation tool, in which each Task is defined as a sequence of Actions, many of which are built-in, but some of which are Actions defined by 3rd-party plugins, such as by ‘Secure Settings’. Hence, it was a goal of mine to insert the Action into a Tasker Task, which would turn the Power Saving Mode on, on my “Samsung Galaxy S6″ phone.

I am Not Rooted.

This failed every time, and at first I thought the reason would be, that the author of ‘Secure Settings’ had failed to keep his module up-to-date with the latest Android Lollipop version, which my S6 is running.

But then another observation came to my attention.

The app “NFC Tools Pro”, and its companion, “NFC Tasks”, is also supposed to support, that an NFC Tag should enable Power Saving Mode on a Samsung Phone, when we tap the Tag. ‘NFC Tools Pro’ additionally has a mode in which it executes its Task as a test, before that Task has even been programmed into a Tag. And when I ran the test, this app was also unable to switch on Power Saving Mode.

In both cases the behavior is identical, in that the Action returns as a ‘success’ immediately (even though when I Enable Power Saving manually, it takes several seconds for this setting to kick in), but in that Power Saving Mode is not enabled – even later.

And so an inference which I am making about this feature, is that indeed the app developers are not up-to-date with the latest Samsung API – Only Because on the latest phones, one needs to be rooted in order for this command to work (!)

And so what I ended up doing both as an intended, future NFC Tag Task, and as a present Tasker Task, was simply to script a pop-up to appear, which states “Suggest to Enable (or Disable) Power Saving Mode Now.” It is a shame, that the whole procedure cannot be 100% automated, but I guess that Samsung has been very conscientious in its efforts to increase security. And denying ‘any old app’ permission to fiddle with the power settings in general, could be a step towards greater security.



How to make Tasker launch Google Play Music.

There exists an automation app for Android, which is named “Tasker”, and which can even be useful for non-rooted phones. Tasker has a plethora of Actions which it can sequence, in the definitions of Tasks which the user gives it, and the actions fall into many categories. Further, there exist plugins to Tasker, which add even more categories of choreographed actions which Tasker can run. And, Tasker has its own built-in Music Player.

But, several people have asked how it is possible to control the playback of music from other media players than the built-in one, most notably “Google Play Music”. One reason is the fact, that if we ever get into a confused state with our phone, we would like to take control of the process in spite of Human Error which always happens, and then to have all our widgets and controllers focused on one app, can be an immense benefit.

One way in which some people have recommend that we could control Google Play Music from Tasker, was by selecting an ‘Activity’ module, which allows the user to specify an app, and to specify an Intent as well. This is more or less what programmers would do, and involves some intricate spelling of syntax in fact. The fact that Tasker has an Activity module, which even displays a drop-down list of available Intents, does not help us much with Play Music however. I do not know if other people have had luck with that route, but I did not after some intense efforts today.

What worked for me, was to go into the Tasker ‘Media’ category, which offers a ‘Media Control’ Action, into which we can enter, which Media Player we would like to use, and which Simulated Media Button command we would like to send it. This is more of a GUI-oriented approach, and works much better for me.

This playing with Tasker is part of an effort I am making, to streamline the process by which I get out the door in the morning, which I will eventually be trying to accelerate with NFC Tags. But since the Tasks which I have waiting for my tags, when those arrive, often use such tricks as to invoke Tasker in the background, this suggests the question of why tags are even of any benefit, since by now I have a custom Notification Icon, which just launches a Tasker task, which sets me up almost as quickly.

One quirky answer to that for the moment is, that there is a bug in how Tasker would try to enable Power Saving Mode on my Samsung phone. That module just does not work for the moment, while I have every reason to expect that the “NFC Tasks” app will be able to accomplish that part of the daily ritual successfully. So that part of my automation is not implemented yet.



NFC Tasks Requires that the Phone Not Be Locked.

I this previous posting, I wrote about how tapping an NFC Tag, with the “NFC Tasks” app installed, can cause a phone to perform an automated sequence of actions. I have learned that in order for this to work, any lock screen on the phone must have been unlocked, and that the phone must not be asleep.

I find that sensible.

And there do exist rooted users, who will go through complicated measures to bypass this. But since my phone is not even rooted, this subject does not apply to me.



I may soon start using NFC Tags.

One of the realities of technology today, is the existence of ‘NFC’ Communications, which stands for “Near-Field Communications”. One of my friends has already asked me more or less, ‘We already have ‘WiFi’ and ‘Bluetooth’, so why do we need yet another type of short-range communication protocol?’ And my honest answer was, ‘To be able to do even more than we were able to do before!’

It is also a reality, that the tech-savvy world has known about NFC for some time. There was a misconception which I had, according to which NFC Tag Utility and Information apps on our phones were supposed top be able to read data stored on credit-cards and other types of chip-cards. But this is not really true. There exist different types of chip-cards, and credit cards are not compatible with most popular smartphone apps. There could be special apps designed to read them, but in general this is not how it works.

Instead, we can buy tags meant for apps, and meant for the consumer market. One app I have had installed for a long time, is named “NFC Tools Pro” and is sold on the Android Market by a group named “wakdev”. Apparently, users can store a small number of bytes of data on our actual tags, that include URLs to Videos, Web-pages, and other types of online content. But in addition, this app allows the user to store a sequence of actions on a tag, which a companion-app will execute on the phone, when the phone is tapped against the tag afterward. The companion app is named “NFC Tasks”, again from “wakdev”.

Because the companion app would practically need permission on our phone to do just about anything, ‘wakdev’ decided to split that into such a separate app. Without it, ‘NFC Tools Pro’ is merely able to program tags, to trigger for content to be played by receiving phones.

Obviously, in order for this to work, the programming on the tags needs to be somewhat compatible, between the phone that stored the data, and the phone which taps on the tags.

One obvious issue which I have wondered about, was what sort of security might exist. In theory, a tag could be programmed maliciously by an unknown third party, and the user could be tricked into tapping on it, at which point the question becomes, whether his phone would suddenly carry out actions and config changes, which were planted in our midst. The answer to how this problem was solved, is not obvious if users simply have ‘NFC Tools Pro’ installed. But once we install ‘NFC Tasks’, we can see that a simple solution has been provided by ‘wakdev’, on the user-level.

By itself, the ‘NFC Tasks’ app can be configured to enforce a White-List of recognized tags. I presume they have some sort of serial number… Or, it could work via Message Digest – aka Hashcode.

But simply having the software installed does nothing for us. We need to have actual tags in our possession, in order for any of this to do anything. Fortunately, the company which sells the app, also makes it easy for the user to order physical tags online, by tapping within the ‘NFC Tasks’ app. We just need to have a valid credit card to pay for them, and a good Web-browser installed on our phone.

And so to maximize the chances of compatibility, I have just ordered for a batch of 10 “Whiztags” tags plus a keychain to be shipped to me from Australia. I ordered the ‘NTAG 216′ 10-Pack, the tags of which are capable of storing 888 bytes each.

I already have an idea of what I might use these for, before I have even received a single tag.

One of the tasks which I carry out on my phone routinely, is to switch it from ‘Apartment Mode’ to ‘Street Mode’ and back again. The actual sequence is

  1. Enable my ‘Headphone Controller’ Profile.
  2. Insert my Headphones.
  3. Start the Google Play Music app.
  4. Turn off WiFi.
  5. Put the phone into Power-Saving Mode.

I also need to carry out all these steps in reverse, every time I come back home. This is tedium which can actually slow down how fast I get out the door, or how fast I want to settle in, after I get home. And so I’m thinking of a similar sequence, which could be programmed into a tag by the door, for when I am leaving, and which can be programmed into a tag in my computer room, for when I get back home. Doing so might speed up my moving around.

One aspect to this project though which I have not completely answered is, ‘Because the action of inserting my headphones still needs to be mechanical, exactly what will the sequence be, that the tags carry out?’ But I am confident, that I will be able to find a solution to this aspect. For example, my headphones controller app can sense whether the headphones have been inserted automatically, assuming that it has been launched. Also, this app is smart enough to recognize, if headphones were inserted before it was launched, that then they count as inserted, at the time the app is launched. This would be a key detail.

What this capability of the Headphone Controller app means, is that I can program it into the Profiles of the Headphone Controller app, where I already have it programmed to reset the volume level as well, to Launch the music for example, or to Stop the music…

Also, the Whiztags tags have an adhesive backing. This means that I could theoretically attach them directly to the inside of my apartment door if I wanted to. I would only need to ask myself, whether I would really want to be so committal. Having a tag glued to my door, that can be locked so that its functions can no longer be reprogrammed, and then perhaps to have to replace that tag, would also count as damaging my door. So instead my exact methods of attaching the tags will also need to be adapted to my needs.

But for now, I am simply waiting for the order which I just placed to be fulfilled, and for my tags to arrive.