¾ÛÅøÁî
46.¢½.168.138
46.¢½.168.129
46.¢½.168.161
46.¢½.168.136
46.¢½.168.145
46.¢½.168.162
46.¢½.168.144
46.¢½.168.140
115.¢½.135.198
46.¢½.168.139
 
°Ô½Ã¹° 88°Ç
   
ÁÖ¼Ò·Ï Ãß°¡/»èÁ¦ °¨ÁöÇؼ­ ¾ÛÀÇ dbÃß°¡/»èÁ¦Çϱâ.
±Û¾´ÀÌ : ±èº´ÁÖ                   ³¯Â¥ : 2012-09-24 (¿ù) 13:44 Á¶È¸ : 12689
¾ÛÀ» °³¹ß ÇÏ´Ùº¸¸é ÁÖ¼Ò·ÏÀ» »ç¿ëÇÏ´Â °æ¿ì°¡ Àִµ¥, ÀÌ °æ¿ì µ¿±âÈ­ ¹®Á¦°¡ ¹ß»ý ÇÕ´Ï´Ù.
 
ÁÖ·Î °èÁ¤À» »ý¼ºÇؼ­ µ¿±âÈ­ ÇÏ´Â ¹æ¹ýÀ» ¸¹ÀÌ ¾²½Ã´Âµ¥, ÀÌ °æ¿ì¿¡´Â ¹ÙÀδõ³ª ¼­ºñ½º¸¦ »ç¿ëÇؾß
 
µÈ´Ù´Â Á¡¶§¹®¿¡ ÀϺΠ¾Û¿¡¼­´Â »ç¿ëÇϱⰡ Èûµç °æ¿ì°¡ ÀÖ½À´Ï´Ù.
 
(AIDL·Î Åë½ÅÇϰųª, ÀÌ¹Ì ¹ÙÀδõ¿¡¼­ ó¸®ÇÏ´Â °ÍÀÌ ÀÖ¾î °èÁ¤ »ý¼º ¹× µ¿±âÈ­ ¸ðµâÀ» ³Ö±â Èûµé °æ¿ì...)
 
¾Èµå·ÎÀ̵忡¼­´Â Observer ¶ó´Â °³³ä(»ç½Ç ÀÚ¹Ù¿¡µµ ÀÖ½À´Ï´Ù¸¸..)À» ÀÌ¿ëÇؼ­ ContentµéÀÇ À̺¥Æ®¸¦ °¨Áö ÇÏ´Â °ÍÀÌ ÀÖ½À´Ï´Ù.
 
ContentObserver
¶ó´Â °ÍÀε¥. ÀÌ´Â Çڵ鷯¸¦ ÅëÇØ obtainmessage·Î ÀÏÁ¤ ¸Þ¼¼Áö¿¡ µû¶ó À̺¥Æ®¸¦ ¹ß»ý½Ãų ¼öµµ ÀÖ°í
 
ÁÖ¼Ò·Ï¿¡ ¿ÉÀú¹ö¸¦ ¿¬°áÇϸé Äõ¸®°¡ ¹ß»ýÇÒ¶§¸¶´Ù À̺¥Æ®¸¦ ¹ß»ý½ÃÄÑ »ç¿ëÀÚ¿¡°Ô ¾Ë·ÁÁÝ´Ï´Ù.
 
ContentObserver mmm = new ContentObserver(new Handler()) {
  /* (non-Javadoc)
   * @see android.database.ContentObserver#deliverSelfNotifications()
   */
  @Override
  public boolean deliverSelfNotifications() {
   // TODO Auto-generated method stub
   return super.deliverSelfNotifications();
  }
  /* (non-Javadoc)
   * @see android.database.ContentObserver#onChange(boolean)
   */
  @Override
  public void onChange(boolean selfChange) {
   // TODO Auto-generated method stub
   super.onChange(selfChange);
  }
  
 };
 
´ëÃæ ÀÌŬ¸³½º·Î »ý¼ºÇÏ°Ô µÇ¸é onChange¿Í deliverSelfNotifications(); °¡ ÀÖ½À´Ï´Ù.
 
deliver´Â ¸»±×´ë·Î »ç¿ëÀÚ¿¡°Ô À̺¥Æ®¸¦ ¾Ë·ÁÁÖ´Â Noti( ½Ã°¢ÀûÀÎ)¸¦ ¹ß»ý½ÃÄÑÁÖ´Â °÷ÀÌ°í,
 
onChange´Â À̺¥Æ®°¡ ¹ß»ýµÇ¾úÀ» ¶§ È£ÃâµË´Ï´Ù.
 
ContentResolver cr = getContentResolver();
  cr.registerContentObserver(RawContacts.CONTENT_URI, false, mmm);
 
ÁÖ¼Ò·Ï¿¡¼­ ¿ÉÀú¹öÀÇ µî·ÏÀº À§¿Í °°ÀÌ ¼±¾ðÇϽøé
 
Ãß°¡,»èÁ¦,¾÷µ« µîÀÇ À̺¥Æ®¸¦ °¨ÁöÇÒ¶§¸¶´Ù onChange¸¦ ºÒ·¯ÁÝ´Ï´Ù.
 
