¾ÛÅøÁî
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
 
°Ô½Ã¹° 223°Ç
   
DBÀÚ·á ºÒ·¯¿À±â Áú¹®ÀÔ´Ï´Ù.
±Û¾´ÀÌ : ÀÌ½Â±Ô                   ³¯Â¥ : 2012-02-13 (¿ù) 20:51 Á¶È¸ : 3524
½Ã°£Ç¥ Á¦ÀÛÇϱ¸Àִµ¥¿ä
°ø°³µÈ ½Ã°£Ç¥ ¾îÇà DB¸¦ °¡Áö°í¿Í¼­
assets/database¿¡ ³Ö¾ù±¸¿ä
 
ÄÚµù¿¡¼­
try {
   db_create();      // assets/databaseÆú´õ¿¡ ÀÖ´Â dbÆÄÀÏÀ» ÇöÀç AVD¿¡ ¼³Ä¡
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();    // ¿¡·¯½Ã ÇÁ¸°Æ®
  }
À̰͵µÇÏ°í
 
private void db_create() throws IOException{
  File folder = new File("/data/data/abc.prj1/databases/");
  folder.mkdirs();
  File outfile = new File("/data/data/abc.prj1/databases/table.db");
  AssetManager am = getResources().getAssets();
  InputStream is = am.open("database/table.db", AssetManager.ACCESS_BUFFER);
  long filesize = is.available();
  if(outfile.length() < filesize){
   byte[] data = new byte[(int)filesize];
   is.read(data);
   is.close();
   outfile.createNewFile();
   FileOutputStream fos = new FileOutputStream(outfile);
   fos.write(data);
   fos.close();
  }
 }
ÀÌ·¸°Ô Ç߰ŵç¿ä. À̺κÐÀº
°ø°³µÈ ½Ã°£Ç¥ ¾îÇà ¿¡¼­ ±×´ë·Î °¡Á®¿Ó¾î¿ä ÇÁ·ÎÁ§Æ®À̸§Àº ¹Ù²Ù°í..
 
±×¸®°í ³ªÁß¿¡ db¿¡ Á¢±ÙÇÒ¶§¿¡ ÀÌŬ¸³½º´Â ¿À·ù°¡ ¾ø´Âµ¥
ÆùÀ¸·Î µð¹ö±ëµµÁß¿¡, dbÁ¢±Ù¿¡¼­¸¸ ¿¹±âÄ¡¸øÇÑ ¿À·ù°¡ »ý±â³×¿ä.
 
cursor = sql_db.rawQuery("select * from TimeTable", null);
 
ÀÌ·¸°Ô select³ª insertµî db¿¡ º»°ÝÀûÀ¸·Î Á¢±ÙÇÏ·ÁÇÒ¶§
Æù¿¡¼­´Â ¿À·ù°¡ ³ª´Âµ¥¿ä...
 
¾î¶»°Ô ÇؾßÇÏ´ÂÁö ¹æÇâÁ» Àâ¾ÆÁÖ½Ã¸é °¨»çÇÕ´Ï´Ù. ¤Ð¤Ð
* ±ÛÀ» µî·ÏÇϽǶ§ ²À ÇÊ¿äÇÑ °æ¿ì°¡ ¾Æ´Ï¸é °³ÀÎÁ¤º¸¸¦ ³²±âÁö ¸¶¼¼¿ä ^^ (¿¬¶ôó,À̸ÞÀÏÁÖ¼Ò,Áֹεî·Ï¹øÈ£ µî)





 
±èÀºÈ£ 2012-02-14 (È­) 13:43
¾î¶² ¿À·ù°¡ ³ª³ª¿ä?
 
±èº´ÁÖ 2012-02-14 (È­) 13:59
¼Ò½º º¸´Ï±î assets Æú´õ¿¡ ÀÖ´Â db¸¦ ÆÐÅ°Áö¸í ¹ØÀÇ ÀÎÅͳΠÀúÀå¼Ò¿¡ º¹»ç¸¦ Çϴ°ǵ¥¿ä
¼Ò½º ÀÚü´Â ¹®Á¦ ¾ø½À´Ï´Ù.
´Ù¸¸!
ÀÎÅͳΠÀúÀå¼Ò¿¡ ÀÖ´Â "DB"¸¦ Á¢±ÙÇÏ°íÀÚ ÇÒ ¶§´Â ¹Ýµå½Ã, »ç¿ëÇؾߵǴ ¸Þ¼Òµå°¡ ÀÖ½À´Ï´Ù.
SQLiteOpenHelper dd;
dd.getWritableDatabase().insert(table, nullColumnHack, values)
dd.getReadableDatabase().query(table, columns, selection, selectionArgs, groupBy, having, orderBy);
»ç¿ëÇϼžߵ˴ϴÙ.

