drh47606 2014-12-19 03:52
浏览 63
已采纳

使用WebApp与Android通信 - 通过php接收订单

I have to make an application that receives commands from a website and therefore perform an action.

I thought about creating a login in android to send the username and password for POST and if this is correct, the web server will return a unique token. That would serve me later to send information to the server and ensure authentication...

But ... how can my android application know when the website has a warrant for?

I've thought about that all the time is pending a URL "checkOrders" and if it finds your token, request orders to another URL

Anybody know other method to make it?

  • 写回答

1条回答 默认 最新

  • dougaimian1143 2014-12-19 04:10
    关注

    If I understood your question correctly, the only (battery and otherwise) efficient way is using push notifications. Unfortunately, this approach is not even close to being simple.

    Since you're developing an Android application, you may want to consider Google Cloud Messaging and Parse Push. If you're planing on developing apps for iOS and Windows phones in the future, I'd strongly recommend Parse Push. At the moment, it's free for up to one million users.

    Hyperlink for GCM will lead you to generally useful reading on this topic. That's why I am not elaborating here.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部