Welcome to

w3study.github.io




Topics

Async Task in Hindi

Advantages of Async Task in Hindi

Disadvantages of Async Task in Hindi



Async Task in Hindi (Development of Android Applications)

Async Task

  1. Easy to Use – AsyncTask को implement करना आसान था क्योंकि यह background और UI thread के बीच communication को simplify करता था।
  2. Thread Management – यह automatically background में thread manage करता था, जिससे developers को manually threads create और manage करने की जरूरत नहीं थी।
  3. UI Update Support – AsyncTask background में task execute करने के बाद directly UI update कर सकता था, जिससे manual thread handling की जरूरत नहीं पड़ती थी।
  4. Less Code Complexity – Traditional threading approaches (जैसे Handler, Looper) की तुलना में AsyncTask कम code में asynchronous tasks को handle कर सकता था।
  5. Automatic Execution on Background Thread – इसका doInBackground() method automatically एक separate worker thread पर run होता था, जिससे main thread block नहीं होता था।
  6. Progress Updates – onProgressUpdate() method से task के execution के दौरान user को progress दिखाया जा सकता था।
  7. Cancellation Support – AsyncTask को आसानी से cancel() method से cancel किया जा सकता था, जिससे unnecessary resource usage को रोका जा सकता था।
  8. No Manual Thread Pooling – Developers को manually thread pool manage करने की जरूरत नहीं होती थी, क्योंकि AsyncTask internally thread pool handle करता था।
  9. UI Thread Safety – यह onPostExecute() method के जरिए UI पर safe तरीके से changes करने की अनुमति देता था।
  10. Better than Traditional Threads – यह traditional threads की तुलना में lightweight और memory-efficient था, जिससे small background tasks आसानी से execute हो सकते थे।

Disadvantages of Async Task in Hindi

  1. Memory Leaks – AsyncTask Activity या Fragment के साथ tightly coupled होता था, जिससे improper handling के कारण memory leaks हो सकते थे।
  2. Configuration Changes Issue – यदि AsyncTask चल रहा हो और user screen rotate कर दे, तो activity destroy होकर recreate हो जाती थी, जिससे app crash हो सकती थी।
  3. Thread Pool Limitations – AsyncTask by default एक fixed thread pool का उपयोग करता था, जिससे multiple tasks चलाने पर performance issues आ सकते थे।
  4. Tightly Coupled with UI – AsyncTask का lifecycle Activity/Fragment के lifecycle पर depend करता था, जिससे unexpected behavior हो सकता था।
  5. Not Suitable for Long-Running Tasks – यह short background tasks के लिए design किया गया था, लेकिन long-running tasks के लिए यह inefficient था।
  6. Difficult to Manage Multiple AsyncTasks – यदि एक से ज्यादा AsyncTask एक साथ चलाए जाएं, तो proper synchronization करना मुश्किल हो जाता था।
  7. Error Handling Complex था – Background task में errors को handle करना मुश्किल था और proper exception handling के बिना app crash हो सकती थी।
  8. No Proper Cancellation Handling – AsyncTask को cancel किया जा सकता था, लेकिन proper तरीके से task termination और resource cleanup करना मुश्किल था।
  9. Blocking UI Issues – अगर AsyncTask को सही से implement नहीं किया जाए, तो यह main thread को भी block कर सकता था, जिससे UI freeze हो सकता था।
  10. Deprecated in API 30 – Google ने इसे API 30 (Android 11) में deprecated कर दिया और इसके बजाय Kotlin Coroutines, Executors, और WorkManager का उपयोग करने की सलाह दी।




Request:

हैलो दोस्तों! उम्मीद करता हूं आपको हमारा यह content/post पसंद आया होगा। अगर आपको हमारा ये content/post पसंद आई हो तो अपने दोस्तों के पास भी share करे। और अगर आपको कोई problem या कोई specific content हिन्दी में चाहिए है तो आप हमें नीचे दिए गए Email या whatsapp number के जरिए बता सकते है।

अगर आप CCC/diploma/polytechnic/MCA/BCA etc कर रहे है तो ये website स्पेशली आपके लिए ही है, जो student हिंदी में पढ़ाई करते है।

Contact Us

Email: deepanshuranjan8057@gmail.com

Whatsapp: +91 8057754706



Follow Us

Facebook Logo    Instagram Logo