Android:当用户下载文件(从浏览器或从电子邮件或其他来源形式)时如何截取 [英] Android: how do I intercept when the user downloads a file (from the browser or from the email or form other source)

查看:122
本文介绍了Android:当用户下载文件(从浏览器或从电子邮件或其他来源形式)时如何截取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如上一个问题所述,这可能是指向正确的方向,

As posted in a previous question, that possibly is pointing me in the right direction,

我需要拦截用户下载文件的事件(从浏览器,形成电子邮件..),以便我可以推荐用户并将文件保存在我的应用程序中定义的文件夹中。

I need to intercept the event of the user downloading a file (from the browser, form the email..) so that I can propmpt the user and save the file in a folder defined in my app.

而且,我需要反复拦截用户将文件上传到网页的事件,以便我可以让他从我应用程序中定义的文件夹中选择文件。

And, viceversa I need to be able to intercept the event of the user uploading a file into a webpage, so that I can offer him to select the file from the folder defined in my app.

如果有人可以指向我正确的方向我真的很感激!

If somebody could point me in the right direction I would really be grateful!

如果有任何开源解决方案已经可用,这将是非常有用的。

If there is any open source solution already available that would be very useful as well.

推荐答案

我发现这个链接:拦截浏览器中的链接打开我的Android应用程序

你可以拦截链接,如在th答案。一旦获得了链接,由你决定如何通过代码处理它。如果要将自己的应用程序下载到您想要的文件夹,可以使用以下代码:

You can intercept the link like explained in the answer. Once you've got the link, it is up to you how to handle it through code. If you want to download it with your own applications to a folder you desire, you can use following codes:

从远程服务器下载Android中的文件

如何将文件/图像从url下载到您的设备

我希望这些可以帮助您。

I hope these will help you.

这篇关于Android:当用户下载文件(从浏览器或从电子邮件或其他来源形式)时如何截取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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