ÀÎÅͳÎÀº µû·Î ÆÛ¹Ì¼Ç ±ÇÇÑÀÌ ¾øÁö¸¸, ³»ºÎÀûÀÎ µ¥ÀÌÅ͸¦ »ç¿ëÇϱ⠶§¹®¿¡ °°Àº ¾Û ³»¿¡¼­¶óµµ Àú·± ±ÇÇÑÀÌ ÀÖ´Â ¸Þ¼Òµå¸¦ ÅëÇØ »ç¿ëÇÏ¼Å¾ß Á¢±ÙÀÌ Çã¿ëµË´Ï´Ù.
¶ÇÇÑ, SQLiteOpenHelper¸¦ ÅëÇØ »ý¼ºµÈ DB¿Í ±×³É º¹»çÇؼ­ »ý¼ºµÈ DB´Â Á¢±ÙÀÚü°¡ »óÀÌÇÕ´Ï´Ù.
ÀÌÁ¡ Âü°íÇϽñ⠹ٶø´Ï´Ù.
ÈÄÀÚÀÇ °æ¿ì°¡ ¹Ù·Î ÇöÀç ÇÊÀÚ°¡ »ç¿ëÇÑ ¹æ¹ýÀ̹ǷΠÀ§¿¡ ÀûÈù ¸Þ¼Òµå¸¦ ÅëÇؼ­ »ç¿ëÇϽøé
Á¢±Ù°¡´ÉÇϽʴϴÙ.
   

°Ô½Ã¹° 223°Ç
¹øÈ£ Á¦¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
163  EditText º° Å°ÆÐµå º¯°æ +1 ¹ÚÁ¤Çö 02-23 5342
162  »çÁø ÀúÀå½Ã ¿À·ù ¹ÚÁ¤Çö 02-22 5756
161  apk À¥¹èÆ÷ °ü·ÃÀÔ´Ï´Ù. +2 ¹Ú³²±Ô 02-22 3352
160  Áú¹® Çϳª°¡ ÀÖ½À´Ï´Ù +2 Á¤Çö±Ô 02-22 4487
159  ±×¸² ³Ö´Â°Í¿¡ ´ëÇØ Áú¹®ÀÌ ÀÖ½À´Ï´Ù. +4 Á¤Çö±Ô 02-22 4175
158  ¾îÇà ¾ÆÀÌÄÜ º¯°æÇϱâ +2 ¹ÚÁ¤Çö 02-21 15641
157  ¼±À¸·Î µµÇüÀ» ±×¸®°í ½ÍÀºµ¥¿ä..¤Ð¤Ð +2 ¼ÕÁø½Ä 02-17 4529
156  DBÀÚ·á ºÒ·¯¿À±â Áú¹®ÀÔ´Ï´Ù. +2 ÀÌ½Â±Ô 02-13 3525
155  ¾Èµå·ÎÀÌµå ½º·¹µå¿Í dalvickVM Ç÷¹À̾î¿ÍÀÇ °ü°è¿¡ ´ëÇÑ Áú¹® +1 ±èº´ÁÖ 02-07 5868
154  µµ¿ÍÁÖ¼¼¿ä..¤Ð¤Ð +3 ±èÀºÁ¤ 02-07 3051
153  »çÁø¾÷·Îµå ¼Ò½º Á» ºÁÁÖ¼¼¿ä +1 ¹ÚÁ¤Çö 02-07 4657
152  »çÁø ÀúÀå ¹× ¼­¹ö¿¡ ¾÷·Îµå +1 ¹ÚÁ¤Çö 02-06 4535
151  ÀÌÁ¦¸·½ÃÀÛÇߴµ¥.. µµ¿ÍÁÖ¼¼¿ä ¤Ì.¤Ì +3 Á¤Çö±Ô 02-02 4690
150  ¹®ÀÚ,ºÎÀçÁß,Ä«Åå ¿ÔÀ»½Ã¿¡ ¿ÜºÎ LED ¹öÆ°ÀÌ °è¼Ó ºû³ª°Ô ¼öÁ¤ÇÒ ¼ø ¾øÀ»±î¿ä? +2 ¾çÁ¤¹ü 01-29 3109
149  Html ÆÄ½Ì °ü·Ã Áú¹®ÀÔ´Ï´Ù. °í¼ö´Ôµé Á¦¹ß Çѹø¸¸ ½Å°æ½áÁÖ½Ã¸é ¹é°ñ³­¸ÁÀ¸·Î ¾Ë°Ú½À´Ï´Ù ¤Ð +3 ±èÂù¼º 01-27 3405
148  ¾Èµå·ÎÀ̵å ÀÌŬ¸³½º ½ÇÇàÀ» Çغ¸°í½ÍÀºµ¥... +2 ±èµµÇü 01-22 3323
147  µµ¿ÍÁÖ¼¼¿ä !! °í¼ö´Ôµé..¤Ì¤Ì +2 ±èµ¿¹Î 01-15 2563
146  »çÁøÂï¾î¼­ ¼­¹ö¿¡ ¿Ã¸®´Â ¹æ¹ý +3 ¹ÚÁ¤Çö 01-13 4432
145  ¾Æ... À©µµ¿ì ¿À·£¸¸¿¡ ¸¸Áö´Ï °í»ýÀÌ À̸¸Àú¸¸ÀÌ ¾Æ´Õ´Ï´Ù ¤Ð¤Ð ¹ÚÂù¿ì 01-10 3959
144  °¶½ºÀ¯ÀúÀε¥ usb¿¬°áÇÏ°í µð¹ö±ëÀ» ÇÏ¸é ±â±â°¡ ÀνÄÀ» ¸øÇØ¿ä.. ¤Ð¤Ð¤Ð¤Ð µµ¿ÍÁÖ¼¼¿ä ¤Ð¤Ð +4 °í¿¬·ü 01-10 3592
 1  2  3  4  5  6  7  8  9  10  11  12  
 
 
 
Copyright ¨Ï wwwold.androidstudy.co.kr. All rights reserved.