简体   繁体   English

我如何从WebView获取价值并推送到通知

[英]How I can get value from WebView and push to the notification

I just started to develop for Android recently and don't know much about Java 我最近才刚开始为Android开发,对Java不太了解

My problem is I want show my website on webView , but how I can get a value from my URL and pass it to a notification? 我的问题是我想在webView上显示我的网站,但是如何从URL中获取值并将其传递给通知? With cookie? 有饼干吗? With Session? 与会议? With JSON Url? 使用JSON网址?

For example you will go to www.test.com by your PC and you will see have 5 notification ( Actually this value is saved into a cookie ) , Is there any way that I can get cookie of my website from webView of application and it into a notification of android app ? 例如,您将通过PC前往www.test.com,您将看到5条通知(实际上此值已保存到cookie中),有什么办法可以从应用程序的webView中获取我网站的cookie,进入android应用的通知?

You cannot push that specific cookie from your computer to the Android Phone, or at least it would be really inconvenient. 您不能将特定的Cookie从计算机推送到Android手机,或者至少这样做确实很不方便。

But since you have to build the cookie from data, that data should be available for use buy GCM https://developer.android.com/google/gcm/index.html 但由于您必须根据数据构建Cookie,因此该数据应该可以使用,请购买GCM https://developer.android.com/google/gcm/index.html

Another alternative is to create a scheduled task that visits the website, gets the cookie and displays a notification if necessary. 另一种选择是创建一个计划任务,该任务可以访问网站,获取Cookie并在必要时显示通知。

I must say the question is rather vague, if you could be more specific it would probably help solve your problem! 我必须说这个问题比较模糊,如果您可以更具体一点,那可能会帮助您解决问题!

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

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