Hi guys,
I wrote a service that starts each minute by calling 'StartServiceAt' (at the end of each Service_Start routine).
It must manage a long process: it must parse big data coming from a web-service (about 1-2Mb).
The Service_Start routine calls the parsing one, inside there's a loop that works for about 2-3 minutes; during this loop the service-start time is delayed.
The first problem is:
During the running of the loop, the user interface hangs (activities take about 10 seconds to load) and sometimes the screen gets blank. Android, also tries to kill my application (asks me...)
What I've tried:
1) Set the attribute: #StartCommandReturnValue: android.app.Service.START_STICKY
2) Put a 'DoEvents' statement inside the loop (BetterDialogs' inputbox by Informatix won't work in this case: dialogs are closed automatically after loaded...)
3) Created 2 services, one catching HttpUtils2 JobDone events and the other parsing the results each minute
4) Did a prayer
but nothing seems to work.
After exiting from the loop, the application runs normally.
The second problem is: during the loop I cannot refresh the UI because timer's tick are not fired...
Any clue ? Thanks in advance.
G. Pizzuto