Open SagarGiri2104 opened 5 years ago
Hi buddy,
i am facing same problem as it is. i didn't found any solutions on google. I am able to download some tricky codes but and got xml data . but i want to get same file from webview.
@ ashish986 please help me out with tricky code which you used to get xml data.
@ ashish986 Help me out with tricky code which you used to download XML data from https://resident.uidai.gov.in/offline-kyc
hi buddy
yes its a tricky code. but i got solution with help of chrometab. you should use chrometab in place of webview. i tried all webview tricks but unable to download xml uidiai. but when i use chrometab i got actual file and extract code. i hope this information helpful for you.
Regards Ashish
On Thu, Feb 6, 2020 at 3:41 PM rajeevmnnit notifications@github.com wrote:
@ ashish986 Help me out with tricky code which you used to download XML data from https://resident.uidai.gov.in/offline-kyc
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/delight-im/Android-AdvancedWebView/issues/254?email_source=notifications&email_token=AC5EZNBQLNBZDZVP24INNCLRBPO6FA5CNFSM4I3DJZT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK6USQA#issuecomment-582830400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5EZNEKLUOYJUOUUWKL5ZTRBPO6FANCNFSM4I3DJZTQ .
hi buddy
yes its a tricky code. but i got solution with help of chrometab. you should use chrometab in place of webview. i tried all webview tricks but unable to download xml uidiai. but when i use chrometab i got actual file and extract code. i hope this information helpful for you.
On Tue, Jan 21, 2020 at 8:42 PM gouravbansal notifications@github.com wrote:
@ ashish986 please help me out with tricky code which you used to get xml data.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/delight-im/Android-AdvancedWebView/issues/254?email_source=notifications&email_token=AC5EZNF5NZ4NZU7L5BJRYX3Q64GEVA5CNFSM4I3DJZT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJQCK7Y#issuecomment-576726399, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5EZNA26HDMRPI5HHSCTHTQ64GEVANCNFSM4I3DJZTQ .
@ashish986 is this working on devices without chrome..
hi this is working without chrome. but will work on normal web browser.
On Tue, Feb 25, 2020 at 9:58 AM gouravbansal notifications@github.com wrote:
@ashish986 https://github.com/ashish986 is this working on devices without chrome..
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/delight-im/Android-AdvancedWebView/issues/254?email_source=notifications&email_token=AC5EZNDZFEOGGUIWO6MF5ADRESM5VA5CNFSM4I3DJZT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM2QK6A#issuecomment-590677368, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5EZNGI73OYX2KFSWWIOWLRESM5VANCNFSM4I3DJZTQ .
hi 1, what you means by normal web browser.. 2, how you get information of file completely downloaded..
hi
chrometab working with chrome browser. if you want download from default browser u should call programmatically browser.
On Tue, Feb 25, 2020 at 10:48 AM gouravbansal notifications@github.com wrote:
hi 1, what you means by normal web browser.. 2, how you get information of file completely downloaded..
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/delight-im/Android-AdvancedWebView/issues/254?email_source=notifications&email_token=AC5EZNDZKEJNHMWN3TYT76TRESS35A5CNFSM4I3DJZT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM2TDZQ#issuecomment-590688742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5EZNATPM7N4UXTUAGEEV3RESS35ANCNFSM4I3DJZTQ .
@ashish986 Hi Not able to download using chrome tab.. can you share sample code
ok
Uri uri = Uri.parse("https://resident.uidai.gov.in/offline-kyc"); // Intent intent = new Intent(getApplicationContext(), CustomTabReceiver.class); CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder(); CustomTabsIntent customTabsIntent = intentBuilder.build(); intentBuilder.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary)); intentBuilder.setSecondaryToolbarColor(ContextCompat.getColor(this, R.color.colorPrimaryDark));
// set start and exit animations intentBuilder.setStartAnimations(this, android.R.anim.slide_in_left, R.anim.slide_right_out); intentBuilder.setExitAnimations(this, android.R.anim.slide_in_left, android.R.anim.slide_out_right); customTabsIntent.intent.setPackage(CHROME_PACKAGE_NAME); customTabsIntent.launchUrl(MainActivity.this, uri);
On Tue, Feb 25, 2020 at 11:04 AM gouravbansal notifications@github.com wrote:
@ashish986 https://github.com/ashish986 Hi Not able to download using chrome tab.. can you share sample code
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/delight-im/Android-AdvancedWebView/issues/254?email_source=notifications&email_token=AC5EZNDJ742GJ4IAKNCP6SLRESUXHA5CNFSM4I3DJZT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM2UAXA#issuecomment-590692444, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5EZNBQUNGO4QBZKCVQDKDRESUXHANCNFSM4I3DJZTQ .
@ashish986 Hi Ashish. I am trying to implement the same in android and facing the same issue. 1) Is there no other way to do the same in WebView? 2) If using CustomTabsIntent, how to get callback once zip file is downloaded in CustomTabsIntent? Thanks.
@nurul12121 Any workaround you found for this?
@nurul12121 @suvansh19 Did you guy find any work around this?
What do u want code or else?
On Sun 19 Jul, 2020, 8:32 PM Ashutosh Nagar, notifications@github.com wrote:
@nurul12121 https://github.com/nurul12121 @suvansh19 https://github.com/suvansh19 Did you guy find any work around this?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/delight-im/Android-AdvancedWebView/issues/254#issuecomment-660658925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5EZNG7FIG24PO2PZN7PGTR4MDHZANCNFSM4I3DJZTQ .
@ashish986 Actually, corrupt file is getting downloaded through webview, so wanted to know if anyone found solution, if not then how to use custom tabs, never used it..can you pls help
And if you can share code that will be really helpful
its not corrupt file . its download html request file. dont use webview if u want to download use browser open link on browser and get download. or use custom tabs.
On Sun, Jul 19, 2020 at 10:30 PM Ashutosh Nagar notifications@github.com wrote:
@ashish986 https://github.com/ashish986 Actually, corrupt file is getting downloaded through webview, so wanted to know if anyone found solution, if not then how to use custom tabs, never used it..can you pls help
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/delight-im/Android-AdvancedWebView/issues/254#issuecomment-660676359, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5EZNGDJXWU2KBH3JQOKUDR4MREXANCNFSM4I3DJZTQ .
Is that download a HTTP POST download perhaps?
Android’s DownloadManager
is designed to work with downloads that (a) don’t require any cookies and (b) are performed via HTTP GET. Cookie support can be added easily, as can be seen in one of the comments above, but that still leaves us with the restriction to the GET
request method.
If your download requires HTTP POST, you should still be able to use the onDownloadRequested
callback, but not the DownloadManager.Request
instance inside. Just check if the URL passed to that callback is actually valid. If it is, replace the DownloadManager.Request
instance with your own code for a HTTP request that downloads and stores the file from the specified URL.
Does that help?
@ashutoshnagar No.
@ocram Yes, its a POST request. Can you please help me understand in detail or share some link which I can refer. New to coding world.
@ashish986 Can we open browser link on DownloadRequested and download the file and come back on app without user noticing it or can we control the custom tab functionality from app, like we can do for webview?
Use custom tab u can broswe the link as download request and download file the file but u can't back on app cause u cant manage from app request. But u can download the file and extract the zip progrmatically.
On Tue 21 Jul, 2020, 9:16 PM Ashutosh Nagar, notifications@github.com wrote:
@ashish986 https://github.com/ashish986 Can we open browser link on DownloadRequested and download the file and come back on app without user noticing it or can we control the custom tab functionality from app, like we can do for webview?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/delight-im/Android-AdvancedWebView/issues/254#issuecomment-661940830, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5EZNEDEO2DMVLKALVM64TR4WZ5ZANCNFSM4I3DJZTQ .
Thanks @ashish986 for quick reply, can we control the flow through app, just like we do in webview using js because somewhere i had read there is no js bridge between custom tab and app?
At this point I stucked. U heard right no connection between tab and app and also no connection Between broswer and app and for your kind information u can't download zip through webview . U can download only download request page not actual zip file.i am working on this project soon will get success.
On Tue 21 Jul, 2020, 10:05 PM Ashutosh Nagar, notifications@github.com wrote:
Thanks @ashish986 https://github.com/ashish986 for quick reply, can we control the flow through app, just like we do in webview using js because somewhere i had read there is no js bridge between custom tab and app?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/delight-im/Android-AdvancedWebView/issues/254#issuecomment-661968669, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5EZNEBVZJELYWDMHPLNQDR4W7TJANCNFSM4I3DJZTQ .
I would listen to the onDownloadRequested
callback as usual, and instead of using a DownloadManager
instance there, with the url
given, use HttpClient
and HttpPost
as shown here while removing the three (!) lines for HTTP GET from that example so that you actually store the response
(HttpResponse
) of the HTTP POST request.
Does that help?
If your HTTP POST request requires parameters, though, just using the url
from onDownloadRequested
will not be enough. You should go to your desktop computer, open your web browser, open the developer tools and switch to the network tab to check if the download requires parameters.
@ocram It didnt work, it is still downloading a corrupt zip file
Does it need cookies, or a certain referrer header, or the same user-agent string as with the previous requests perhaps?
does anyone got solution for this in flutter ?
Any solution now in web view I also facing this
I am using advance Webview to download .zip file in my app from UIDAI website. But when DownloadListener is getting called It returns the correct data, but downloads it's HTML webpage in that .zip file instead of downloading the actual file. whereas when I try downloading the same zip via chrome. It is downloading the correct zip file. Please help me with this problem. why is this happening in webview on this particular website (https://resident.uidai.gov.in/offline-kyc) whereas with the use of same
onDownloadRequested
function I am able to download files on other websites?My code: