문제

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