You can't "guess" the remaining battery time, as that depends on the user activity.
A simple action from the user as increasing or decreasing screen bright or turning on or off WI-FI or data connection or even making a few calls, will be enough to increase or decrease the amount of remaining time.
You can extrapolate and try to guess, after analising for a few minuts of device operation, but will never be precise, or even close to that, unless the user leaves the phone still and does not touch it.
We don't give away code, we try to help you to get YOUR CODE working.
READ the begginers guide, do some (re)search on the forum about your questions, TRY to get it working by yourself, and then, only then, if you can't get it working, ask for help WITH YOUR CODE.
Also, this is a community forum, apart from very specific B4A inner aspects questions, you should not direct your question to a single user!