I would like to ask if it is possible through the use of android codes, to send a request(or data) from one android device to another and having the receiver's android device to display a toast message saying that data/request is received and vibrates the phone?

有帮助吗?

解决方案 2

You would need to have one device be aware of the other (either directly or through a central server). Having that you can use GCM to push messages to the device, and once received, show the Toast and vibrate.

I recommend you use Android notifications rather than Toast and the vibration let it be what the user has configured to avoid being too intrusive.

You can start by reading up on GCM: http://developer.android.com/google/gcm/index.html

其他提示

Depending on what you're trying to do, it might be simpler to send an SMS message from one device to the other, as an alternative to using Google Cloud Messaging.

Info about SMSManager here.
There's a good tutorial on sending SMS messages here.

You could use a custom vibration (more nuanced than the standard Android buzz vibration) using the Immersion UHL, described here, and downloadable from this page.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top