0

In my app i need following functions and i'm not sure if i should use service, threads, asynctasks etc...

I got an activity where the user can control a "background" operation.

The background operation sends a mock_location to to system every 1sec. Another background operation changes the location every 30sec.

In the activity and from another service/thread i want to be able to start/stop this operation and to send new data (position) to the background operation while it is running.

Atm i got a Service which is getting all the data from the activity and from this service i start timertasks that change the position. The service is controlling the timertasks.

My problem: This way is much to memory and power consuming so i'm wondering if there is a better solution...

Dominik
  • 133
  • 1
  • 9
  • Please Check this link i guess it may helps you :)http://stackoverflow.com/questions/18605403/timertask-vs-thread-sleep-vs-handler-postdelayed-most-accurate-to-call-functio – android_dev Jul 08 '14 at 08:11
  • Ty! Should i keep a Service for processing the data from the activity and start the ScheduledThreadPoolExecutor? – Dominik Jul 08 '14 at 08:18
  • Yes that's better way to implement as per my conceren :) – android_dev Jul 08 '14 at 08:21
  • When i did some stress tests on my app i even got the cellphone crashed with several: Out of memory: Heap Size=524288KB, Allocated=519900KB, Limit=196608KB, Proc Limit=524288KB in several processes. Do you have an idea what could cause this heavy kind of memory usage? I don't have any bitmaps in my code - just TimerTasks and location based functions (providers, locations,...) – Dominik Jul 08 '14 at 08:27
  • Can you please post your error on the post so i can help you on it – android_dev Jul 08 '14 at 08:41
  • The problem is there are many errors - none is tagged to my app - i think they are all related to out of memory - i uploaded a part of the logcat dump: http://drive-zone.info/logcatdump.txt – Dominik Jul 08 '14 at 08:58
  • Can you please send me your application package name so it's better for me which errors are belongs to yours as per the catlog i seen some issues are related to os not yours – android_dev Jul 08 '14 at 09:20
  • I attached it to the top of the log - don't want to have my package name in public ;) – Dominik Jul 08 '14 at 09:33
  • If you are not providing your packagename so how can i identify is that issues belongs to ur app? and as per my concern most of the issues belongs to os and one is belongs to this application de.appsmadeingermany.gpsfakelocation – android_dev Jul 08 '14 at 09:36

0 Answers0