Posts

Showing posts from October, 2016

Service vs IntentService

When to use? The  Service  can be used in tasks with no UI, but shouldn't be too long. If you need to perform long tasks, you must use threads within Service. The  IntentService  can be used in long tasks usually with no communication to Main Thread. If communication is required, can use Main Thread handler or broadcast intents. Another case of use is when callbacks are needed (Intent triggered tasks). How to trigger? The  Service  is triggered by calling method  startService() . The  IntentService  is triggered using an Intent, it spawns a new worker thread and the method  onHandleIntent()  is called on this thread. Triggered From The  Service  and  IntentService  may be triggered from any thread, activity or other application component. Runs On The  Service  runs in background but it runs on the Main Thread of the application. The  IntentService  runs on a separate worker thread. Limitations / Drawbacks The  Service  may block the Main Thr

What is the difference between micro controller and micro processor

Image
A microprocessor generally does not have Ram, ROM and IO pins. It usually uses its pins as a bus to interface to peripherals such as RAM, ROM, Serial ports, Digital and Analog IO. It is expandable at the board level due to this. A microcontroller is 'all in one', the processor, ram, IO all on the one chip, as such you cannot (say) increase the amount of RAM available or the number of IO ports. The controlling bus is internal and not available to the board designer.  microprocessor is generally capable of being built into bigger general purpose applications than a microcontroller. The microcontroller is usually used for more dedicated applications.