sqlite sample sd-card

by hermann » Sat, 27 Mar 2010 04:55:37 GMT

Sponsored Links
 hi there....

i looking for small sample how to access a sqlite db on sd-card.
can anybody help with a small snipet ?



sqlite sample sd-card

by Alessandro Pellizzari » Sun, 28 Mar 2010 13:44:25 GMT

 Il giorno mar, 23/03/2010 alle 04.38 -0700, hermann ha scritto:

File sdcard = Environment.getExternalStorageDirectory();

File dbfile = sdcard.getAbsolutePath() + File.separator + "dbname.sql";

SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(dbfile, null);

it is a good practice to NOT put your DBs on the sdcard root, so please
create a directory for your software.



Sponsored Links

sqlite sample sd-card

by hermann » Sun, 28 Mar 2010 16:31:31 GMT

 hi alessandro....

works fine for me.... thx for the snipet



Other Threads

1. Problem with Web View

Hi guys,

In my app I embed a web site into my application with WebView.  When
the user clicks a link on the originally loaded site, it takes them to
the new site - no problem, everything is still contained within my
app. But when the user is at that new link and then they flip/open the
screen on their g1, the original site gets loaded and they lose the
web site they were currently on. I cant find any docs or threads on
how to resolve this issue, does anyone have any tips on fixing this?

2. Two suggestions for android's framework

Hi, all
I have 2 suggestions for android's framework.
1. Add a new attribute about rotation in Surface class, user can control
each surface's rotation according to it.
   I suggest google add a new attribute NO_ROTATION in
frameworks/base/core/java/android/view/Surface.java,  then check it in
LayerBase.cpp::validateVisibility(...) function to decide if re-calculate
the orientation and position for this layer(surface). So it will provide a
capability for user to control each surface's rotation.
  For example:
   Camera application's controller surface need rotate according to the
phone status(landscape or portrait), but its viewfinder surface needn't
   In current android platform, we can correct it in
LayerBuffer::OverlaySource::onVisibilityResolved(), but it will prevent all
surfaces that use overlay to rotate, it isn't good method.

2. Add new interface function to set camera's parameters in MediaRecorder
   MediaRecorder class hasn't interface function to set the camera's
parameters. For setting camera's parameters, we need use Camera class to
show preview screen and camera controller. When press capture key to record
the video, we need use MediaRecorder class, there are two method to do it:
 a. call Camera.release(), then call MediaRecorder class to record the
video. The method will cause black screen when press the start key, it can't
be accpected.
 b, MediaRecorder call setCamera(xxx), then record video. The method will
call CameraService::Client::startPreview(), and it will return by the
following sentence:
    // do nothing if preview is already started
    if (mHardware->previewEnabled()) return NO_ERROR;
   If call stopPreview here, it will cause black screen.
   In addition, we set callback function NULL when use camera to preview, if
we want to set new callback when press capture key, we need stopPreview
again, it also causes black screen.

        if ( mFrameCallbackFlag == FRAME_CALLBACK_FLAG_NOOP )
            ret = mHardware->startPreview(NULL, mCameraService.get());
            ret = mHardware->startPreview(previewCallback,

  So if add interface function in MediaRecorder class, we will fix all

  These are my suggestion, please give me your comments, thanks in advance.

Best regards


3. Do I need a dev handset, or can I develop using a standard G1 from T-Mobile?

4. ListView/ScrollView in new Widgets

5. SDK 1.5 released - A Couple Questions

6. Placing an array of buttons of varying length on the layout

7. Porting 1.0 to 1.5, map tiles stopped displaying