Php到Android通讯 [英] Php to Android Communication

查看:125
本文介绍了Php到Android通讯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Android应用程序和1个php应用程序。我想在我的php应用程序(在latop-pc浏览器上)单击按钮时调用android函数。所以基本上PHP到android通信。如何实现?

I have Android app and 1 php application. I want to invoke android function when the button is clicked on my php application (on latop-pc browser). So basically Php to android communication. How to achieve that?

推荐答案

您可能想要探索 Google Cloud Messaging for Android(GCM) [ ^ ]

根据谷歌的文档Google Cloud Messaging for Android(GCM)是一项服务,可帮助开发人员将数据从服务器发送到Android设备上的Android应用程序。
You may want to explore Google Cloud Messaging for Android (GCM)[^]
As per google’s documentation "Google Cloud Messaging for Android (GCM) is a service that helps developers send data from servers to their Android applications on Android devices".


好的,Peter Leow是对的。

或者你可以去观察者模式 [ ^ ]。

如果一个应用程序正在更改其状态,其他将被通知并可以执行操作因此。



-KR
Okay, Peter Leow is right.
Or rather you may go for Observer Pattern[^].
Where, if one application is changing its state, other would be notified and can perform operations accordingly.

-KR


这篇关于Php到Android通讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