Android SQLite Database in Hindi
RGPV University / DIPLOMA_CSE / MOBILE COMPUTING
Android SQLite Database in Hindi
Android SQLite Database in Hindi
Introduction
Android SQLite Database एक lightweight relational database है, जो Android applications में data storage के लिए बहुत उपयोगी होता है। SQLite database बिना किसी server के काम करता है, यानी इसमें external server की आवश्यकता नहीं होती। यह एप्लिकेशन के अंदर ही डेटा को स्टोर करता है, जिससे एप्लिकेशन में fast data access और management संभव होता है।
Working of Android SQLite Database in Hindi
SQLite database Android में work करता है जैसे किसी छोटे relational database की तरह। Android SQLite database को सेटअप करने के लिए सबसे पहले एक SQLiteOpenHelper class का उपयोग किया जाता है। यह क्लास database को create और manage करता है। जब भी कोई data store या retrieve करना हो, तो SQLiteDatabase object का उपयोग किया जाता है, जो SQLite database से interact करता है।
- Database Creation: सबसे पहले एक SQLiteOpenHelper class बनानी होती है, जिसमें database को create करने के लिए onCreate() method को override किया जाता है।
- Database Access: SQLiteDatabase class का उपयोग करके database को read और write किया जा सकता है।
- SQL Queries: SQLite database में data access करने के लिए SQL queries (जैसे SELECT, INSERT, UPDATE, DELETE) का प्रयोग किया जाता है।
Important Methods in Android SQLite Database in Hindi
SQLite database में data को access और manipulate करने के लिए कई महत्वपूर्ण methods होते हैं। ये methods database की performance को बेहतर बनाते हैं और data management को आसान बनाते हैं।
- onCreate(): इस method का उपयोग database को initial setup करने के लिए किया जाता है। यहाँ पर tables और अन्य structures define किए जाते हैं।
- onUpgrade(): जब database का structure change करना हो या upgrade करना हो तो इस method का उपयोग किया जाता है।
- getWritableDatabase(): यह method writable database connection प्रदान करता है, जिसका उपयोग data को modify करने के लिए किया जाता है।
- getReadableDatabase(): यह method readable database connection प्रदान करता है, जिसका उपयोग data को read करने के लिए किया जाता है।
- insert(): इस method का उपयोग data को database में insert करने के लिए किया जाता है।
- update(): यह method database में already present data को update करने के लिए उपयोगी है।
- delete(): इस method का उपयोग database से data delete करने के लिए किया जाता है।
- rawQuery(): SQL query execute करने के लिए इस method का इस्तेमाल किया जाता है, जब query में dynamic values हो।
Features of Android SQLite Database in Hindi
Android SQLite Database के कई विशेष features हैं, जो इसे एंड्रॉयड एप्लिकेशन के लिए एक बेहतरीन choice बनाते हैं। ये features इसे lightweight और highly efficient बनाते हैं।
- Lightweight: SQLite database बेहद छोटा और efficient होता है, जिससे यह एंड्रॉयड एप्लिकेशन्स के लिए perfect होता है।
- No Server Required: SQLite database में server की आवश्यकता नहीं होती, यह स्थानीय रूप से काम करता है।
- Fast Data Access: SQLite database के द्वारा data access काफी तेज़ होता है, जिससे user experience बेहतर होता है।
- Relational Database: SQLite एक relational database है, जिससे tables, rows, और columns के माध्यम से data को organize किया जा सकता है।
- Cross-Platform: SQLite का इस्तेमाल सिर्फ Android पर ही नहीं, बल्कि iOS, Windows, और Linux जैसे अन्य platforms पर भी किया जा सकता है।
Advantages of Android SQLite Database in Hindi
Android SQLite Database के कई फायदे हैं, जिनकी वजह से इसे Android development में एक महत्वपूर्ण tool माना जाता है।
- Ease of Use: SQLite database का setup और management बहुत आसान है। इसका API simple और easy to understand है।
- Offline Storage: SQLite database को local storage के रूप में इस्तेमाल किया जा सकता है, जिससे data बिना इंटरनेट connection के भी available रहता है।
- Low Memory Footprint: SQLite बहुत कम memory इस्तेमाल करता है, जिससे devices की performance पर कोई भारी असर नहीं पड़ता।
- Fast Processing: SQLite database का performance काफी तेज़ है, और यह छोटे sized databases के लिए perfect होता है।
- No Network Dependency: SQLite database नेटवर्क से independent है, क्योंकि यह सभी data local storage में store करता है।
Disadvantages of Android SQLite Database in Hindi
SQLite database के कुछ disadvantages भी हैं, जिन्हें ध्यान में रखते हुए इसका इस्तेमाल किया जाना चाहिए।
- Limited Scalability: SQLite database छोटे और medium sized applications के लिए अच्छा है, लेकिन अगर database का size बहुत बड़ा हो, तो इसकी scalability सीमित हो सकती है।
- Limited Features: SQLite database में कुछ advanced features की कमी होती है जो अन्य database systems में उपलब्ध होते हैं, जैसे stored procedures और triggers।
- No Multi-User Support: SQLite एक single-user database है, इसका इस्तेमाल multiple users के लिए नहीं किया जा सकता।
- Not Suitable for High-Volume Transactions: SQLite database high-volume transactions को handle करने के लिए suitable नहीं है, क्योंकि इसके transaction capabilities limited होती हैं।