User dictionary in Settings

by Jaden Pak » Fri, 20 May 2011 09:34:00 GMT


Sponsored Links
 Hi, all!

I'm developing some test codes for Android Settings(native app).

But I have some difficulties finding out what the real SQLite table is
for User dictionary words.

Does anyone have an idea about this?
In UserDictionary.java (which seems to be a provider class), I can see
only addWord() method.
In order to learn how to insert, update or delete in SQLite table,
which source file should I
check ?

Thanks in advance!

-- 



Re: User dictionary in Settings

by Brill Pappin » Fri, 20 May 2011 12:09:42 GMT


 android.provider.UserDictionary is a simple content provider.
You should be able to query it any way you like. You likely want the
Words content.

You might need to read up on content providers if you are not familiar
with them.
However, remember that the UserDictionary is not just used by your
app, so be careful what you do with it!

- Brill





-- 


Sponsored Links


Other Threads

1. Creation of SMS widget, trying to get next

Hi,
I have wroten a wrong code.
I manage to display the first SMS but not to use my button to go to
next.
I don't manage to keep the words for the pendingIntent and  onRecieve.
this is my code:
public class MySMSwidget extends AppWidgetProvider {
        private int sms_id=0;

        public void  onReceive  (Context  context, Intent  intent){
                if (Intent.ACTION_ATTACH_DATA.equals(intent.getAction()))
                {
                Bundle extra = intent.getExtras();
                sms_id = extra.getInt("Data");
                }
        }

         public void onUpdate(Context context, AppWidgetManager
appWidgetManager, int[] appWidgetIds) {
                 Cursor c = 
context.getContentResolver().query(Uri.parse("content://
sms/inbox"), null, null ,null,null);
                 String body = null;
                String number = null;
                String date = null;
                c.moveToPosition(sms_id);
                   body = 
c.getString(c.getColumnIndexOrThrow("body")).toString();
                   number =
c.getString(c.getColumnIndexOrThrow("address")).toString();
                   date = 
c.getString(c.getColumnIndexOrThrow("date")).toString();
                c.close();

                RemoteViews updateViews = new 
RemoteViews(context.getPackageName(),
             R.layout.widget_layout);

                updateViews.setTextColor(R.id.text, 0xFF000000);
                
updateViews.setTextViewText(R.id.text,date+'\n'+number+'\n'+body);
                ComponentName thisWidget = new ComponentName(context,
MySMSwidget.class);
                appWidgetManager.updateAppWidget(thisWidget, updateViews);


                IntentFilter filter = new IntentFilter();
                filter.addAction(Intent.ACTION_ATTACH_DATA);

                RemoteViews views = new RemoteViews(context.getPackageName(),
R.layout.widget_layout);
        views.setOnClickPendingIntent(R.id.next, changeData(context));

         }
         private PendingIntent changeData(Context context) {
     Intent Next = new Intent();
     Next.putExtra("Data", sms_id+1);
     Next.setAction(Intent.ACTION_ATTACH_DATA);

     return(PendingIntent.getBroadcast(context,
        0, Next, PendingIntent.FLAG_UPDATE_CURRENT));
  }

}
please help!
Just want my button to dysplay next sms!

-- 

2. Android versions

Ok, I'm a bit behind the times here...

I am still developing with version 1.5, level 3.

1) Should I install 2.0 and develop with that? My phone is a Hero with
v1.5.

2) If I do install 2.0, do I need to upgrade the software on my phone?
Will my apps still work?

3) Also, if I do install 2.0, should I install 1.6 first, and then
upgrade to 2.0?


Many thanks for any advice.

-- 

3. Runtime exception involving getActiveNetworkInfo unable to find source code

4. screen Oroentation

5. (TabActivity) How to switch tab from within a "sub" activity

6. (TabActivity) How to switch tab from within a "sub" activity

7. trying to show a progressdialog in a lengthy task