Android Wear - Retrieve value from Phone - android

I hope someone can help me. I can't seem to find anything that gives me a straight answer or that works.
So basically on my Phone app the user enters their age which I will then save and pass to the Watch.
For now to get it working i'm just using a hardcoded int value.
So what I want the watch to do is when the user enters a certain activity on the watch that it will retrieve this value each time from the phone and be displayed.
Obviously I intend to do more than just display it but if I could get it displaying first it would mean that its being retrieved.
Can anyone help me? Thanks in advance.

Take a look at http://developer.android.com/training/wearables/data-layer/index.html and choose accordingly to your context the appropriate API(s).

In said activity on the watch, implement GoogleApiClient. In the onConnected() method send a message to your phone via Wearable.MessageApi.sendMessage Assuming you want to retrieve this information from the phone while the app is not open on the phone, use a WearableListenerService on the phone to receive the message. Now you have successfully told the phone you want info! Simple gather the info you need while still in the WearableListenerService and send another message back to the watch via Wearable.MessageApi.sendMessage
Let me know if you have any more questions

Related

How to make full screen caller id in android?

I Want to develop Full Screen caller application with Caller details and accept call and ignore button how to achieve this? .I searched a lot but i'm not able to find solution or any reference, so anyone can lead or help me or any reference it would be helpful for me, thanks in advance happy coding.
I'm not going to give you ready-made code even though I could probably dig into my own and do it. You said you searched a lot but if this were true, you'd have found many references to articles and docs such as these.
Get contact data from number
Take control of calls programmatically
Detect incoming calls
Interesting considerations for incoming calls
That should get you started. But it should go someting like this: Register that you want to be notified when incoming calls are received. On that notification you receive launch your own activity that takes control of the calls programmatically (button to dismiss, button to accept?). That screen can show whatever you want, beit the contact information you retrieved from the phone number, a photo, etc.

Initiate a private phone call for both side in Android app

I am building an Android app and want to initiate an anonymous phone call for both caller and receiver.
For example:
User A press 'call User B' button, and then initiate an anonymous phone call to User B. The tricky point is that both User A and B don't know each other's phone number and after the conversation, there is no record left and privacy is protected.
I don't know if native Android can do this. Could anyone give me some clues about this? Thank you very much!
According to the platform source-code there is NO WAY to place a call without the knowledge of the user. The best thing you can do is to make the call automatically but the user will see a dialog saying: "Calling XXXXXXXX" and he will have the chance to cancel it.
Even if you make your own dialer application you will have to sign it with the system key and place it in the system/apps folder in order to get the required permissions for that kind of things.
As for the call log, I don't know if you can make the call not to appear in it in the first place but I think (not sure though) that you can find it and deleted afterwards. Android informs other applications of call actions via Intents so it is relative easy to detect when a call ended and then query the call log.
Hope this helps...

How to hide caller ID info like phone number on receiver side phone replaceing with some text in android?

In my application,I want to make appear some text like "Private Number" on receiver side cell on caller Id instead of phone number,so that receiver should not know the phone number where he/she is getting call from.
I researched a lot, but I couldn't find exact way to do this.
Can anyone help me,I will be thankful.
If You Have Android Phone Then You Must Try This Out:
Go to Settings.
Call settings
Additional settings
Wait until it initializes the options
Caller ID
Hide number
Go back and you're done

save calling cost in file android programmatically

I want to save phone calling cost in text file, when we are calling to any person and after
disconnect, the phone call cost summary shows in front of the mobile with ok button,
i don't know it is possible or not, please tell me that Thanks in advance

Android: How to capture button press event for contact create app of device

I want to invoke my application once user creates / updates contact from his device.
i.e once user hit "Done" button. is it possible ? If possible please provide sample code or link.
Please help and thanks in advance.
I want to invoke my application once
user creates / updates contact from
his device. i.e once user hit "Done"
button. is it possible ?
No, it is not possible, in terms of detecting the GUI event. You can set up a data observer on the Contacts (or ContactsContract) content provider, and attempt to find out those things that way, though I do not know how well that works.

Categories

Resources