[android-beginners] Re: database

2010-08-08 Thread skink
Tanay M. Kapoor wrote: > i need to add a large amount of data to an android database i have > created. Is there any tool i can use to do this instead of making an > activity to write and manually add the data. My application need only > display the data not add new thigns to the datdbase. > Pleas

[android-beginners] Re: database

2010-08-08 Thread DanH
You can build the database on any platform (perhaps using a tool like SQLite Expert) and upload it to Android. The trick is that you have get it from wherever you upload it into the app's database directory (plus add a few extra records that Android wants). Some info here: http://www.reigndesign

Re: [android-beginners] Re: Database handling - when do you open and close

2010-08-06 Thread Kostya Vasilyev
No, calling Thread.sleep() won't work. Android framework is largely single-threaded, event-driven. This means that your application and the framework run on the same thread, passing control to each other, doing work in small pieces. This thread is called the UI thread, and blocking it by calli

[android-beginners] Re: Database handling - when do you open and close

2010-08-06 Thread Bender
I tried the following in my activity: mServiceConnection = new DbServiceConnection(mDatabaseBinder); final Intent databaseServiceIntent = new Intent(this, DatabaseService.class); this.bindService(databaseServiceIntent, mServiceConnection, Context.BIND_AUTO_CREATE);

Re: [android-beginners] Re: Database handling - when do you open and close

2010-08-06 Thread Kostya Vasilyev
Sure. The service connection callback you seem to already have in your code. -- Kostya Vasilyev -- http://kmansoft.wordpress.com 06.08.2010 12:10 пользователь "Bender" написал: Ok I tried to find out at which point the service is started and when I can access its database variable. The logs I u

[android-beginners] Re: Database handling - when do you open and close

2010-08-06 Thread Bender
Ok I tried to find out at which point the service is started and when I can access its database variable. The logs I used showed that the services onCreate() is called after the onResume() method by my activity. That is a bit late because I need access to the database before onResume() to fill the

Re: [android-beginners] Re: Database handling - when do you open and close

2010-08-05 Thread Kostya Vasilyev
Starting / binding to a service is asynchronous. You can't call bindService and expect it to be already started and bound by the next line. Call bindService and return control to Android by returning from onCreate or whatever. Your service connection callback will be invoked a little later, once t

[android-beginners] Re: Database handling - when do you open and close

2010-08-05 Thread Bender
Thanks for your reply, and sorry for my late answer. :-) I tried to get it running as a service but I don't really get how I have to use services, binders and service connections. I'm reading a book with an example for services but can't adopt it to my problem. What I tried is the following: I cr

[android-beginners] Re: Database handling - when do you open and close

2010-07-18 Thread brucko
Bender, put your db in a local Service. Open the db in onCreate() close it in onDestroy(). Your Activities can bind and unbind to the Service as many times as you like. The system will keep the service running as long as you have an activity in the foreground process bound to it or otherwise unti

[android-beginners] Re: Database handling - when do you open and close

2010-07-18 Thread Bender
I want to get rid of the error which is telling me that there is a leak in my app because my db gets opened twice. The db doesn't need to be open the whole time but it is accessed quite often so I don't think it would be very performant to open and close it for every access. On 16 Jul., 09:10, Yuv

Re: [android-beginners] Re: Database handling - when do you open and close

2010-07-16 Thread YuviDroid
mmm I'm not really sure what you are trying to achieve. Exactly, at what times do you want to open/close the db? The db should stay open while your application is running? So, even when you switch among activities (yours activities)? On Thu, Jul 15, 2010 at 6:36 PM, Bender wrote: > @YuviDroid >

[android-beginners] Re: Database handling - when do you open and close

2010-07-15 Thread Bender
@YuviDroid I'm trying the following at the moment: the open() only gets called in both onCreate() methods with: mDb = new DbAdapter(this); if(mDb.getDatabase() == null || !mDb.getDatabase().isOpen()) { mDb.open(); } The problem I'm having with this is, that ther

Re: [android-beginners] Re: Database handling - when do you open and close

2010-07-15 Thread Kostya Vasilyev
onResume / onPause are called when another activity pops in front, but your activity stays on the screen. So this is probably a bit much. You could try onStart / onStop, and move the code that populates views with database data from onCreate to onStart. -- Kostya 15.07.2010 18:49, Bender пиш

Re: [android-beginners] Re: Database handling - when do you open and close

2010-07-15 Thread YuviDroid
Then you could open the db in onCreate(), while in onResume() you open it only if it's not already opened (by using SQLiteDatabase.isOpen()). Just some ideas...;) Hope it works! Yuvi On Thu, Jul 15, 2010 at 4:49 PM, Bender wrote: > Thanks for your reply. I tried to open the db only in onResume

[android-beginners] Re: Database handling - when do you open and close

2010-07-15 Thread Bender
Thanks for your reply. I tried to open the db only in onResume() but that doesn't work since there are db accesses in the onCreate() method which is called before onResume() as far as I know. I think opening and closing the db after every access would slow the app down a lot because i'm using the d

[android-beginners] Re: Database open fails - dont know why?

2010-02-25 Thread jarnaud
Hello, to get a better lead, you might want to handle exceptions around this openDatabase. Let us know... -- Jay - android tutorials: http://android.voxisland.com -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging y

[android-beginners] Re: Database Retrieval in Android

2009-10-27 Thread Maxood
Thanks RichardC ! Have you read my thread on ADB error: device not found? On Oct 22, 9:24 am, RichardC wrote: > Notepad in samples > android-sdk-windows-1.6_r1\platforms\android-1.6\samples\NotePad > > is a good example of using SQLite through a content provider. > > Hopefully someone else will

[android-beginners] Re: Database Retrieval in Android

2009-10-22 Thread RichardC
Notepad in samples android-sdk-windows-1.6_r1\platforms\android-1.6\samples\NotePad is a good example of using SQLite through a content provider. Hopefully someone else will come along with a simpler example. -- RichardC On Oct 22, 5:10 pm, Maxood wrote: > I need a simple example to retrieve

[android-beginners] Re: database openOrCreateDatabase

2009-08-21 Thread moazzamk
I don't know what's causing the error in your code but it seems like you are using an older version of Android (maybe older than 1.0). I would recommend upgrading your Android SDK and using the method suggested in this link: http://moazzam-khan.com/blog/?cat=26&paged=2 . - Moazzam http://moazzam-

[android-beginners] Re: database openOrCreateDatabase

2009-08-21 Thread gandor
Emre Now I am using myDB = openOrCreateDatabase("data2", SQLiteDatabase.CREATE_IF_NECESSARY, null); before I was doing myDB = null; myDB.openOrCreateDatabase("data2", null); which was absurd Have to initialize myDB as the prototype of openOrCreateDatabase has the return as static On Aug 20,

[android-beginners] Re: database openOrCreateDatabase

2009-08-21 Thread Emre A. Yavuz
Hi, Am I missing something here or are you setting your database pointer to "null" and yet use it later on to crate/open your database ? Emre > Date: Thu, 20 Aug 2009 16:08:35 -0700 > Subject: [android-beginners] database openOrCreateDatabase > From: gand...@gmail.com > To: android-b

[android-beginners] Re: database openOrCreateDatabase

2009-08-20 Thread gandor
Sorry I screwed up the usage, this seems proper. myDB = openOrCreateDatabase("data2", SQLiteDatabase.CREATE_IF_NECESSARY, null); On Aug 20, 4:08 pm, gandor wrote: > Hi Guys, > > I am creating a new database, with a table and inserting some fields > in it > But I get the following error in op

[android-beginners] Re: Database location and management via external tools.

