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
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
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
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);
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
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
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
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
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
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
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
>
@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
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 пиш
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
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
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
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
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
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-
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,
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
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
> 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
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
> 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
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
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
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
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.
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
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
> 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
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
33 matches
Mail list logo