´Ü, ÀÌ onChange´Â À̺¥Æ® ¹ß»ý¸¸ ¾Ë·ÁÁÙ»Ó ¾î¶² ÆĶó¸ÞÅ͵µ ³Ñ°ÜÁÖÁö ¾Ê½À´Ï´Ù.
 
µû¶ó¼­ »ç¿ëÀÚ´Â ÀÌ À̺¥Æ®°¡ ¹ß»ýÇÒ¶§, ÁÖ¼Ò·ÏÀ» »õ·Î ºÒ·¯¿Í¼­ Ãß°¡ÇÒ°Ç Ãß°¡ÇÏ°í »èÁ¦³ª °»½ÅÇÒ°Ç
 
°»½ÅÇÏ½Ã¸é µË´Ï´Ù.
 
ÇÏÁö¸¸ »èÁ¦ÀÇ °æ¿ì »èÁ¦µÈ ¾ÆÀ̵𸦠ã±â À§ÇØ »ó´çÈ÷ ¸¹Àº ÀÛ¾÷À» ÇؾߵǴ °æ¿ì°¡ Àִµ¥,
 
À̸¦ ¹æÁöÇϱâ À§ÇØ
 
CopyDB(¾ÛÀÇ DB)ÂÊ¿¡ deleted Çʵ带 Çϳª ¸¸µé¾îÁÝ´Ï´Ù. (append·Î ÇϽôø ¾÷µ¥ÀÌÆ®Çϸ鼭 Ãß°¡ÇϽôø...)
 
»èÁ¦ÀÇ °æ¿ì ¸ðµç row¿¡ ´ëÇØ deleted Çʵ带 ÀüºÎ delete »óÅ·Π¼³Á¤ÇϽðí,
 
ÁÖ¼Ò·Ï¿¡¼­ ¾ÆÀ̵𸦠¹Þ¾Æ¿Í Àִ°͸¸ notdelete »óÅ·Π¹Ù²ãÁÖ½Ã¸é µË´Ï´Ù.
 
(°æ¿ì¿¡ µû¶ó ¸¹Àº ½Ã°£ÀÌ ¼Òºñ µÉ ¼ö ÀÖÀ¸´Ï, À̺κÐÀº asyncTask¸¦ ÀÌ¿ëÇÏ½Ã¸é µË´Ï´Ù.)
 
Ãß°¡ÀÇ °æ¿ì´Â ¾ø´Â id°¡ ³ª¿Ã°æ¿ì ÇØ´ç ¾ÆÀ̵ðÇʵåÀÇ À妽º¸¦ °¡Á®¿Í Ãß°¡ÇØÁÖ½Ã¸é µË´Ï´Ù.
 
»èÁ¦Àü
 
[_id][Name][EMAIL][PHONE1][PHONE2][ADDRESS][THUMBNAIL][PHONE_ID][deleted]
1       k            dd         0101                           102        content://          1                1
 
»èÁ¦ ÈÄ
 
[_id][Name][EMAIL][PHONE1][PHONE2][ADDRESS][THUMBNAIL][PHONE_ID][deleted]
1       k            dd         0101                           102        content://          1                0
 
»èÁ¦µÈ°Í »©°í °¡Á®¿Ã ¶§,
 
db.query(DATABASE_TABLE, new String[] { KEY_ROWID,.....DATABASE_ID,DATABASE_COL_STATUS},null,null,DATABASE_ID, DATABASE_COL_STATUS+" > 0 ", null);
 
ÀÌ·±½ÄÀ¸·Î Group By HavingÀ» ÀÌ¿ëÇϽøé delete »óÅ°¡ ¾Æ´Ñ °ªµé¸¸ ¼±ÅÃÇÏ¿© °¡Á®¿À°Ô µË´Ï´Ù.
 
DBÀÇ °æ¿ì ÇÊ¿ä¾ø´Â °ªÀÌ ³Ê¹« ½×ÀÌ°Ô µÇ¸é deleted°¡ 0À¸·Î ¼ÂÆÃµÇ ÀÖ´Â °ÍÀ» »Ì¾Æ¿Í
 
ÀÏ°ý »èÁ¦ ÇØÁÖ½Ã¸é µË´Ï´Ù.
 
(ÀÌ ¹æ¹ýÀº ´ëºÎºÐÀÇ ÁÖ¼Ò·Ï¿¡¼­ »ç¿ë µÇ°í ÀÖ´Â ¹æ½ÄÀ̱⵵ ÇÕ´Ï´Ù.)
 
* ±ÛÀ» µî·ÏÇϽǶ§ ²À ÇÊ¿äÇÑ °æ¿ì°¡ ¾Æ´Ï¸é °³ÀÎÁ¤º¸¸¦ ³²±âÁö ¸¶¼¼¿ä ^^ (¿¬¶ôó,À̸ÞÀÏÁÖ¼Ò,Áֹεî·Ï¹øÈ£ µî)




