简体   繁体   English

连接手机并单击按钮执行操作

[英]connect mobiles and perform action on click of a button

I developed an small App in which on a click of a button , Emojis Starts Falling on you Screen.I want to install the app in two mobile of user 1 and user 2 .我开发了一个小应用程序,点击一个按钮,表情符号开始落在你的屏幕上。我想在用户 1 和用户 2 的两个手机上安装该应用程序。

I want that When user1 Presses the button on his mobile then Emojis start falling in user2 Mobile using the above app if and only if the above app is opened on user2 mobile...How Can I Connect user 1 Mobile to user 2 Mobile.我希望当用户 1 按下他手机上的按钮时,当且仅当在用户 2 移动设备上打开上述应用程序时,表情符号才开始使用上述应用程序落入用户 2 移动设备中……我如何将用户 1 移动设备连接到用户 2 移动设备。

How can I Achieve this design.我怎样才能实现这个设计。

I will give you Idea on how you should achieve this.我会给你关于你应该如何实现这一目标的想法。 You might have Idea on Google cloud messaging/Fire base cloud messaging.您可能对 Google 云消息传递/Fire base 云消息传递有想法。 You must register both the users to FCM, and you should send a message (through FCM)from user 1 to the registered TOken generated by user 2. When you receive a message through FCM in user 2, This is a call to do yourEmoji falling animation.您必须将两个用户都注册到 FCM,并且您应该从用户 1 向用户 2 生成的注册令牌发送消息(通过 FCM)。当您在用户 2 中通过 FCM 收到消息时,这是一个调用你的表情符号下降动画片。 If you want to know more about FCM如果您想了解更多关于 FCM

https://firebase.google.com/docs/cloud-messaging/ https://firebase.google.com/docs/cloud-messaging/

Or one more concept would be multiplayer concept in Google game play services.或者另一个概念是 Google 游戏服务中的多人游戏概念。 You can know more about it https://developers.google.com/games/services/android/realtimeMultiplayer您可以了解更多信息https://developers.google.com/games/services/android/realtimeMultiplayer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM