> I've developed an sms application. With the new Hero rom, the app
> doesen't work anymore. It seems as if the database has changed.
>
> I use the following approach to get the data I need:
>
> private String[] mProjection = new String[]
> {"thread_id","address","body","read","date","m_type","type"};
> private Uri mUri = Uri.parse("content://mms-sms/conversations");
>
> Cursor smsCursor= context.getContentResolver().query
> (mUri,mProjection,null, null,"DATE DESC");
>
> This code now suddenly crashes on HTC Hero phones, complaining about
> missing tables (thread_id for instance).
>
> How can I fix this? Where do I get additional information about "new"
> db design? And more generally: How in gods name am I supposed to
> handle different behaviour on different phones when I develop my apps
> on the standard SDK???

Do you have any evidence that the SMS database is part of Android's public
API?

If it is not -- and it does not seem to appear in android.provider, where
the officially-supported providers reside -- then you will run into
problems like this. Any device manufacturer is welcome to replace the
built-in applications, including SMS.

Solving this may not be possible, unless you can do queries with wildcards
on the content provider (never tried that) and can therefore inspect at
least the column names that way. Even then, that implies that you can
learn the schemas for all devices that change the original schema and can
adapt your application to each.

This is not significantly different than building an application that
assumes the existence of Outlook that then crashes when the user only has
Outlook Express, Mozilla Thunderbird, or some other email client.

If there isn't an issue already, you might consider putting an issue in
http://b.android.com, asking for a common SMS store to become part of the
official API (again, assuming it is not official already).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to