Changing polling rate - NFC Hacking

Is there a way to change NFC polling rate? According to this thread, NFC polls 10 times a second which seems like waste of battery to me.
Lowering it to 1x per second would split NFC Battery usage by 10, right? This, combined with NFC polling while screen off would be killer feature.

System framework editing???
I believe there would be a possibility of doing this, but it might be hard to achieve.
Maybe have a dig around in the system framework and try and find the NFC app/framework?
Could look something like nfc.pollrate = 10
I don't know haven't really dug around, but that is my idea, so not sure. Either that, or create an app to restrict the NFC signals being sent out by the device and when the screen is off.
Have fun
Peace,
shandy1996

I was looking around and did not found anything.
Also, above linked thread states "~10Hz" (around 10 polls per seconds), which makes me think value is not static or baked in into variable.

The polling rate is specified in native code. Grep polling in libnfc-nxp.
Sent from my Sony Tablet S using xda app-developers app

Alright, that exceeds my knowledge. Thanks for answer anyway.

Related

How to maximize battery life without affecting functionality

How to maximize battery life without affecting functionality? I think the answer for this question is different for most of you. It depends on how you plan to use your device, even when it’s not turned on. Keynote is that you have to get the right tools and be creative. To give you a head start, I will dump my configuration in this thread. I am able to get up to 48 hours on one charge using this configuration. If used more intensive, your results may differ from mine though.
My configuration
HTC Desire
DeFroST 2.4d
DeFroST 2.4d"]DeFroST 2.4 SVS 1267Mhz kernel
SetCPU
Setting Profiles
DeFroST 2.4d
I will stick to this ROM for this guide but I’m sure the following applies to your custom ROM as well. DeFroST is my personal favorite and I would like to use this opportunity to thank RichardTrip for all the time he puts into this ROM.
DeFroST 2.4 SVS 1267Mhz kernel
DeFroST 2.4 HAVS max 998MHz 800mV (max 998MHz) might be better at saving more energy. But my decision to pick the SVS 1267Mhz has couple of causes.
I don’t have a CPU that can run at 800mV
I’m not patient, I love to go to max speed when it’s available
I found that with my current settings, battery life is good even with the SVS kernel
As I said, it’s totally up to personal preference. If you feel you need it, flash it! There’s a 925mV kernel out there as well if you have the same issue I do with 800mV (running unstable).
SetCPU
Freely available to any XDA user. A lightweight tool that offers all the functionality we need. Other then setting the default speed, it allows us to use profiles based on things like battery charge and temperature.
Main
Profiles
In my configuration, the phone runs at full speed when the battery capacity >= 75% or if it’s charging. Then when the phone discharges, it gradually scales down the max CPU speed. More important though, I found that I don’t need to have the device running at max speed, seeping energy, when I’m not actively using it. When my display turns of, my max CPU speed will be set to 245Mhz. This is perhaps the most important setting in this configuration.
Setting Profiles
No, not Juice Defender. I don’t know why so many seem to prefer Juice Defender. It cannot be customised the way I like it and the UI gives me a headache. But then again, that’s my opinion, maybe I’m wrong
Setting profiles is once again a lightweight tool that lets you define rules by means of logic. It works like this (example):
Create a profile that enables WiFi
Create a rule Activate WiFi when the condition battery is plugged to any charger is met
I figured that I do not want to receive mail, connect to bluetooth or WiFi when I’m asleep. Also, I don’t need a constant e-mail sync at daytime. 50% sync activity is enough for me. For now, that’ll do.
Profiles
Rules
I have a lot of ideas that can still be implemented. The devs at probeez.com are working hard to implement new functionality into their app. One idea I had was to revert to 2G when the display is turned off. However, the condition display off and the action revert to 2G are not available yet.
If you agree, please let the devs know what functionality needs to be added to make their software even better. Vote on this site.
The 2G functionality has already been planned. My other suggestion, the display state, doesn’t have enough votes yet. You can find it here.
The good thing about this tool is that it will be highly customisable when more and more options are added. This fits the idea of choosing your own energy efficient settings I’m trying to promote with this topic.
Conclusion
I could elaborate my choices, but my point is to give you tips about how to address energy saving. Read this manual and be creative. Copy some of the ideas, change others. Maybe come up with new ideas so brilliant that I should add them to this post .
I’ll try to keep updating this topic with the input from you and the newly available functions in the apps.
Other Recommendations
Manual control of brightness
How could I forget? My own brightness setting is always at the lowest. Unless I'm in a very bright environment (like in the sun) and I cannot see anything on my screen. Auto brightness tends to be to bright in general. The Power Control widget can assist you in quickly switching brightness.
-prove
Use a plain black wallpaper
Although this goes further them some of you want to go, using a plain black wallpaper can save battery usage.
AMOLED: Black wallpaper = Battery saving (experiment result)
-b3ndik
great guide, will try this after I get some sleep!
I would recomend using manual control of display brightness!
prove said:
I would recomend using manual control of display brightness!
Click to expand...
Click to collapse
Added. Thank you.
Although there is not a huge improvement, I'd recommend you to have a plain black wallpaper. It actually saves a few percentages, if you do a quick search around the forum you will find the thread.
b3ndik said:
Although there is not a huge improvement, I'd recommend you to have a plain black wallpaper. It actually saves a few percentages, if you do a quick search around the forum you will find the thread.
Click to expand...
Click to collapse
Added to recommendations, thank you.
Personally I think this goes a bit to far for me. I like active backgrounds, like the one that reflects weather and daytime. However, it's a good idea. If someone can find the link to the detailed topic, I'll add it.
here is the link to the topic. The thread includes tests and results.
http://forum.xda-developers.com/showthread.php?t=660853
is it safe to assume that the profiles that let you enable or disable wifi are in the full paid version ?
*edit*
scratch that, just found 'setting profiles' on the market.
i did lose 2% battery life with just 5 minutes surfing ealier on ..
I have never used any additional program to control power apart from the default Android power widget. I would normally do this to preserve energy no matter which ROM or even which phone I have. It's all common sense:
- turn "2G only mode" and switch on 3G hen I actually need it (e.g. browsing heavy webpages). If you turn off the images in websites even GPRS usually does the job well.
- NEVER use 3G for regular voicecalls. It's a completely senseless way of draining battery fast.
- completely switch off any automatic syncronizations (Gmail, Facebook, Weather, etc.) and syncronize individual accounts only when I actually need it. Simply untick the "automatic synchronization" in the accounts and sync settings.
- of course wi-fi, gps are permanently off and I turn them on manually only when I need them.
- keep the display as dark as possible and no brighter than needed.
- use a solid black wallpaper which saves energy on AMOLED screens (won't make difference on regular TFT LCD). A bright wallpaper may significantly increase energy consumptions.
- forget any "Live" wallpapers.
I have read that killing tasks does not make much difference on Android 2.1 onwards. I still keep killing tasks just as a habit.
This way it adds up a bit of extra manual job but I think it's better than any of those "power control" programs that do the same thing just not as accurately as one can do manually.
well i left my phone on charge overnight and unplugged it at 8am this morning on 100% battery.
6 hours later and it's on 96% - although to be fair that's with near zero usage.
thanks for this topic, very helpfull
on this screenshot, what contains the first line with priority of 100?
http://forum.xda-developers.com/attachment.php?attachmentid=365973&stc=1&d=1279958467
thanks !
I have just implemented everything you recommended, so lets see how tomorrow goes (I can't be bothered to go drive out of my local cell towers ranges right now to see if my WiFi turns off ).
With regards to Disabling Sync, if I set it for 4 minutes out of 5 minutes (4/5) then Sync is only enabled for 1 minute out of every 5 minutes, right?
Having previously used JuiceDefender, I thought I'd give Setting Profiles a bash. First stumbling block is lack of toggling for mobile data - is that right, or have I missed something?

Does Smart Keyboard use extra battery / cpu?

I'm trying to figure this out, In my SystemPanel, it shows:
Total CPU time 17s
Time since start: 1 hr 9 min 52s
Avg Consumption 0.4%
I don't have a long sample of it yet, but I'm trying to figure out which situation is true:
#1. Smart Keyboard is using cpu,but so does the stock keyboard - the difference is the stock keyboard's usage is not reported in SystemPanel since the keyboard is part of the operating system
#2 Smart Keyboard is using extra cpu, whereas the stock keyboard would not. It's the price you pay for extra functionality
Can someone tell me which is true?
Thanks
bump
10 char
Hmmm. I just started using smart keyboard and haven't noticed anything yet. Gonna turn on system panel monitoring again and start checking on that. I guess it doesn't really make sense for it to use more. It's not that much smarter than the stock HTC.
If it is using that much CPU time then I will be uninstalling it till they fix it, It was like $1.99 i think too.
LearnIIBurn said:
Hmmm. I just started using smart keyboard and haven't noticed anything yet. Gonna turn on system panel monitoring again and start checking on that. I guess it doesn't really make sense for it to use more. It's not that much smarter than the stock HTC.
If it is using that much CPU time then I will be uninstalling it till they fix it, It was like $1.99 i think too.
Click to expand...
Click to collapse
really hard to tell because I'm guessing the stock keyboard uses battery / cpu as well, i mean it has to.
I'm guessing it's comparable to the stock, really can't see how it could be much different, they're so similiar besides gestures

[TWEAK] Automatic Brightness levels!

Issue: http://code.google.com/p/cyanogenmod/issues/detail?id=2298
After toying around with the automatic brightness I'm now here to share my settings ...
I use the following settings:
Light sensor filter enabled.
Window length 10 seconds.
Reset threshold 400 lux.
Sample interval to 0.5s.
Light levels use custom checked.
Screen dim level, not sure what it is for but I have it on 1 instead of 20. ((edit: I found what it is for, it's the step size the filter takes? Or not? :s))
Edit other levels...
Number of levels: 18
0 1
10 1
117 17
225 33
272 49
320 65
480 80
640 96
960 112
1280 128
1940 144
2600 160
4200 175
5800 192
6900 207
8000 223
9120 239
10240 255
Allow light decrease checked.
Decrease hysteresis to 10%.
I hope people like my light settings, if you don't please tell me why
Reasons why some settings should be altered:
Reset threshold, should be able to set to 100 and 200 lux. At the moment if you walk into light it takes the filter some time to go up, so 100 or 200 lux would trigger a reset faster. Also the sensor starts at 225 lux so why 400 as a minimum in the first place?
Window length, as for the above, if you walk into light a smaller window length would help put brightness up much quicker in combination with a smaller reset threshold.
If the above two settings could be added in CMParts/ODParts that be great as the filter would be much more responsive to short period light changes. For example if you go from outside to inside or visa versa.
And maybe it would even be a better idea to remove the whole custom light levels and add a linear function to it to go with the filter (configurable) and just have 254 steps (1-255) over 10-10240?
Adding 254 steps yourself is ... A PAIN ><
English please
guys i know there is a problem with the light sensor in desire and i have the same case with mine it this is all about it please let me know how to fix it please.
shazan said:
guys i know there is a problem with the light sensor in desire and i have the same case with mine it this is all about it please let me know how to fix it please.
Click to expand...
Click to collapse
What ROM are you using? CyanogenMod and forks of it (OpenDesire, DeFrost etc) have a custom preferences menu where you can check out the light sensor values. That is when you leave the filter off and goto edit other levels. Hold your phone in line with a TL light and it should jump to 1280.
Do you see the top most number change when light changes?
Call me crazy, but I am ><
I put the whole table into the automatic backlight custom levels: http://www.linux-box.nl/~sjoer/1to255/1to255.php
And it works really well with light changes, it should work even better if reset threshold can be lower (200 or maybe 100) as it will respond to bright light <> no light much better.
how did you did that?
without typing lol
This is insane..... so much trouble for such a simple task. Automatic Brightness. On winMO i used g-lite wich was satisfacatory. A have the desire for a month now. I searched from a similar soft and i didn't find. But i'm not gooing to try this much trouble for something that should be easy. Thank you.
Im sorry but....HOW do I apply this ?
Can this be applied to other roms?
I am using Pinky desire and would love to do this.
Phil
philje123 said:
Can this be applied to other roms?
I am using Pinky desire and would love to do this.
Phil
Click to expand...
Click to collapse
yes and for stock roms please
The screen minimum value is 10-255, so how can I set "1" to the first 2 levels?
I set 10, and I like the settings overall.
sfjuocekr said:
I hope people like my light settings, if you don't please tell me why
Click to expand...
Click to collapse
First off, "10 1" is redundant as you already cover that from 0 to 9. So 17 levels should be enough. Second, on the last line "10240 225" you probably meant "10240 255". Testing your settings with these modifications now. I find you have a lot of levels, probably can do with less to reduce flickering, but as I said, testing these first.
Can we use these settings in a Sense rom and if yes how?What file do we have to edit?
so useless guys.
setup max brightness and enjoy the brilliant screen.
it takes less battery than this tool to constantly check your ambient brightness.
Can someone please make a post about how to use this (and especially on Sense Roms)? So far it only shows us "which sensor-level should be what brightness" but it doesn't provide any information on how to apply it.
I assume CM either has an app for this installed (if so, please tell us WHICH so we can use it too) or a shell-script in background (if so, tell us WHICH) adjusting the settings.
Could anyone post a how-to use these settings?
Edit: Nvm, it's under: Cyanogen Settings.
Btw under "Edit other levels" you should only change the boxes that's under "Lower"? You shouldn't touch "Screen" and "Button"?
Trying this out, and will see how it goes. Only have 5 levels on my current setup, so this should be a lot smoother
snudel said:
so useless guys.
setup max brightness and enjoy the brilliant screen.
it takes less battery than this tool to constantly check your ambient brightness.
Click to expand...
Click to collapse
Is that true?
any more improvements?
and how can i backup this setting?
i wont to input it again when i flash a new rom :-(
sfjuocekr said:
Issue: http://code.google.com/p/cyanogenmod/issues/detail?id=2298
After toying around with the automatic brightness I'm now here to share my settings ...
I hope people like my light settings, if you don't please tell me why
Click to expand...
Click to collapse
Since the source code of Sense kernels is available now, would it be possible to write the tool for Sense ROMs too? You sure would do a lot of people a big favor

[APP]Power Tune-Up for HTC One X

Here you go guys and girls. Another battery saving app that i came across. Here is a link
https://play.google.com/store/apps/details?id=com.bitdefender.tuneup
Looks like it does more than just battery saving here is a description:
Battery Saver
One tap to save precious battery life by switching on the Battery Saver or create your own custom profile for extra control.
No more deep diving in individual settings. You have it all in one screen. Time is of the essence.
Battery Management
View and stop the processes that impact CPU and RAM, know available talk or standby time.
Device Clean-up
Gain extra storage by removing unnecessary cache and temporary files from your device’s internal storage, as well as from external memory cards.
3G Traffic Monitoring
Make sure you don’t get overcharged by carefully monitoring 3G data usage, setting up thresholds, and receiving notifications when limits are reached.
Battery Widget
Install the Power Tune-Up widget to keep an eye on the remaining battery time.
I know most of our members here are looking for ways to save battery so this one is for you guys..Plus it is free.
No harm in trying out a different app i say. So why not give it a shot. Leave some feedback to see if it does anything for you.
Goku80 said:
Here you go guys and girls. Another battery saving app that i came across. Here is a link
https://play.google.com/store/apps/details?id=com.bitdefender.tuneup
Looks like it does more than just battery saving here is a description:
Battery Saver
One tap to save precious battery life by switching on the Battery Saver or create your own custom profile for extra control.
No more deep diving in individual settings. You have it all in one screen. Time is of the essence.
Battery Management
View and stop the processes that impact CPU and RAM, know available talk or standby time.
Device Clean-up
Gain extra storage by removing unnecessary cache and temporary files from your device’s internal storage, as well as from external memory cards.
3G Traffic Monitoring
Make sure you don’t get overcharged by carefully monitoring 3G data usage, setting up thresholds, and receiving notifications when limits are reached.
Battery Widget
Install the Power Tune-Up widget to keep an eye on the remaining battery time.
I know most of our members here are looking for ways to save battery so this one is for you guys..Plus it is free.
No harm in trying out a different app i say. So why not give it a shot. Leave some feedback to see if it does anything for you.
Click to expand...
Click to collapse
Goku, i see that you mess with the power management i like that... I have an idea, maybe you can figure it out or tell me whom to ask. We know that the power management changes (to battery saver) by default, and this is done by HTC native support, when reaches 30%.. So, my question is, can we make a simple script or a toggle to turn that on whenever we like? Maybe on 95% So, if i'm on the beach, and don't need to make all systems off and drop the cpu speed to 1GHz and reduce brightness etc., just to press that toggle and put it in that state..
That settings exist, just someone has to find the switch
Hope you got what i mean..
the_maker said:
Goku, i see that you mess with the power management i like that... I have an idea, maybe you can figure it out or tell me whom to ask. We know that the power management changes (to battery saver) by default, and this is done by HTC native support, when reaches 30%.. So, my question is, can we make a simple script or a toggle to turn that on whenever we like? Maybe on 95% So, if i'm on the beach, and don't need to make all systems off and drop the cpu speed to 1GHz and reduce brightness etc., just to press that toggle and put it in that state..
That settings exist, just someone has to find the switch
Hope you got what i mean..
Click to expand...
Click to collapse
yeah i do get what you mean my friend..Some other gent has asked me about this on the actual other thread..We can make a script and run it with script manager. just finding a way on how to break the code and make it so we can run the options as you say from 95% ..let me have a little dig and do a research and see if i can get someone to help me out or even ask the big daddy itself HTC
No harm in trying is there
Goku80 said:
yeah i do get what you mean my friend..Some other gent has asked me about this on the actual other thread..We can make a script and run it with script manager. just finding a way on how to break the code and make it so we can run the options as you say from 95% ..let me have a little dig and do a research and see if i can get someone to help me out or even ask the big daddy itself HTC
No harm in trying is there
Click to expand...
Click to collapse
Thanks mate, i cross my fingers for that if i find something i'll post it in the other thread..
Sent from my HTC One X using XDA
the_maker said:
Thanks mate, i cross my fingers for that if i find something i'll post it in the other thread..
Sent from my HTC One X using XDA
Click to expand...
Click to collapse
no worries mate. messaged the creator of the app to see if he could help me out or if he can do something and also Meltus the creator of Core Control..No harm in asking is there
Goku80 said:
no worries mate. messaged the creator of the app to see if he could help me out or if he can do something and also Meltus the creator of Core Control..No harm in asking is there
Click to expand...
Click to collapse
I guess not.. Good call anyway, thanks for trying..

[Q] Should This help for lag?

Was on the portal and noticed this:
Hey everyone,
So, I was experiencing significant lag as we all do from time to time, and decided I was going to get to the bottom of it.
After tracing and debugging for hours, I discovered the source of 90% of Android's lag. In a word, entropy (or lack thereof).
Google's JVM, like Sun's, reads from /dev/random. For all random data. Yes, the /dev/random that uses a very limited entropy pool.
Random data is used for all kinds of stuff.. UUID generation, session keys, SSL.. when we run out of entropy, the process blocks. That manifests itself as lag. The process cannot continue until the kernel generates more high quality random data.
So, I cross-compiled rngd, and used it to feed /dev/urandom into /dev/random at 1 second intervals.
Result? I have never used an Android device this fast.
It is literally five times faster in many cases. Chrome, maps, and other heavy applications load in about 1/2 a second, and map tiles populate as fast as I can scroll. Task switching is instantaneous. You know how sometimes when you hit the home button, it takes 5-10 seconds for the home screen to repopulate? Yeah. Blocking on read of /dev/random. Problem solved. But don't take my word for it .. give it a shot!
Update!
I've built a very simple Android app that bundles the binary, and starts/stops the service (on boot if selected). I'll be adding more instrumentation, but for now, give it a shot! This APK does not modify /system in any way, so should be perfectly safe.
This is my first userspace Android app, so bear with me!
Note that this APK is actually compatible with all Android versions, and all (armel) devices. It's not at all specific to the Captivate Glide.
Caveats
There is a (theoretical) security risk, in that seeding /dev/random with /dev/urandom decreases the quality of the random data. In practice, the odds of this being cryptographically exploited are far lower than the odds of someone attacking the OS itself (a much simpler challenge).
This may adversely affect battery life, since it wakes every second. It does not hold a wakelock, so it shouldn't have a big impact, but let me know if you think it's causing problems. I can add a blocking read to the code so that it only executes while the screen is on. On the other hand, many of us attribute lag to lacking CPU power. Since this hack eliminates almost all lag, there is less of a need to overclock, potentially reducing battery consumption.
If you try it, let me know how it goes.
ROM builders - feel free to integrate this into your ROMs (either the .apk / application, or just the rngd binary called from init.d)!
If anyone's interested, I've launched a paid app on the Play store for non-xda users. As I add features I'll post the new versions here as a thanks to you guys (and xda community at large for being such a great resource). But if anyone's interested in the market's auto-update feature, just thought I'd mention it.
Cheers!
Click to expand...
Click to collapse
Should this help with the lag that we get on the Play?
If anyone else wants to try it heres the link to the thread:
http://forum.xda-developers.com/showthread.php?t=1987032
I tried it and it i got faster loading on some minor stuff (like contact picture loading) and apps installed on the internal memory seems to load faster, in terms of UI smoothness I don't notice any difference, because UI is smooth since the beginning
I think i may try it out although i don't see any instructions
Sent from my ASUS Transformer Pad TF300T using xda app-developers app
BTW, somebody already posted this in the XPlay Android Dev section:
http://forum.xda-developers.com/showthread.php?t=2073382

Categories

Resources