I'm looking to make an app that adds a bunch of words to the users dictionary.
I know I can use UserDictionary.Words.AddWords however it is not actually adding the words to the dictionary.
It looks like "WRITE_USER_DICTIONARY" permission was removed in M, is there a different way to add words to a users dictionary or is that completely gone now?
UserDictionary.Words can no longer be accessed from Marshmallow (API 23) onwards.
Reference : Android Issue Tracker - Issue 199199
The user dictionary is now accessible only by the current spellchecker and keyboard. It was heavily abused by apps to scoop user dictionary. Out of the ten top apps using it there wasn't a single legit one. My favorite was the one which used a bug in keyguard to unlock the device after [it] "scans" [your] fingerprint from the screen! This is intended behavior.
Related
There are apps like Texpand which are able to replace text in any EditText view - even of views which are part of other apps. Looking at the app-info this is happening without any requested permissions. I'm scratching my head how this is done - my (rookie) understanding is that each app resides in its own separated sandbox, so it should not have direct access to other apps views?
I looked for possible global events which could be provided by any central manager, but found nothing. More likely I would expect the replacement to be done passively (that means without the app being aware of the actual EditText), but checking for possible bindings or user dictionaries I found nothing promising either.
Looking at my Android system it seems the app is neither using permissions nor installing a keyboard. Additionally I don't see any entries in my user dictionary. Does anybody have an idea how the described functionality could actually be achieved?
Texpand's Google Play posting indicates that it uses Accessibility Services. Accessibility services are a set of APIs Android offers to help build tools to allow non-standard interactions with apps (such as audio descriptions/voice commands) to expand access to the platform to people with an impairment that might otherwise prevent them from using a touch-screen/smart-phone.
These include the ability to take action on the behalf of a user, such as filling in text fields.
I often find myself writing to different people in different languages. Every time I have to switch to the correct language to avoid false auto-correction.
The language only depends on the person I am talking to, that is I will always talk in italian to a, b and c; in english to l and m; in french with x.
Is there a keyboard that keeps track of that, or a way to have it automatically configured when switching contacts?
No
And here is why: the User can set the keyboard in the settings for the phone. Also called input method editor (IME) by google.
As you can see in this developers guide, you can create your own IME.
But the problem is, you need to get the Contact data from the App that you are running (What's App, Telegram, Slack, etc), and unless they support that, what I very much doubt, you will not pull this off.
Maybe, quite hackish.
What might work is that the moment you open your custom IME, it takes a screenshot (not sure it could do that). Use that screenshot to parse out the Contact name. Try to match that with the Accounts on the phone. And use that to set the keyboard... But that is not a Keyboard I would like to have on my phone if it wasn't developed my me!
I am redesigning the search interface for my Android App. I've red Google's API guide (http://developer.android.com/guide/topics/search/search-dialog.html).
The current version of the app uses the classic system search dialog. It lacks autocompletion which I want to provide in the new version.
My requirements in terms of auto-completion: If the query string is less than 3 characters, the app should auto-suggest search results based on the set of stored favorites which are stored locally. If the query consists of at least 3 characters, the search shall be conducted remotely via a search API.
Since historically, the App's minimum API will be level 7, I cannot use Honeycomb's SearchView (API 11+) or ActionBarSherlock SearchView (API 8+). I decided to stick with search dialog provided by the SearchManager.
I've sucessfully implemented all requirements stated above.
Though, one thing reduces the usability.
When the user starts the search, the search dialog gains focus. The desired behaviour is that instantly, all favorites are suggested. Though, this is only true on my HTC Legend running Froyo (2.2). On my Galaxy Nexus, the app most of the times does not instantly show all suggestions. I get callbacks to my SearchProvider not until the user has entered at least one character.
My question: is there a way to instantly show suggestions/get a callback to the SearchProvider across all Android versions starting API 7+?
I've tried different calls to the SearchManager (startSearch()) but with no luck.
I am creating an Android application for a customer which will be pre-installed and distributed together with the handsets. Now the customer asked me to lock down the ROM to prevent the future users from using anything else apart from this one app. I.e. no browsing, no email, nothing which could create any costs etc.
Now after some googling it seems to be relatively straightforward to remove applications from an Android image. But even if I can remove the web browser, email client, the Android Market App etc, how can I make sure that the user will not reinstall those apps via the USB connector? As Android is just Linux I am sure there are ways of denying all users the right to install new applications (or actually denying them pretty much anything apart from using this one app).
If somebody could point me in the right direction it would be much appreciated.
EDIT:
To clarify things a bit, the customer does not want to use the android devices as phones, even though they are phones. With 100€ touch screen phones becoming available, it becomes viable to use those phones for just one specific purpose. In my customers case, the device will be used as something like a POS system: the employee uses the phone to process a certain kind of customer request, and for this the app needs to have a data connection which will accrue costs of course. Now obviously contracts can be set up that will oblige employees to pay any irregular costs themselves, but why make it that complicated?
This is not about taking freedom away from users but rather about using android phones as general purpose touch screen devices with a data connection that employees can use in a business environment without shooting themselves in the foot with unexpected high data connection cost.
There's not really a whole lot you need to do to make a single-purpose device. If you play your cards right, it should be something you can do without having to tinker with the ROM.
The quick-and-easy route would be to deploy your application as a replacement for the stock launcher, just like any of the other home replacements that are available. Setting that as the default would cover most of the opportunities for casual tampering, since it would leave no other way to launch or install anything else. The only other things I can think of off the top of my head that you'd need to do are snag the search button so it doesn't bring up the default Android search box atop your app and the green key so the phone app won't come up.
You would, of course, need a way to get to the original launcher to maintain the device and install new versions of your app. I'd accomplish that using a "Maintenance" menu item somewhere that asks for some form of authentication (e.g., a password), changes the home app back to the original and launches it. When you're done doing what you need to do, set your app as the default launcher and you're back in business.
Edit to address MAINERROR (now Octavian Damiean)'s comment:
Any activity in any application can register itself as a home application by adding an intent filter on the android.intent.category.HOME category. It's literally four lines in the manifest, and you don't have to write any code to support it. Take a look at lines 77-82 in the stock launcher's manifest for an example of how this is done. (Ignore the filters on DEFAULT and MONKEY; they're not necessary.) Once the activity is selected as the default handler for the category, it becomes the first thing launched at boot and what comes up when the Home key is pressed. HTC Sense, aHome, Panda Home, etc. all use this mechanism.
Launching the stock home (or any other application) explicitly is about five lines of code.
Side note: There's a application on the Market called Home Switcher that lets you launch any of the activities filtering on the HOME category or set one as the default.
Unless the handset manufacturer adds a lot of shovelware, the stuff that runs in the background should be inconsequential and won't get in the way.
There was a similar question already somewhere. You can indeed limit the functionality of your device by the amount you want or have to. In order to achieve this you will definitely have to build your own modified ROM.
You will have to touch the ROM because you will have to get rid of several applications running in the background. One you won't need them anyway and two as you don't need them they would only consume resources.
You might want to take a look at http://source.android.com there you will find more information about the sources which will hopefully direct you where you need.
Blrfl's answer is great, but it still has a problem: if the user long presses the HOME button, the recent applications popup will appear an the user will be able to launch another app.
I would like to access the word lists used on android phones for spell checking (not including the user-defined-dictionary).
I am writing an app which i would like to be able to check if a word exists in the current phone users language. I imagine their is some API call or service i can use to access the build in word lists?
Any help would be great, thanks!
From what i know, each IME has its own dictionary and they probably implement their own method of reading from it. I have multiple keyboards installed on my phone, and if I add a word to the standard android keyboard, it still shows up as a miss-spelling if I switch to another keyboard.