[android-developers] ListAdapter transformation

2008-09-10 Thread Jorge D Ortiz

Hi all,

  I would like to transform the contents of one of the fields of a
databade before they get printed in each of the rows. For example, I
have an integer field that can be 0 or 1 and I want to print on or off
on the list. I assume that the proper place to do the transformation
is by using a cusomer adapter. Any examples on how to do that? Any
hints on the right method to override?  Thanks in advance.

  Best regards,

Jorge
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListView, multipleChoice -- how do you choose things?

2008-09-09 Thread Jorge D Ortiz

Hi all!

Same problem here. Any advances/diagnostic?

Best regards,

  Jorge


On Aug 26, 10:05 pm, "Mark Murphy" <[EMAIL PROTECTED]> wrote:
> > I just checked our changelogs and this is a bug we fixed after the SDK
> > was cut. Sorry for this inconvenience, the next SDK will provide you
> > with a fix for this.
>
> Whew! I thought I was losing my mind when I read your original reply.
>
> @Peli: thanks for chiming in and helping to prove my sanity! At least in
> this one narrow case... ;-)
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.1 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

Thank you!

On Sep 7, 1:09 am, Mark Murphy <[EMAIL PROTECTED]> wrote:
> Jorge D Ortiz wrote:
> > Very interesting. Thank you.
>
> > How do you deal with long clicks? I do not find any function in the
> > ListActivity that takes care of them. Is there any examples in the
> > ApiDemos?
>
> For cases like yours, they're called context menus. Call
> registerForContextMenu() for any widgets for which you want a context
> menu. Implement onCreateContextMenu() to populate those menus on demand.
> Implement onContextItemSelected() to handle the menu choice when made.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.1 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

Very interesting. Thank you.

How do you deal with long clicks? I do not find any function in the
ListActivity that takes care of them. Is there any examples in the
ApiDemos?

Best regards,

  Jorge

On Sep 6, 11:34 pm, Peli <[EMAIL PROTECTED]> wrote:
> > it seems more convenient to me
> > to delete from the list view (as in the tutorial) than having to get
> > into each of the items (like in the contacts application).
>
> You don't have to get into each item in the contacts application. This
> is just one possibility. The second possibility is: in the contacts
> tab where you see the list of all contacts lng click on a
> contact. Then a context menu opens where you can select "delete"
> directly.
>
> Peli
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

I couldn't find anything about "choice mode" in the documentation of
ListActivity. Could you point me to some info, please? Thanks.

Best regards,

  Jorge

On Sep 6, 11:30 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
> ListView offers a feature called "choice mode" that you can use to let the
> user check several items.
>
> On Sep 6, 2008 2:18 PM, "Jorge D Ortiz" <[EMAIL PROTECTED]> wrote:
>
> I understand.
>
>  I am not an expert on usability, but it seems more convenient to me
> to delete from the list view (as in the tutorial) than having to get
> into each of the items (like in the contacts application). What is the
> reason that promotes the later behaviour?
>
>  Best regards,
>
>    Jorge
>  On Sep 6, 10:09 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote: > And we're
> aware that this tutoria...> On Sat, Sep 6, 2008 at 1:08 PM, Jorge D Ortiz 
> <[EMAIL PROTECTED]> wrote: > > > > > > > However the...> Romain
>
> Guywww.curious-creature.org--~--~-~--~~~---~...You
> received this message because you are subscribed to the Google Groups
> "Android Developers" group...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

I understand.

 I am not an expert on usability, but it seems more convenient to me
to delete from the list view (as in the tutorial) than having to get
into each of the items (like in the contacts application). What is the
reason that promotes the later behaviour?

  Best regards,

Jorge


On Sep 6, 10:09 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
> And we're aware that this tutorial is wrong :( Sorry for being misleading.
>
> On Sat, Sep 6, 2008 at 1:08 PM, Jorge D Ortiz <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > However the tutorial (notepad) implements this exact behaviour. :-/
>
> >  Jorge
>
> > On Sep 6, 10:02 pm, Peli <[EMAIL PROTECTED]> wrote:
> >> > Could you
> >> > please point me to where this is documented?
>
> >> Romain Guy is the living documentation :-) He posted something similar
> >> above, when I posted it here.
>
> >> Peli
>
> >> > Thank you.
>
> >> > Best regards,
>
> >> >   Jorge
>
> >> > On Sep 6, 9:45 pm, Peli <[EMAIL PROTECTED]> wrote:
>
> >> > > > The code should do something like this:
> >> > > > 1. User selects one row of the list.
> >> > > > 2. User invokes the menu option "Delete row".
>
> >> > > A remark:
> >> > > As far as I understand, the proper Android way of doing this would be
> >> > > to put the "Delete" command into the long-click context menu...
> >> > > (either long-click by d-pad, or by touch). Context commands should not
> >> > > appear in the options menu - only global commands (e.g. "Delete all")
> >> > > should be placed there.
> >> > > See onCreateContextMenu(...)
>
> >> > > Peliwww.openintents.org-ZitiertenText ausblenden -
>
> >> > - Zitierten Text anzeigen -
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

However the tutorial (notepad) implements this exact behaviour. :-/

 Jorge

On Sep 6, 10:02 pm, Peli <[EMAIL PROTECTED]> wrote:
> > Could you
> > please point me to where this is documented?
>
> Romain Guy is the living documentation :-) He posted something similar
> above, when I posted it here.
>
> Peli
>
> > Thank you.
>
> > Best regards,
>
> >   Jorge
>
> > On Sep 6, 9:45 pm, Peli <[EMAIL PROTECTED]> wrote:
>
> > > > The code should do something like this:
> > > > 1. User selects one row of the list.
> > > > 2. User invokes the menu option "Delete row".
>
> > > A remark:
> > > As far as I understand, the proper Android way of doing this would be
> > > to put the "Delete" command into the long-click context menu...
> > > (either long-click by d-pad, or by touch). Context commands should not
> > > appear in the options menu - only global commands (e.g. "Delete all")
> > > should be placed there.
> > > See onCreateContextMenu(...)
>
> > > Peliwww.openintents.org-Zitierten Text ausblenden -
>
> > - Zitierten Text anzeigen -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

However the tutorial (notepad) implements this exact behaviour. :-/

 Jorge

On Sep 6, 10:02 pm, Peli <[EMAIL PROTECTED]> wrote:
> > Could you
> > please point me to where this is documented?
>
> Romain Guy is the living documentation :-) He posted something similar
> above, when I posted it here.
>
> Peli
>
> > Thank you.
>
> > Best regards,
>
> >   Jorge
>
> > On Sep 6, 9:45 pm, Peli <[EMAIL PROTECTED]> wrote:
>
> > > > The code should do something like this:
> > > > 1. User selects one row of the list.
> > > > 2. User invokes the menu option "Delete row".
>
> > > A remark:
> > > As far as I understand, the proper Android way of doing this would be
> > > to put the "Delete" command into the long-click context menu...
> > > (either long-click by d-pad, or by touch). Context commands should not
> > > appear in the options menu - only global commands (e.g. "Delete all")
> > > should be placed there.
> > > See onCreateContextMenu(...)
>
> > > Peliwww.openintents.org-Zitierten Text ausblenden -
>
> > - Zitierten Text anzeigen -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

Interesting. I didn't know this was the expeced behaviour. Could you
please point me to where this is documented? Thank you.

Best regards,

  Jorge

On Sep 6, 9:45 pm, Peli <[EMAIL PROTECTED]> wrote:
> > The code should do something like this:
> > 1. User selects one row of the list.
> > 2. User invokes the menu option "Delete row".
>
> A remark:
> As far as I understand, the proper Android way of doing this would be
> to put the "Delete" command into the long-click context menu...
> (either long-click by d-pad, or by touch). Context commands should not
> appear in the options menu - only global commands (e.g. "Delete all")
> should be placed there.
> See onCreateContextMenu(...)
>
> Peliwww.openintents.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

Interesting. I didn't know this was the expeced behaviour. Could you
please point me to where this is documented? Thank you.

Best regards,

  Jorge

On Sep 6, 9:45 pm, Peli <[EMAIL PROTECTED]> wrote:
> > The code should do something like this:
> > 1. User selects one row of the list.
> > 2. User invokes the menu option "Delete row".
>
> A remark:
> As far as I understand, the proper Android way of doing this would be
> to put the "Delete" command into the long-click context menu...
> (either long-click by d-pad, or by touch). Context commands should not
> appear in the options menu - only global commands (e.g. "Delete all")
> should be placed there.
> See onCreateContextMenu(...)
>
> Peliwww.openintents.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

Fair enough! Thank you.

  Jorge

On Sep 6, 9:45 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> Jorge D Ortiz wrote:
> > Thanks to both.  That was my understanding, but then I run into a
> > problem with the java language. If I declare the rowId variable as
> > local in the onOptionsItemSelected() then the compiler complains that:
> > "local variable rowId is accessed from within inner class; needs to be
> > declared final".
> > And declaring it as a class variable seems like an overkill to me.
>
> As the error message says, declare it final:
>
> final long rowId=getSelectedItemId();
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> Warescription: All titles, revisions, & ebook formats, just $35/year
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

Adding on mark comments, I should say that the behaviour is not the
same with an ExpandableListActivity using getSelectedId().

Best regards,

  Jorge

On Sep 6, 9:37 pm, Jorge D Ortiz <[EMAIL PROTECTED]> wrote:
> Thanks to both.  That was my understanding, but then I run into a
> problem with the java language. If I declare the rowId variable as
> local in the onOptionsItemSelected() then the compiler complains that:
> "local variable rowId is accessed from within inner class; needs to be
> declared final".
> And declaring it as a class variable seems like an overkill to me.
>
> Best regards,
>
>   Jorge
>
> On Sep 6, 8:45 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
>
> > > When you open the AlertDialog, the row in the ListActivity is no longer
> > > selected. I'd argue this is a bug -- opening a dialog should not affect
> > > the state of the underlying activity -- but there might be a good reason
> > > the Android team did it this way.
>
> > It is not a bug. There is only one selection/focused widget on screen
> > at a time. Opening a dialog makes the underlying window loses the
> > focus, and when a window doesn't have focus, it does not contain any
> > selection or focused widget.
>
> > --
> > Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

Thanks to both.  That was my understanding, but then I run into a
problem with the java language. If I declare the rowId variable as
local in the onOptionsItemSelected() then the compiler complains that:
"local variable rowId is accessed from within inner class; needs to be
declared final".
And declaring it as a class variable seems like an overkill to me.

Best regards,

  Jorge

On Sep 6, 8:45 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
> > When you open the AlertDialog, the row in the ListActivity is no longer
> > selected. I'd argue this is a bug -- opening a dialog should not affect
> > the state of the underlying activity -- but there might be a good reason
> > the Android team did it this way.
>
> It is not a bug. There is only one selection/focused widget on screen
> at a time. Opening a dialog makes the underlying window loses the
> focus, and when a window doesn't have focus, it does not contain any
> selection or focused widget.
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] ListActivity getSelectedItemId() and AlertDialog()

2008-09-06 Thread Jorge D Ortiz

Hi all,

  I have a problem when using getSeletedItemId() for a ListActivity.
The code should do something like this:
1. User selects one row of the list.
2. User invokes the menu option "Delete row".
3. onOptionsItemSelected() handles that case and asks for
confirmation:

case MENU_ID_DEL:
// Delete row
rowId = getSelectedItemId();
if (rowId >= 0) {
Log.i(TAG, "Deleting row: " + rowId);
AlertDialog ad = new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(R.string.confirm_delete)
.setPositiveButton(R.string.yes, new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int 
whichButton) {
// User clicked Yes so delete the contexts.
deleteSelectedRow();
}
})
.setNegativeButton(R.string.no, new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int 
whichButton) {
// User clicked No so don't delete (do nothing).
}
})
.show();
}
return true;

  It is unexpected to me that when calling getSelectedItemId() from
deleteSelectedRow() it returns -9223372036854775808.
  However if I use this code instead it works fine:
case MENU_ID_DEL:
// Delete row
   deleteSelectedRow();
return true;

  Any ideas of my mistake?

  BTW, isn't it inconsistent to have a getSelectedItemId() for the
ListActivity and getSelectedId() for the ExpandableListActivity?

  Thank you for your responses.

  Best regards,

   Jorge
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: 0.9 and simple database management issue ? [SOLVED]

2008-09-02 Thread Jorge D Ortiz

