M madSac Active Member Licensed User Longtime User Feb 5, 2013 #1 Is there any lib or method from which i can get current value of all supported sensors. ? Please note i don't want to know value on changing.I want current values whenever invoke the event.I searched in forum and found that PhoneSensor lib can only invoke an event on value change.
Is there any lib or method from which i can get current value of all supported sensors. ? Please note i don't want to know value on changing.I want current values whenever invoke the event.I searched in forum and found that PhoneSensor lib can only invoke an event on value change.
Erel B4X founder Staff member Licensed User Longtime User Feb 5, 2013 #2 The sensors events happen every few milliseconds. So they should fire quickly. There is no way to check the current value. Upvote 0
The sensors events happen every few milliseconds. So they should fire quickly. There is no way to check the current value.
M madSac Active Member Licensed User Longtime User Feb 5, 2013 #3 Ok. One more question. If we declare too many variables in process globals will it slow down the OS and if we declare a variable in sub are they destroyed after sub is destroyed. I have this question in mind as i don't want to fill up user's phone with useless variables till my app is running. Is there any tutorial which defines scopes in b4a not in java (i think b4a does something different) ? Upvote 0
Ok. One more question. If we declare too many variables in process globals will it slow down the OS and if we declare a variable in sub are they destroyed after sub is destroyed. I have this question in mind as i don't want to fill up user's phone with useless variables till my app is running. Is there any tutorial which defines scopes in b4a not in java (i think b4a does something different) ?
Erel B4X founder Staff member Licensed User Longtime User Feb 5, 2013 #4 f we declare too many variables in process globals will it slow down the OS Click to expand... No. if we declare a variable in sub are they destroyed after sub is destroyed. Click to expand... The reference is destroyed. If it is the only reference to the object then the object will be eventually destroyed. Upvote 0
f we declare too many variables in process globals will it slow down the OS Click to expand... No. if we declare a variable in sub are they destroyed after sub is destroyed. Click to expand... The reference is destroyed. If it is the only reference to the object then the object will be eventually destroyed.
M madSac Active Member Licensed User Longtime User Feb 5, 2013 #5 so if i declare gps,sensors,download manager,media player...and many more objects in Service's Process Globals then neither it will cause any memory related problem nor it will battery draining. Upvote 0
so if i declare gps,sensors,download manager,media player...and many more objects in Service's Process Globals then neither it will cause any memory related problem nor it will battery draining.
Erel B4X founder Staff member Licensed User Longtime User Feb 5, 2013 #6 The number of variables do not matter. What matters are the features used. In order to save battery you should stop using features when they are no longer required. Upvote 0
The number of variables do not matter. What matters are the features used. In order to save battery you should stop using features when they are no longer required.
M madSac Active Member Licensed User Longtime User Feb 5, 2013 #7 Yes i will do that. Another thing is Is there any tutorial which explains variables scope in B4A ? so that i can make a better application rather than struggling with unknown errors due to scopes. Upvote 0
Yes i will do that. Another thing is Is there any tutorial which explains variables scope in B4A ? so that i can make a better application rather than struggling with unknown errors due to scopes.
Erel B4X founder Staff member Licensed User Longtime User Feb 6, 2013 #8 Yes. See the first two search results: Basic4android Search: variables Upvote 0
M madSac Active Member Licensed User Longtime User Feb 6, 2013 #9 I read it.Now i understood clearly. Thank you again.... Upvote 0
M madSac Active Member Licensed User Longtime User Feb 6, 2013 #10 I am still facing problem with proximity sensor and some others. If I keep phone untouched. There values are not changed. What to do now ? Upvote 0
I am still facing problem with proximity sensor and some others. If I keep phone untouched. There values are not changed. What to do now ?
Erel B4X founder Staff member Licensed User Longtime User Feb 7, 2013 #11 This is how the sensors work. Upvote 0