Android - Make a contact not editable on the phone - java

Can someone tell me how to make a contact on a android phone 'non editable', I've seen it done with Facebook contacts but i dont know how to do it my self. Is there a value i have to put with a contact when inserting it into the contacts database? Or a option within the AccountManager?
Thanks in advance... :)
[Edit]
I've found out that the SYnc Provider has to be 'read-only'. Anyone know how to do this?

In your sync adapter's xml file (e.g. syncadapter.xml), define android:supportsUploading="false". This will make the sync adapter "read-only" (i.e. the phone won't be able to upload changes), which is what you are looking for.

Related

capture user asked data from echo

I'm writing a code for Amazon Alexa. And in the developer.amazon.com, we configure the intents, utterances etc... Here I need to get the question asked by the user.
I'm sure that this works using the intents but I will need the utterances. For eg:
GetTheData get me the user data
GetTheData get me user details
Here I'm able to get the GetTheData printed using intent.getName(), But i want to know if there is a way to get the content after the intent name i.e. get me the user data. I want to know this for my research purpose.
Please let me know how can I get this.
Thanks
No, unfortunately there is no way to get this information with the ASK/echo.
Your only solutions at this time would be to split that into one intent per utterance, or switch to google home (its SDK can give you the raw user text).

faceBook auto shows your friends Name while tagging or mensioning

when we add any status in facebook, it auto shows your friends Name, if name is half then it complete, it also gives us place name . HOw? I want to implement in my app like that it will search automatic its name to whose we want to tag after few word. plz help
Use > AutoCompleteTextView
it shows completion suggestions automatically while the user is typing.
Look here
https://github.com/linkedin/Spyglass
read all documentation, every thing is here

Save input user in Edittex

Good morning, I need help,
I´m new using Java in Android development and need to save user input in a textbox without needing a button to trigger it.
Could someone give an example please?
You will need a TextWatcher, since you do not want to trigger a click event
Here! is a good example of TextWatcher control,
once you get families to TextWatcher, you can save your value either in a SharedPreference (Local tiny storage) or in a Databse, Refere This! for storing and retrieving values from SharedPreference

Unable to restore .csv for sms in android

I found this link to back up sms threads with the code given here store csv file for sms but did not find a solution for restoring it back. I tried to use contentprovider to store back each and every value that I am backing up but Could not find it appropriate as its like showing a new incoming message in inbox. Also this type of restoring was not working well. Please help. Thanks.

Update a Raw Contact

I'm trying to update a contact using the 'new' api. i've got the raw contact ID of the contact and the contact is linked to an account, but i cant find anywhere some sample code or working code that i can study and adapt.
Dunno wherever i have to 'query' the contact first for any info? And is the raw contact ID enough to 'update' a Contact?
At the moment I'm using the ContentProviderOperation.newUpdate(Data.CONTENT_URI) Is this the best way? and if so what else do i need to add to add details to the contact?
Also i have read somewhere that you have to use something along the lines of .withSelection(Data.CONTACT_ID = 123... etc but I'm not too sure..
Any help would be brilliant and Thanks in advance!
Take a look at this SO question. It shows how to update the work number using the new API. Sems to do what you want.
How to update contact number using Android

Categories