I have an alarmmanager that starts a broadcast receiver every minute which runs a thread with max priority. In that thread I get the 60 most recent tweets with Twitter4j.getUserTimeline(page) from a twitter account I use for our fire department (i.e. call information). My issue is I have noticed a substantial lag from time to time at getUserTimeline. More often than not getUserTimeline takes 4 or less seconds, but other times it takes minutes even in a area with a great signal and when on wifi. I use the same code calling twitter4j.getUserTimeline in the main app/UI with only a 3 second delay max.
Anyone have any idea why this would happen or how it can be fixed?