Posts

Showing posts with the label Retrofit Library in Android – पूरी जानकारी हिंदी में

🔗 Retrofit Library in Android – पूरी जानकारी हिंदी में

        🔗 Retrofit Library in Android – पूरी जानकारी हिंदी में 🚀 Retrofit क्या है? Retrofit एक type-safe HTTP client है जिसे Square कंपनी ने develop किया है। यह Android और Java में API calls को manage करने के लिए सबसे popular और आसान library है। Retrofit आपको RESTful APIs से data लेने और भेजने की सुविधा देता है और यह JSON/XML response को directly Java/Kotlin object में convert कर देता है। 📦 Retrofit क्यों इस्तेमाल करें? ✅ API calls को manage करना आसान ✅ JSON parsing automatic (Gson converter से) ✅ Clean और readable code ✅ Background thread पर काम करता है (Asynchronous support) ✅ Error handling built-in होता है ⚙️ Retrofit कैसे काम करता है? Retrofit 3 चीज़ों पर आधारित होता है: Base URL – API का root path Interface – जिसमें endpoints define किए जाते हैं Model Class – JSON को Java/Kotlin object में map करने के लिए 🔧 Retrofit Setup – Step by Step Step 1: Gradle Dependency जोड़ें implementation 'com.squareup.retrofit2:retro...