How to periodically switch on and switch off Redmi note 5 pro's Flashlight?[Rooted - General Questions and Answers

Hello y'all , my objective is to write a shell script to periodically turn off and on my phone's flashlight( about 1 khz or 500 hz) . My phone is Rooted. So i gained super user shell acess (#)
These are the files under my sys/class/leds/flashlight
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I was able to modify the content of the "brightness" file and was able to manually switch off and on my flashlight. However i want to periodically switch on and off with a delay and for that i need a timer trigger. But within the "trigger" file above there is no delay section indicated! There was just some contents within the file (No Numbers!)
Can you guys help me figure out how i can go about attaining my objective!
Your help would be much appreciated!

Why not make use of Android's inbuilt crontab feature?

With regards to set a timer in Android look inside here.

Will Look into the links ! Thanks !

Hi ! thanks for your reply, with regards to timer, it is actually a java timer , i have implemented the same in my android studio app, but the maximum frequency iam able to achieve is 40hz( Os introduced delay is so high), that's why to increase my data rate to 500 hz , i rooted my phone and am trying ways to directly access Flashlight through kernel and use timer trigger and achieve my objective.
I will try my luck with the crantab feature that you had suggested

Related

[App] moveOver - Beta - v1.0

Description :
Allows you to keep any two folders on your phone insync.
Uses ionotify to avoid excessive battery drainage.
Features :
Start onboot
Track folders/subfolders
Background service
Work in progress :
UI/icon needs revamping
Bug fixes (as they come)
Issues :
Please post them here.
Describe with as much clarity as possible.
If a force close, post log (use logcollector from market)
How to use :
Install OI File manager from market
Choose a source/destination folder
Start service (optionally press menu and make it start onboot)
Root is optional. If either source/dest is not sdcard, then root is required.
Uses :
Its up to the user. For eg one could have a
/sdcard/DCIM -> external_sdcard->DCIM mapping so that any pictures taken from camera, are automatically backed up on external sdcard.
Another use could be a mapping like :
/data/data/com.angrybirds -> /sdcard/backup/angrybirds
To keep ur up2date backups of games/apps
Market status : Not uploaded
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Download : Link
this should be great for the g2x when switching between aosp roms and stock roms which use different sd partitions as their default "sdcard." thank you, great idea
Sent from my LG-P999 using xda premium

Blue Flare v1.1 (enable Automatic Discoverablity)

ULTIMATE SOLUTION TO BLUETOOTH DISCOVERABILITY PROBLEM WITHOUT COMPROMISATION
Now you can make your phone bluetooth discoverable when ever needed with just one click.
https://play.google.com/store/apps/details?id=blue.Flare
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Instructions:
1.Install on phone memory
that's it starts right away, no setup required.
use Blue Flare and you'll never be bothered about manually making your device discoverable.
whenever you'll turn on the bluetooth a popup will ask you whether you intend to make your device discoverable for others,all you need to do is click yes or no on the popup and you're done
NO HASSLES NO RISKS
The intermediate android platforms like 2.2(froyo) and 2.3 (gingerbread) have the annoying nature of setting bluetooth discoverablity to a limited time (very short) by itself and also one has to navigate through menus to set it discoverable everytime! This is annoying!
Many of times we would turn on the bluetooth & forget to make it discoverable or it would time out
To solve this problem use this short quick little application that will prompt to turn on the dicovery mode as soon as the bluetooth is turned on. If a timout occurs it will ask if to keep it discoverable further till the user chooses no or the bluetooth is switched off
TO KEEP THE AUTOSTART WORKING THE APPLICATION MUST BE INSTALLED ON PHONE MEMORY
Installing it on SD card will prevent it from startup boot (no, it won't hamper boot time cause its too small).

[Widget][2.2+] Kernel Config

Control each of Your Kernel options with widgets
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Some Custom Kernel features for Android devices are toggled by numbers in a small config file. For eg., the 'FastCharge' feature that is available in many kernels is enabled if a number '1' is entered in a specific file in the system memory. If the contents of the file is written as '0' then FastCharge is disabled. Unfortunately the ways in which this can be done are either through commands in terminal or with Apps that costs a lot.
With this app, one can specify the path of the file that needs to be changed, the values that needs to be cycled, along with the values/string that needs to be displayed in the widget for the corresponding toggle values.
Features:
-Custom file paths can be entered
-Custom toggle values can be used
Limitations:
-Only one instance of the widget can be used for now.
-No SDCard Permission is added, so does not work with SD Card files
-Yet to include root permissions to write to files that are in Read Only
As of now, it is pretty basic and lot of features will be added.
As usual all your comments/feedback are welcomed
You can also drop in your feedback @ [email protected]
Some SS:
Can i have attachement with this potentially VERY useful app, please?
I am not using google play or any other things like this.
pupakota said:
Can i have attachement with this potentially VERY useful app, please?
I am not using google play or any other things like this.
Click to expand...
Click to collapse
Added the attachment as per your request Waiting for ur valuable comments and suggestions

[HOW TO] Create tasks/profiles with your kernel parameters

Introduction
If you bored with change kernel parameters every time you open a game or your battery is low this guide will help you You can add tasks and apply them automaticly.
Requirements
-Rooted phone
-Custom kernel
-This app
!Disclaimer!
I am not responsible of bricked phones or dead sd cards.
STEPS
1- Open tasker app give root access. And slide right,select tasker.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2- Touch the plus button.
3- It will ask you a action. Available actions are:
On screen on= If screen is on ,profile will be applied.
On screen off= If screen is off ,profile will be applied.
On app launching= If you select this ,app will ask you an app. If you launch this app, profile will be applied
On battery low= If you select this, app will ask you percentagle. If battery low then this percentagle profile will be applied.
On boot complete= If phone performs a successful boot, profile will be applied.
On active= If you check the checbox on right of profile , profile will be applied.(Look step 6)
4- If you select an action enter a task name and you will go to this page.
5- Select parameters you want add to profile with checkboxs and save with floating button on the bottom.
6-Your task is ready but not activated. Just activate it with this checkbox.(And uncheck to disable task)
Ohh Great work! Seems Good. Its working fine.
dark_optimistic said:
Ohh Great work! Seems Good. Its working fine.
Click to expand...
Click to collapse
Thank you I'm glad to help you

[APP][4.4+] Location tracker - Simple application for tracking your location

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Minimalist application for tracking your location. You do not need any registration, misleading permissions or anything set up. Just record.
Recording can be sort in some general categories like walking, running, riding on bicycle and so on. Records are displayed in map and altitude and speed are in charts.
Screenshots
Download
Better
It seems very promising. Although there some great apps to trace exact mobile number location. You must refer them for reference.
If you have any idea how to improve this application, just let me know
Any idea how to improve this application?
I added simple route ruler. This feature was requested by one of users.
I just released new version with option for export track into GPX format. There is also new notification with basic track information.
​
@thomas when the phone power off you app will back record automatically with a persistent notification like Geo Tracker? I will need this.to change for your app, please make the option to conyrol the frequency of update too
I have just updated the application. New notification supports night mode.
​
New update that fixes imperial units should be online in few minutes.
Very elegant, lightweight and clean app. It would be more usefull if you can implement ONLY "start/stop" recording function.
Don't touch anything else ! Leave it as it is !
Donation for further development is on the way.
New version is online. Fixed is crash when backup file is corrupted and layout when text (distance, altitude) is too long.

Categories

Resources