Userdictionry in Android

Source: Internet
Author: User

About Android. process. acore
Android. process. acore often reports exceptions. I started the android2.3.3 simulator and looked at logcat. The Android. process. acore process contains the following contentprovider:
Com. Android. providers. Contacts. socialprovider
Com. Android. providers. Applications. applicationsprovider
Com. Android. providers. Contacts. contactsprovider
Com. Android. providers. Contacts. calllogprovider
Com. Android. providers. userdictionary. userdictionaryprovider
Check that androidmanifest. xml of these APK files has the following attributes: Android: Process = "android. process. acore ". It seems that as long as one of the above contentproviders fails, the entire process will be affected.

About backupmanagerservice
There is a backupmanagerservice in the system, which is mainly responsible for putting application data up to the server. When a user needs to recover data one day, then, the user data is handed down from the server to each application. Backupmanagerservice has a set up cycle. Which APK has data for the backup/restore service like above, you only need to add this attribute to the application tag of androidmanifest. xml: Android: backupagent = "dictionarybackupagent ". Attribute values are specific classes that implement functions. For example, the dictionarybackupagent of userdictionaryprovider and latinimebackupagent of latinime. In this way, when the system's backupmanagerservice reaches the set cycle and data synchronization is required, the interface in the backupagent subclass will be called.
The androidmanifest. xml attributes related to backupmanagerservice include Android: allowclearuserdata, Android: killafterrestore, and so on.

About userdictionaryprovider
Userdictionaryprovider stores three fields: workd, frequency, and locale. That is, the frequency and language of a word are mainly related to the input method. For example, if you want to use more words in the input method, you can add them to userdictionaryprovider. You can also retrieve data from userdictionaryprovider when a user inputs a word. In addition, userdictionaryprovider implements a backupagent for data backup/restore.
Add data to userdictionaryprovider. Currently, I have discovered two methods: set-> language and keyboard-> user dictionary. You can add data manually here. The other is to use the English input method that comes with Android. When you long press an alternative word on the alternative word list, the program will add this alternative word to userdictionaryprovider. As for the Chinese Input Method, neither sogou nor Google pinyin has found any functions related to userdictionaryprovider. Sogou has its own dictionary synchronization function, but it does not use the userdictionaryprovider dictionary.
In addition, the method for accessing userdictionaryprovider is not only the traditional contentprovider method, but also provides some access interfaces in the Android. provider. userdictionary of the framework layer.

Shield The userdictionaryprovider Function
Two solutions: 1. Retain the add, delete, modify, and query interface in userdictionaryprovider, But remove the implementation in the interface. Why not remove it? Because the framework provides the application with an API to access userdictionaryprovider. 2. When using the android English input method, do not allow the android English input method to access userdictionaryprovider (modify/packages/APP/latinime /.. /userdictionary. java file ).
Remove the Android: backupagent attribute from the androidmanifest. xml file in the latinime source code.
In this way, after manually adding a dictionary to the setup program, latinime will never display the words in the dictionary as alternative words.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.