Run Tasker task or application before turning off / Mi Box Android TV 7.0 - Android Stick & Console AMLogic based Computers

Hi,
I have a Mi Box (official Android TV) with 7.0 Nougat Beta 1028.
I'm trying my best to figure out a way to run a Tasker task before the device turns off/goes to sleep. The reason I want to do this is that I have a Harmony Hub which I need to run the Power off activity when the Mi Box turns off via the original Mi Box remote. I have setup Tasker to run a Harmony Activity when the device turns on, and this works great. But I am not able to make Tasker run an activity before it turns off.
I have tried two different approaches, first via Tasker. Created a profile, which when the Display state is Off, it should run the Harmony Hub Power off activity. This works maybe 1 of 10 times. So not reliable.
The next approach which I think would be the best is to remap the power button on the remote. I found this application: https://play.google.com/store/apps/details?id=flar2.homebutton&hl=sv
This application lets me remap every button on the remote except the Power button. So that is my problem, if it would let me remap the button, I could set it to run the Task and the Mi Box would power off also (as it is included in the Harmony activity).
From what I understand the Mi Box beta 1028 is possible to root, to access the system files, but no SuperSU support or anything. So is there any file I could edit, to remap the button this way? Or maybe if there is some systemfile I could put somewhere to run before the device goes to sleep?
I'm pretty much stuck right now and I would love to get this to work. It would allow me to use the Mi Box remote which I love, but not loose any functionality from the Harmony Hub.
Please help me with this! Thank you!

Related

(UPDATED 18-09-2010) Auto Lock (CSDEVCTRL)