emulator -wipe-data solved it. Thanks.

  Jorge

On Sep 2, 7:18 pm, Jorge D Ortiz <[EMAIL PROTECTED]> wrote:
> Hi,
>
>   I am having the same problem here. It is the getWritableDatabase()
> that fails showing the following error:
> sqlite3_open_v2("/data/data/com.powwau.gtd.android/databases/gtd",
> &handle, 6, NULL) failed
>   I have been porting my app from m5 to 0.9 and followed the Notepad
> tutorial.
>
>   Any ideas? Thanks.
>
>   Jorge
>
> On Aug 21, 8:07 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > You shouldn't have to change the database directory permissions
> > manually...getWritableDatabase() should do that for you.
> > Infact that is what it does in the Notepad tutorial. I don't see the create
> > database script being executed from your DBHelper.onCreate() method.
> > Is this database being created in the same app that you are using it from?
>
> > On Thu, Aug 21, 2008 at 2:31 AM, 6real <[EMAIL PROTECTED]> wrote:
>
> > > Actually the issu was ...; in the rights attributed to the databases
> > > directory !!!
>
> > > I have changed the right thanks to a chmod 777 and now it works fine !
>
> > > I don't understand which user is used when laucnhing the app but my
> > > issu is solved. I hope I wont have the same issu on final telephone !
>
> > > 6real wrote:
> > > > Still not work :-(
>
> > > > I have changes the method to copy the tutorial.
> > > > Actually it seems the onCreate method is never called, even when I
> > > > call getWritable or getReadable !
>
> > > > I saw this behaviour thanks to breakpoints in debug mode.
>
> > > > Nobody as such issues ?
>
> > > > On Aug 21, 9:17 am, 6real <[EMAIL PROTECTED]> wrote:
> > > > > Thanks!
>
> > > > > I am gonna watch. I didn't know that.
>
> > > > > Rgds
>
> > > > > C.
>
> > > > > On Aug 20, 11:43 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > > > > Can you compare your code against the NotePad tutorial and see ,
> > > NotePad
> > > > > > tutorial uses SQliteOpenHelper...
>
> > > > > > On Wed, Aug 20, 2008 at 11:10 AM, 6real <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > > > > Dear all,
>
> > > > > > > I am facing an issue (probably simple to solve!) while migrating 
> > > > > > > my
> > > > > > > app under the last 0.9.
>
> > > > > > > Before I was creating and then opening a database.
>
> > > > > > > In teh doc I read I saw that now I need to create a class that
> > > > > > > inheriths from SQLiteOpenHelper.
>
> > > > > > > This is what I have done (anonymous class inside a new one) :
> > > > > > > --
> > > > > > > class MyDBHelper extends SQLiteOpenHelper {
>
> > > > > > > public MyDBHelper(Context context, String name,
> > > CursorFactory
> > > > > > > factory, int version) {
> > > > > > > super(context, name, factory, version);
> > > > > > > }
>
> > > > > > > public void onCreate(SQLiteDatabase db) {
> > > > > > > return;
> > > > > > > }
>
> > > > > > > public void onUpgrade(SQLiteDatabase db, int oldVersion, int
> > > > > > > newVersion) {
> > > > > > > return;
> > > > > > > }
>
> > > > > > > }
>
> > > > > > > 
>
> > > > > > > Then I instanciate this class
>
> > > > > > > dbHelper = new MyDBHelper(launched, Constant.DB_DATABASE_NAME,
> > > null,
> > > > > > > Constant.DB_VERSION);
>
> > > > > > > -
>
> > > > > > > Now comes the issue, I'd like to execute a SQL request to my DB :
> > > > > > > myDB = dbHelper.getWritableDatabase();
> > > > > > > myDB.execSQL("DELETE FROM " + Constant.DB_TABLE_STATIONS
> > > +
> > > > > > > " WHERE " + Constant.DB_FIELD_S_NETWORK + "='" + network + "';");
>
> > > > > > > And I have this error ?
>
> > > > > > > 08-20 18:07:41.119: ERROR/Database(172):
> > > sqlite3_open_v2("/data/data/
> > > > > > > com.xirgonium.android/databases/myDB", &handle, 6, NULL) failed
>
> > > > > > > --
>
> > > > > > > Do you have an idea of the origin ??
>
> > > > > > > Thanks a lot for your help !
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: 0.9 and simple database management issue ? [SOLVED]

2008-09-02 Thread Jorge D Ortiz

Hi,

  I am having the same problem here. It is the getWritableDatabase()
that fails showing the following error:
sqlite3_open_v2("/data/data/com.powwau.gtd.android/databases/gtd",
&handle, 6, NULL) failed
  I have been porting my app from m5 to 0.9 and followed the Notepad
tutorial.

  Any ideas? Thanks.

  Jorge

On Aug 21, 8:07 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> You shouldn't have to change the database directory permissions
> manually...getWritableDatabase() should do that for you.
> Infact that is what it does in the Notepad tutorial. I don't see the create
> database script being executed from your DBHelper.onCreate() method.
> Is this database being created in the same app that you are using it from?
>
> On Thu, Aug 21, 2008 at 2:31 AM, 6real <[EMAIL PROTECTED]> wrote:
>
> > Actually the issu was ...; in the rights attributed to the databases
> > directory !!!
>
> > I have changed the right thanks to a chmod 777 and now it works fine !
>
> > I don't understand which user is used when laucnhing the app but my
> > issu is solved. I hope I wont have the same issu on final telephone !
>
> > 6real wrote:
> > > Still not work :-(
>
> > > I have changes the method to copy the tutorial.
> > > Actually it seems the onCreate method is never called, even when I
> > > call getWritable or getReadable !
>
> > > I saw this behaviour thanks to breakpoints in debug mode.
>
> > > Nobody as such issues ?
>
> > > On Aug 21, 9:17 am, 6real <[EMAIL PROTECTED]> wrote:
> > > > Thanks!
>
> > > > I am gonna watch. I didn't know that.
>
> > > > Rgds
>
> > > > C.
>
> > > > On Aug 20, 11:43 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > > > Can you compare your code against the NotePad tutorial and see ,
> > NotePad
> > > > > tutorial uses SQliteOpenHelper...
>
> > > > > On Wed, Aug 20, 2008 at 11:10 AM, 6real <[EMAIL PROTECTED]>
> > wrote:
>
> > > > > > Dear all,
>
> > > > > > I am facing an issue (probably simple to solve!) while migrating my
> > > > > > app under the last 0.9.
>
> > > > > > Before I was creating and then opening a database.
>
> > > > > > In teh doc I read I saw that now I need to create a class that
> > > > > > inheriths from SQLiteOpenHelper.
>
> > > > > > This is what I have done (anonymous class inside a new one) :
> > > > > > --
> > > > > > class MyDBHelper extends SQLiteOpenHelper {
>
> > > > > > public MyDBHelper(Context context, String name,
> > CursorFactory
> > > > > > factory, int version) {
> > > > > > super(context, name, factory, version);
> > > > > > }
>
> > > > > > public void onCreate(SQLiteDatabase db) {
> > > > > > return;
> > > > > > }
>
> > > > > > public void onUpgrade(SQLiteDatabase db, int oldVersion, int
> > > > > > newVersion) {
> > > > > > return;
> > > > > > }
>
> > > > > > }
>
> > > > > > 
>
> > > > > > Then I instanciate this class
>
> > > > > > dbHelper = new MyDBHelper(launched, Constant.DB_DATABASE_NAME,
> > null,
> > > > > > Constant.DB_VERSION);
>
> > > > > > -
>
> > > > > > Now comes the issue, I'd like to execute a SQL request to my DB :
> > > > > > myDB = dbHelper.getWritableDatabase();
> > > > > > myDB.execSQL("DELETE FROM " + Constant.DB_TABLE_STATIONS
> > +
> > > > > > " WHERE " + Constant.DB_FIELD_S_NETWORK + "='" + network + "';");
>
> > > > > > And I have this error ?
>
> > > > > > 08-20 18:07:41.119: ERROR/Database(172):
> > sqlite3_open_v2("/data/data/
> > > > > > com.xirgonium.android/databases/myDB", &handle, 6, NULL) failed
>
> > > > > > --
>
> > > > > > Do you have an idea of the origin ??
>
> > > > > > Thanks a lot for your help !
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---