Could you please share the relevant error log?
What version of RhoMobile(Rhodes, RhoElements) do you use ?
What is the device and OS version being used on Android? Can you share your code snip as well?
Robert and Visnupriya,
I believe device OS device is 4.x (I'm afraid I don't have device now since I am out of office for a couple of days)
There's no error log from Rho framework, I added my own log to step into the issue.
Here is code:
When application initializes (application.rb), calls method initialize_battery_checking below:
Rho::Timer.start(BATTERY_CHECKING_INTERVAL_IN_SECONDS * 1000, "/app/Resource/start_battery_recorder", "")
and in Resource controller start_battery_recorder method called after 1 sec :
# event for get and set battery level
#validate user is inactive
if @params['batteryLifeKnown'].to_s == "true"
bat_level = @params['batteryLifePercent'].to_i
RhoLog.error("Battery" , "Unkown battery life: " + @params['batteryLifePercent'] + "% , AC=" + @params['acLineStatus'])
ac_line_connected = @params['acLineStatus'].to_i
rescue Exception => e
RhoLog.error("Battery", "error getting battery status " + e.message)
Rho::Timer.start(AppApplication::BATTERY_CHECKING_INTERVAL_IN_SECONDS.to_i * 1000, "/app/Resource/start_battery_recoder", "")
# wiring battery event
Battery.batteryEvent = "/app/Resource/record_battery_level"
Battery.sampleInterval = 0 # 1min
When I added my own log, I noticed first line above (in start_battery_recorder) was not executed at all ( JUST on android). To me it looks like Battery.batteryEvent is unknown in Android because the flow did not go to the the second line (Battery.sampleInterval = 0).
Thanks for your help,