±èº´ÁÖ ´ÔÀÇ Tip&Tech ÃÖ½Å±Û [´õº¸±â]


   

°Ô½Ã¹° 88°Ç
¹øÈ£ Á¦¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
88  <Ŭ¶ó¿ìµåÇõ½Å¼¾ÅÍ> 12¿ù 1ÀÏ SW ½ºÅ¸Æ®¾÷ â¾÷ ¼º°ø Àü·« ¼¼¹Ì³ª Âü¼® ¿äû Áظð 11-30 4096
87  <Ŭ¶ó¿ìµåÇõ½Å¼¾ÅÍ> 12¿ù 1ÀÏ SW ½ºÅ¸Æ®¾÷ â¾÷ ¼º°ø Àü·« ¼¼¹Ì³ª Áظð 11-23 3952
86  °³Àΰ³¹ßÀÚ SW°³¹ßȯ°æ Áö¿ø»ç¾÷ ¾È³» Áظð 10-28 4241
85  ¸Æ¿¡¼­ ±¸±Û API key µî·Ï¹æ¹ý ¼º±âµ¿ 08-29 4606
84  [Agate Mobile] ¾Û ¼³Ä¡ ¾øÀÌ ¼­¹ö·ÎºÎÅÍ ½Ç½Ã°£ ·Îµù µÇ¾î µ¿ÀÛÇÏ´Â Cloud Native App ÇÁ·¹ÀÓ¿öÅ©ÀÔ´Ï´Ù. ¾¾Æ®¸°°³¹ß¡¦ 07-21 7882
83     [Agate Mobile] ¾Û ¼³Ä¡ ¾øÀÌ ¼­¹ö·ÎºÎÅÍ ½Ç½Ã°£ ·Îµù µÇ¾î µ¿ÀÛÇÏ´Â Cloud Native App ÇÁ·¹ÀÓ¿öÅ©ÀÔ´Ï´Ù. ±èÀºÈ£ 08-21 12278
82  ÀÚ¹Ù Ãʺ¸µé¿¡°Ô ÃßõÇÏ´Â ±âÃÊ °³³äÀ» ÀâÀ» ¼ö Àִ åµé ÀÌ°æ¿ë 06-19 5941
81  [ÆÁ] °¶·°½Ã ³ëÆ®3 °³¹ßÀÚ ¿É¼Ç ¸Þ´º ã±â ^^ ÀÌ°æ¿ë 11-09 9884
80  ¾ÛÅÛÇø´À» Á¦°øÇÏ´Â »çÀÌÆ® ¼Ò°³ÇÕ´Ï´Ù. ¾¾Æ®¸°°³¹ß¡¦ 08-21 12452
79  The content of the adapter has changed but ListView ... ¿¡·¯ ÀϹÝÀû ÇØ°á¹ý. ±èº´ÁÖ 04-16 15616
78  °£´ÜÇÏ°Ô Æнº¿öµå¿¡ ¼ýÀÚ°¡ È¥¿ëµÇ¾ú´ÂÁö ó¸®ÇÒ ¼ö ÀÖ´Â ¸Þ¼ÒµåÀÔ´Ï´Ù. ±èº´ÁÖ 01-31 6669
77  handler¸¦ ÀÌ¿ëÇØ °¡º¯½Ã°£ ¹Ýº¹ ÀÛ¾÷Çϱâ. ±èº´ÁÖ 11-26 8615
76  String -> HEX ±èº´ÁÖ 11-12 6020
75  ¸®½ºÆ® ÀÛ¾÷½Ã¿¡ ±âº»ÀûÀ¸·Î ¾Ë¾ÆµÎ¼Å¾ß µÉÁ¡. +1 ±èº´ÁÖ 10-08 7090
74  xml Á÷·Äó¸® °í¹ü¼® 09-24 4541
73  ÁÖ¼Ò·Ï Ãß°¡/»èÁ¦ °¨ÁöÇؼ­ ¾ÛÀÇ dbÃß°¡/»èÁ¦Çϱâ. ±èº´ÁÖ 09-24 12690
72  È®À帮½ºÆ®°¡ 3µª½º ÀÌ»óÀÌ µÉ±î? ¾ÈµÉ±î? +1 ±èº´ÁÖ 08-21 10361
71  ZXing ¹ÙÄÚµå ½ºÄµºÎºÐ Å©±â Á¶ÀýÇϱâ. ±èº´ÁÖ 08-06 14925
70  ÀÌŬ¸³½º¿¡¼­ ·¹À̾ƿô xml ±×·¡ÇȺκÐÀÌ °©Àڱ⠾Ⱥ¸ÀÏ°æ¿ì. +1 ±èº´ÁÖ 07-27 6657
69  °£¸¸¿¡ ±Û¾²³×¿ä À̹ø¿£ launcherShortCut (¹Ù·Î°¡±â ¾ÆÀÌÄÜ)ÀÔ´Ï´Ù. ±èº´ÁÖ 07-25 12246
 1  2  3  4  5  
 
 
 
Copyright ¨Ï wwwold.androidstudy.co.kr. All rights reserved.