鍥炲: How to DROP a Database in Android ?

by 鐜嬪績閿 » Thu, 13 Aug 2009 07:58:32 GMT


Sponsored Links
 If u wanna delete a tables. Use the drop sql in upgrade method in
sqlitehelper sub class

2009-8-13 7:52 AMquot;Emre A. Yavuz" <eayl...@hotmail.com> 


Hi,

Does anybody know how to DROP a database in Android ?

I've tried ContextWrapper.deleteDatabase(), mDb.close(), mDbHelper.close()
etc. methods with no luck so far. I tried to remove it using the shell, but
I don't have the permission to do it. I was able to drop the TABLES etc. in
the database that I had created but nothing further than that.

Any help is appreciated.

Cheers,

Emre

------------------------------
More storage. Better anti-spam and antivirus protection. Hotmail makes it
simple. < http://go.microsoft.com/?linkid=9671352> ;

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Blue screen when installing g1 drivers

Hello, I have a G1 phone, and I am having some troubles. I have
everything set up on my computer, and I can run apps on the emulator.
I wanted to start running the apps on my phone, so I downloaded the
drivers off of here, http://dl.google.com/android/android_usb_windows.zip,
plugged in my phone, and pointed the windows driver installer to the
unzipped folder. It starts installing, and then a I get a blue screen
with...

BAD_POOL_CALLER

STOP 0x000000c2 (0x00000007 0x00000CD4 0x04030601 0xe10d4398)

And I've tried this multiple times, and I've re downloaded the
drivers. No luck, same error. Any tips or advice would be greatly
appreciated. I've started to learn java and thought the g1 would be a
great learning tool, thanks in advance.

--~--~---------~--~----~------------~-------~--~----~

2. Not getting expected socket errors

Normally in TCP socket programming, if the remote end closes the
connection, the local program is notified by a return value (in C) or
an exception (in Java).  But in Android, if I terminate the remote end
of a socket connection while transmitting data, no exception is
thrown, and no error reported.  Is this a bug, or is there something
about socket programming in Android I'm missing?

Here's some sample Android code to demonstrate.  If you run 

    $ netcat -l -p 1234

It will receive the "test" transmissions, but if you kill netcat, the
Android app keeps running without printing a stack trace, indicating
no exception has been thrown.

    Socket socket = null;
    OutputStream os = null;
    try {
        socket = new Socket("10.0.2.2", 1234);
        os = socket.getOutputStream();
    } catch (UnknownHostException e) {  
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    while (true) {
        try {
            Log.i("test", "test");
            os.write("test\n".getBytes());
            os.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

And a standard Java app.  If you kill netcat while this is running,
you'll receive the expected SocketException.

    public class SocketTest {
         private static Socket mSocket;
         private static OutputStream mOS;

         public static void main(String[] args) throws IOException {
             try {
                 mSocket = new Socket("127.0.0.1", 1234);
                 mOS = mSocket.getOutputStream();
             } catch (UnknownHostException e) {
                 e.printStackTrace();
             }
                
             while (true){
                 System.out.println("test");
                 mOS.write("test\n".getBytes());
                 mOS.flush();
             }
         }
    }

--~--~---------~--~----~------------~-------~--~----~

3. GTalk (XMPP) service, ADC, android market and wasted months

4. Market-Downloads: "Starting Download..."

5. Drawing many map overlays efficiently

6. Beginning

7. When an app issues an updated version, it gets on top of the Market's sort "by date" list