Apply filter in android SDK

I found filtering code but its in mathematical format . Is it possible to apply code given below ?

http://milu23.blogspot.in/2015/02/ble-ibeacon-smoothing-of-reported.html

Please let me know if its possible .So i can accurate distance compare to old.

You can accurate distance by youself in any way

I have no idea about it . BLE is new for me . So give filtering equation . If its possible than tell me to how it implement.

SDK accurate distance by this algorithm http://old.bbs.aprbrother.com/194-rssi
You can accurate distance by youself in any way just like running average or other’s algorithm
It should by youself to get the results what you want

But this algorithm is also not working to return exact distance.