Hi all,
as am now moving to a more open platform (android), i would like to return the favor of learning through this forum, how to program on win mobile by posting the code of this utility.
Its given as is, no warranties, no tricks, do not expect a well written code etc.
Based on C++, no .Net.
Hope will provide to someone, knowledge and info on this subject.
Have fun with it.
Chris
This is the link
http://rapidshare.com/files/419726318/csdevctrl.zip.html
--- Old introduction ---
Hi all,
this is mainly an auto locking program which utilizes the Windows Locking for partial locking (phone related keys are active)
or complete locking (no keys are active).
It can be considered as an add-on to other programs which provide the User Interface, an 'In Call Locker'
with some goodies as mentioned later on which may or not depend on whether the device is locked (with any program that uses
the Windows locking).
The locking can be activated at the following events:
1. After a specified period of idle time (no screen tapping or touching the keyboard).
2. After the device has waken up.
3. During a call ("In-Call Locking" Partial or Full).
Also for any of the first 2 events (idle or wake up) the program can run a specified executable/registered file together with any command line arguments that might be required.
Finally, some 'goodies':
(Stand-alone means it does not require any other option or the device to be locked)
A.(Stand-alone) it can provide some customization on the carrier name so that:
- It can fit on the screen (for example not to overwrite the Battery icon in SPB Shell).
B. (Stand-alone) Turn on Bluetooth if a call is being dialed or received. Then switch it off after
the call has ended and the headset is not connected.
Usefull if you have a bluetooth handsfree kit in your car and you do not want to keep on turning on/off
the bluetooth.
C. (Stand-alone) Flash the Backlight and or Vibrate while ringing.
At last, you can 'see' if your phone is ringing.
D. Reset the Exchange Server Policy.
Stops the frustrating setting of the password being required after connecting to the exchange server.
F. Turn off the display or/and the device itself.
It can be used as a power saver while playing music etc.
G. Set your favorite SIP (which is being reset back to the default with every soft reset).
H. HotKeys (NEW)
You can assign as sequence of keys to perform an action.
(see http://forum.xda-developers.com/showpost.php?p=3666785&postcount=702)
The parameters that are driving the behaviour of this utility are located at:
http://forum.xda-developers.com/showpost.php?p=2424492&postcount=148
The parameters can also be updated using the setup program provided (csdevctrlsetup.exe).
A flow diagram of the parameters that relate to locking, is provided in the zip file for better understanding of their use.
The debugscr.exe program has been added to help identifying the keystroke codes and coordinates. Before this program is executed
the csdevctrl must be stopped as mentioned further down.
To install it:
- Use the cab file provided.
Simply run it and it will create:
- under the 'Program Files' a directory with name CSDevCtrl'
This directory will contain:
csdevctrl.exe is the main program
csdevctrlsetup.exe is the setup program
debugscr.exe is a utility to find the coordinates and keystrokes (optional).
- Shortcuts under the 'Programs'.
- They can be installed either in the internal memory or on a storage card.
To run it:
> Run the Setup program to set the parameters and the Start Up option.
> Run the program (csdevctrl) and it will spawn at the background as another process.
The device will vibrate once to show that the program has started.
To stop it:
> Running the program second time will cause the program to exit (It will show a confirmation window which will close in 3 seconds unless you close it sooner).
To uninstall it:
> Close the process as usual (run it again or kill the process).
> Remove it from the installed programs.
> Also delete the registry key HKEY_LOCAL_MACHINE\Software\CSDevCtrl
As a note, do not rename the csdevctrl.exe as the uninstall depends on this name.
It has been compiled only for WM6.
For more information see the next link:
http://forum.xda-developers.com/showpost.php?p=2391054&postcount=142
If you wish to buy me a beer or a pitta of souvlaki for my effort, feel free to click on the link below:
https://www.paypal.com/cgi-bin/webs...ode=EUR&lc=CY&bn=PP-DonationsBF&charset=UTF-8
Cheers
Chris
Log:
29/11 - v.6.5 - Added power off after disconnect, support for 6.5 win (beta)
17/09 - v.6.18 - General Policy handling, Dump variables for debugging purposes
04/08 - v.6.16 - Added option for startup delay, Keep the backlight on while on call, lock when dimmed.
27/06 - v.6.15 - Added option to lock only if specific programs are running
20/06 - v.6.14.1 - Fixes.
no bad, i like how it uses the built in windows lock.
Thanks,
it works well with my favourite program (Spb shell) which is the reason of me developing this.
this works great on the smartphone but there is a visible window which can be closed too easily with task managers and can't be navigated away from.
any poss you could hide it rather than minimise it?
looeee
i have updated the program to be windowless as you mentioned (attachment replaced)
Hope it works for you.
Cheers
Chris
chrisstavrou said:
i have updated the program to be windowless as you mentioned (attachment replaced)
Hope it works for you.
Cheers
Chris
Click to expand...
Click to collapse
First of all, thanks for sharing!! This is a very nice app.
I've tested the 2 versions (window and windowless), and I have a suggestion if I may.
I like the idea of the program being windowless, since it becomes more appealing to the eye (I mean, it's great we don't have to see the small window minimize everytime we wake the device), but now, to be able to close the app, we must use a task manager to kill the process(e.g. sometimes we may want to test some other locking software and we need to disable it temporarily). So my suggestion would be that when we run the program once it starts, the next time we run it, it stops. Would that be possible? I think it would make your app perfect!!
Remember, it's only a suggestion.
Thanks in advance.
Its good to know that it may be of use by someone
I have updated it as you mentioned, it will exit if you run it the second time (attachment replaced).
chrisstavrou said:
Its good to know that it may be of use by someone
I have updated it as you mentioned, it will exit if you run it the second time (attachment replaced).
Click to expand...
Click to collapse
Now it's just great!!
Thank you very much for this.
What's the purpose of this app, from the description above it looks as though it does what the original lock already does, so I ask again; what's the purpose of this app?
NiteStalker said:
What's the purpose of this app, from the description above it looks as though it does what the original lock already does, so I ask again; what's the purpose of this app?
Click to expand...
Click to collapse
Automatic lock!!
Once your device light gets dimmed, or on device wake up, without having to press the lock button.
Is that clear enough for you?
Just set the time for 0 minutes, and it's locked on wake-up.
Guess the dim part is good, thanks for clearing that up. I guess my brain wasn't working, I couldn't figure out what deemed was.
now i love the app for what it does... my only suggestions or worries are... after setting that up, i no longer am able to input a password when the lock is activated... and when the program is activated, it wakes the device up from the dimmed, light, thus defeating the purposes of the backlight going off... and also draining the battery a little more... is there ayway that the program can run without waking the device?
MrGalione973 said:
and when the program is activated, it wakes the device up from the dimmed, light, thus defeating the purposes of the backlight going off...
Click to expand...
Click to collapse
I have had this happen to me sometimes as well, already in my short testing time span: when pressing the power button (once) the backlight switches off and back on!
I am also experiencing that it sometimes just does not seem to lock: when pressing the power button twice (with pause) my device only sometimes locks.
And in case you are open to another suggestion: perhaps you can minimize all windows when locking, so the lock ends up on the today screen; or make it an option somehow (command line parameter?)
Thanks for the advices i will be checking them out and come back to you
mousio said:
And in case you are open to another suggestion: perhaps you can minimize all windows when locking, so the lock ends up on the today screen; or make it an option somehow (command line parameter?)
Click to expand...
Click to collapse
Another vote for that!
TBH the only reason I still use S2U is because I can see my missed calls, appointments etc. It's a great app, don't get me wrong, just not something I need.
Your locker would be perfect for me with an option to go back to Today on locking.
Or, perhaps you could implement a simple count of missed calls, SMS, MMS, emails and appointments directly on the lock screen? Just don't let it grow too much!
works beautifully for me with the spb mobile shell 'now' screen showing me the info, thankyou very much!
Why don't you add an option of command line parameter specifying a program/link to be launched before locking? That way it would be very flexible (there are plenty of small programs around doing loads of stuff - like minimizing everything or sending a text or calling your mama - possibilities are endless)
Program has changed as per your advices:
- Leaves the device in idle state for better power management
- Run an application while trying to lock by reading a file.
I have updated the first entry of the thread with some more info and the file.
Any comments are welcome.
Enjoy
I love it. It's simple and effective. Just the way I like things. I'll keep testing it for a while and report back.
I've got another idea actually.TODAY option works really well, the only 'problem' (its not a problem,just room for improvement ) that you need to reopen all the windows you had opened before.
How about an option TODAY&BACK when the minimised windows would be reopened when unlocked? In other words-minimised when locked, back to what it had been before locking when unlocked? It would make it perfect (until next idea strikes)
Anyone tested it on WM5?

Schedule power on and off app?

Anyone know of an app that can power off the phone at a certain time and then power it back on?
How would this app be running when the phone is off? I'm sure profile settimgs or tasker could put it in airplane mode for a a certain period.
Im not sure if any app could power back on the phone, but if anything could it would be Tasker, i just got it the other day and i LOVE it, you can automate just about anything your heart could desire. Check it out here:
http://forum.xda-developers.com/showthread.php?t=717303
Cheers,
Daugusta
Daugusta12 said:
Im not sure if any app could power back on the phone, but if anything could it would be Tasker, i just got it the other day and i LOVE it, you can automate just about anything your heart could desire. Check it out here:
http://forum.xda-developers.com/showthread.php?t=717303
Cheers,
Daugusta
Click to expand...
Click to collapse
Tasker is the whole reason I am looking. The developer of tasker said that running commands as root is not yet supported. So, I just need to run an app that will shutdown the phone at a specified time.
jsapp said:
How would this app be running when the phone is off? I'm sure profile settimgs or tasker could put it in airplane mode for a a certain period.
Click to expand...
Click to collapse
Just asking. Years ago, my blackberry could do a full power off and back on at specific times.
Just an app for unrooted phones that restarted the phone at a set time would be great. Anyone seen anything.
i imagine the app would be phone specific? Idk about other android devices, but when the captivate is off and you plug it in to charge, it boots up a screen showing battery levels. Following on that line of thinking, why not replace the battery meter with a timer and fool the phone into thinking its always plugged in charging? ofc, this is a very crude way to do it but it may set people on the right line of thought.
I bet the blackberry that did it had some special hardware though that held some minute charge and timer.
Shut off / Wake up
I had a BBB 9000 and it came with a native program to set a time to wake up and shut off the phone at a time you would set. It had it for through the week and weekends. I really liked to be able to do that,
this owuld be a great app!
I am looking for something like this too. I used to have the native app on my blackberry and miss it. Any programmers out there want to take it on?
i realize this is quite the old post but many chinese phones support this and the scheduled option is in the settings menu to turn on and off the phone so it appears to be built into the rom
Yes, most Chinese android phones come with this feature. It has its own tab "scheduled on and off" in the settings section.
I had a meizu M2 which ran on FLY-OS(Android lollipop) and it had this feature. It was able to power off and back on again by itself. Even if I removed the battery after powering off the phone and insert it 20mins later, it would still power on at the set time. Also, blackberry phones were able to this also.
From what I've read about this online, some people claim that a few Chinese companies have patented this feature and have exclusive ownership over it. Currently, no other phones or custom firmwares have this feature.
Can we all together request the community for porting this feature?
Bump!
LeEco x722 stock Banggood 20s version has this feature too.
LetvSchedulePowerOnOff.apk
#Titanium Backup
#Mon Apr 29 22:58:03 GMT+03:00 2019
app_apk_md5=b02ab2fec0faee9f67e6ceef14d67bc2
has_dbdata=0
sys_ro.build.version.release=6.0.1
has_prefsdata=0
app_is_system=1
app_version_code=23
has_prefsdata_jpu=0
sys_ro.build.description=le_zl0-user 6.0.1 WIXCNFN5802001232S eng.letv.20170123.152935 release-keys
generation=1
app_gui_label=Power on & off settings 6.0.1
app_label=Power on & off settings
app_gui_icon=bla bla bla.....
app_apk_name=LetvSchedulePowerOnOff.apk
sys_ro.build.date.utc=1485156920
sys_ro.serialno=711db241
app_apk_location=internal
app_apk_codec=GZIP
sys_ro.product.model=LEX722
app_version_name=6.0.1
app_is_forward_locked=0
Schedule power on and off in android as a native feature NOT an app
Schedule power on and off in android as a native feature is possible as some Chinese phones have it for years (decade?).
Why is still not yet widely available this feature on Android by 2020, is it really patent problem or is it due it needs specific hardware which most phone don't have...............?
As once I had it on Chines phone I never stop miss it.
Please can somebody clarify this subject for good.
Thanks!
Didn't see this mentioned in either changelog or any Android Nougat reviews - finally has a schedule power on/off option!
HOW-TO: https://www.technologyhint.com/schedule-power-on-off-android/
Note: In Android 7.1.2 this setting is in Battery menu.
jwoegerbauer said:
Didn't see this mentioned in either changelog or any Android Nougat reviews - finally has a schedule power on/off option!
HOW-TO: https://www.technologyhint.com/schedule-power-on-off-android/
Note: In Android 7.1.2 this setting is in Battery menu.
Click to expand...
Click to collapse
What is the article trying to say? I don't get it! (yes I seen it and used it before)
Seen actually few articles like that but it doesn't answer my question.
The pictures in the article shows an Android KitKat probably on some Chinese device.
Exactly as my old Chinese phone THL L969 (TECHNOLOGY HAPPY LIFE) LOL but I giving them big credit!
And I didn't find it on my Asus Android 7.1.2 anywhere in Settings nor in Battery menu.
So again, why is it not on nearly every phone and Android version by now 2020.
What is it so mysterious about it......................?
Thank you.
@Robexuk
My last 2 cents:
Once a device got powered off, not any piece of software running on it can perform a power on: should be obvious.
What can be done is to programmatically put Android device timer controlled in stand by mode ( means display gets switched off ) and to reawaken it. On rooted phones ( with BusyBox installed on ) this is very easy to realize.
Currently i power off my x722 manually (and i see myself that the phone is been really powered off after a while) and later, on the next morning it switches on automatically just to run the AOSIP's 9.0 default alarm.
I don't know if running that apk (extracted from Titanium Backup) helped me to retain that old 6.0 feature but before that my 9.0 phone was not able to automatically power on to run that alarm...
Στάλθηκε από το LEX722 μου χρησιμοποιώντας Tapatalk
hablando said:
Currently i power off my x722 manually (and i see myself that the phone is been really powered off after a while) and later, on the next morning it switches on automatically just to run the AOSIP's 9.0 default alarm.
I don't know if running that apk (extracted from Titanium Backup) helped me to retain that old 6.0 feature but before that my 9.0 phone was not able to automatically power on to run that alarm...
Click to expand...
Click to collapse
Hello, can you eventually share that app?
I've searched for it but don't find it on the web....
It's to try it on my blackview bv6100 chinese phone which doesn't have this option.... (my old mann zug 5s had that with its stock rom...)

[Q] IR blaster does not work using the learning fucntion for adding a remote

I own a XTZ SGP 311 and am trying to use the remote control app with my set top box
The make of my STB was not in the existing list of the brands mentioned in the app,hence i decided to use the learning function by pressing the key on my remote one by one by keeping it infront of the IR blaster of my XTZ.
The pairing was sucessful as i got the message "learned the command".
After completing the setup, mind you its a big task to manually pair all the keys of the remote, I tried to use my XTZ as remote with the STB but nothing happens ? The remote function does not work.
I read this issue is prevelant in Xperia ZL also http://talk.sonymobile.com/thread/126050 and has not been fixed by Sony.
Please let me know if I am doing something wrong. Multiple people having the same issue means there is a problem with the LEARNING FUNCTION of the remote app.
Do some of the buttons work or do they all not function? I manually setup some buttons from my eyetv remote this morning and it worked fine.
Sent from my Xperia Tablet Z
trying settings the remote for a device which is not listed in the database.
then see if the customised remote works with the new device.
I had the same problem the first time I tried to set up my stereo. I thought I had set it all up but only a few commands worked. The second time worked but I was a little more careful. When learning a command, instead of holding the button down(on the remote) like I did the first time, I just pressed and released (if that makes sense). it just took a little finesse but it ended up working just fine.
b.huss2 said:
I had the same problem the first time I tried to set up my stereo. I thought I had set it all up but only a few commands worked. The second time worked but I was a little more careful. When learning a command, instead of holding the button down(on the remote) like I did the first time, I just pressed and released (if that makes sense). it just took a little finesse but it ended up working just fine.
Click to expand...
Click to collapse
ok, will try this also
currently i was pressing it for way too long till it showed learned. maybe the long press wud be causing some distortions.
will revert after testing
thanks
nitin_ko said:
trying settings the remote for a device which is not listed in the database.
then see if the customised remote works with the new device.
Click to expand...
Click to collapse
I did. The eyetv isn't in the database. I had to manually add the buttons.
Sent from my Sony Xperia™ Z

Looking for help testing how Bluetooth functions in the Pocophone

I'm very interested to get this phone, but want to know about an *absurdly* specific feature. Namely; I want to know if it is able to pass bluetooth media buttons through to Tasker.
It's a *very* specific feature, but *very* important for me. Some phones work and others do not, there is no rhyme or reason to this that I can detect.
Could anyone that owns the Pocophone be kind enough to follow these steps to let me know whether the phone has this specific feature?
1. Install AutoInput
2. Open the app and select the option to enable Accessibility Feature for the app
3. Go back to the app and turn on System Logs
4. Go into Log Listing
5. Connect a Bluetooth device with media buttons (play, pause, next etc) to your phone
6. Press the media buttons on the bluetooth device, and see if the app logs the media button presses.
7. Take a screenshot of the log and post it here
I know this is a hassle, but this feature is very important to me (I'll happily explain why if you like), but there is no way to tell if it can do it without having access to the device.
Thanks in advance!

Using Android intents for automation

I'm working on doing some automation on my phone, and I want to perform some actions that I'm hoping I can perform using Android intents. I'm not very knowledgeable about how they work or how to find them, but I'm trying to hack some stuff together.
Here's my main question: how do I go about figuring out if I can use intents for a particular task or see what I can do with intents?
For example, I would like to be able to trigger the "Share trip progress" feature within Google Maps automatically (using Flic buttons, which allow me to use Android intents). I don't know if I can set up an intent myself to trigger this action in the Google Maps app, and I don't really know where to start in order to try to find out how to do it.
Another example is that I would like to trigger Google Assistant with my Flic button, but I want to use my Anker Roav Bolt in my car to respond to the action. Flic has a function built in to trigger Google Assistant, but it's a lot more invasive in that it opens the prompt on the phone and disrupts my Google Maps navigation as opposed to if I long-pressed the button on my Roav Bolt and it just listens for instructions without disruption. I have no clue if this is something I could trigger using Android intents, but I'd like to find a way to make this smoother.
If you have solutions to these two problems, that would be great. But as I said, I would also like to have a better general understanding of how I could find this stuff myself for future stuff I want to set up on my phone.
Thank you.

Categories

Resources