2009-06-18 Thread Mark Murphy
> A pretty cool way is to use the following firefox plugin > > SQLiteManager : https://addons.mozilla.org/en-US/firefox/addon/5817 > > You can easily push and pull your SQLite data bases from an to the > device or emulator. SQLiteManager rocks, which is why I was dismayed to see: "Announcement

[android-beginners] Re: Database location and management via external tools.

2009-06-18 Thread Roman
A pretty cool way is to use the following firefox plugin SQLiteManager : https://addons.mozilla.org/en-US/firefox/addon/5817 You can easily push and pull your SQLite data bases from an to the device or emulator. -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The view

[android-beginners] Re: Database location and management via external tools.

2009-06-18 Thread Mark Murphy
> How can I get direct access to created database (via sqlite tools)? On the device, use adb shell to get a (limited) shell prompt, then run sqlite3. The directory where your database resides is /data/data/your.package.here/databases (substitute in your application's package for "your.package.her

[android-beginners] Re: database tool

2008-09-23 Thread Harijadi Witaria
Test On 9/23/08, AndreAgosto <[EMAIL PROTECTED]> wrote: > > ok, Very thanks i discovered this way. So i think is not possible to > work directly on db in emulator, right? It would be very useful.. > > On Sep 23, 2:19 pm, Mark Murphy <[EMAIL PROTECTED]> wrote: >> AndreAgosto wrote: >> > No, no, so

[android-beginners] Re: database tool

2008-09-23 Thread Mark Murphy
AndreAgosto wrote: > ok, Very thanks i discovered this way. So i think is not possible to > work directly on db in emulator, right? It would be very useful.. http://www.jsharkey.org/blog/2008/09/11/quick-database-row-editor-in-android-09-sdk/ I'm sure there will be a few SQLite clients available

[android-beginners] Re: database tool

2008-09-23 Thread AndreAgosto
ok, Very thanks i discovered this way. So i think is not possible to work directly on db in emulator, right? It would be very useful.. On Sep 23, 2:19 pm, Mark Murphy <[EMAIL PROTECTED]> wrote: > AndreAgosto wrote: > > No, no, sorry, you are right, SQLite database. > > I installed firefox plugin

[android-beginners] Re: database tool

2008-09-23 Thread Mark Murphy
AndreAgosto wrote: > No, no, sorry, you are right, SQLite database. > I installed firefox plugin now, thanks, but i can't find my android's > databases.. where they are? can you help me? thanks On the device, you should be able to find them at: /data/data/your.app.package/databases/your-db-name.

[android-beginners] Re: database tool

2008-09-23 Thread AndreAgosto
No, no, sorry, you are right, SQLite database. I installed firefox plugin now, thanks, but i can't find my android's databases.. where they are? can you help me? thanks On Sep 22, 8:51 pm, "Mark Murphy" <[EMAIL PROTECTED]> wrote: > > is possible to explore android embedded database? already exist

[android-beginners] Re: database tool

2008-09-23 Thread AndreAgosto
No, no, sorry, you are right, SQLite database. I installed firefox plugin now, thanks, but i can't find my android's databases.. where they are? can you help me? thanks On Sep 22, 8:51 pm, "Mark Murphy" <[EMAIL PROTECTED]> wrote: > > is possible to explore android embedded database? already exist

[android-beginners] Re: database tool

2008-09-22 Thread Mark Murphy
> is possible to explore android embedded database? already existing > something for that purpose? If by "Android embedded database" you mean the SQLite databases you can create, there are any number of SQLite clients available for use. For a GUI, I like the SQLite Manager plugin for Firefox. The

[android-beginners] Re: DataBase problems

2008-08-27 Thread Megha Joshi
2008/8/27 spinifu <[EMAIL PROTECTED]> > > Hello ppl: > > I'm having a lot of trouble with the database code that worked > perfectly with the older SDK, 0.5. > For now i'll just ask you whats your approach when creating a > database, are you using context.openOrCreateDatabase(), or are you > creati