How to get http url of downloaded file in android? - android

I am trying to find a way to get http-url of downloaded file in android. Is there anyway to do it ?
I have looked around DownloadManager, but it seems not appropriate for this scenario.
e.g. if we open browser with link : http://www.xyz.com/myapp.apk?param1=abc
and now after downloading and installing apk.
In same application (when it starts) I need to get -> param1=abc.
Any kind of help will be appreciated!
Thanks

Personnaly, I think that the downloaded url is not stored in the .apk file. The apk file is a portable file and can be downloaded from different url addresses and the web browser will not add a metadata to the apk file.

Related

Android: How to get the url of the website downloading my apk file?

Here is the scenario.
I want to deploy my app on some forums with apk file. In this case, I want to get a statistic datas that show me ""How many times the app being downloaded in certain forum.""
So here is my idea, I want to get the download url when the user download the apk file. By analysing the url, I can know exactly which forum the user downloaded the apk file.
Is there any way to do it in the app? Any kind of advice is appreciated~~~

Downloading file from google drive using fileMetadata.getWebContentLink()

I am trying to download a file(it could be any file like image,pdf,text etc) using fileMetadata.getWebContentLink()
when i print this link it shows something like this:
https://drive.google.com/uc?id=0Bw6vr2LNxB3iUFJrTk5oZDljaTA&export=download
When i put this link into my desktop's browser the file is automatically downloaded. but i cant download this into my app.
I used this link to download using new DownloadFileAsync().execute(fileMetadata.getWebContentLink());
When i make the file public to access in my google drive then it works otherwise it doesn't work.
Can anyone know why is this happening and how to fix this??
WebcontentLink only works in browsers.
Here's the steps to download a file in your app as it is stated here
Retrieve the Drive File object and open the file contents. (Content is binary)
Read the content with Input Stream, save it and close it.

Downloading source programatically from github for phonegap

I am new to this forum so please forgive me if I am asking something stupid.
I have a mobile responsive website which is to be ported on mobile devices using PhoneGap. The code of mobile site is on github and I want to download the code from github in order to work in offline mode. This would help in keeping just one version of application on play store which will download content from github if there are any changes on website.
So, is there anyway I can download zip file from github using android APIs?
Thanks for reading.
Regards,
Anjali
This is very much possible. Please see at the link below.
How to download source in ZIP format from GitHub?
You need to use HttpURLConnection in order to download it to the location you want.
Cheers,
Bsengar
The link for the actual zip file is available on GitHub.
It's possible to download a zip file using the HttpURLConnection. You should cache the zip(on SD card for example), and extract it. The code for downloading the zip is shown in this thread:
Android Download Zip to SD card?

Android - Download HTML file from URL

I'm building an app which is supposed to download (and later on) display an html file.
I don't need to worry about supporting files like CSS/JS.
I enqueue the file via its URL (eg. http://www.noodle.com/index.html) to the Android Donwload Manager but the download always fails.
Any ideas how to get the file? Or how to convince the Manager to download it properly?
You can make use of HTTPClient provided by Android to use it
More details on how to save that to file is available at
How do I use the Simple HTTP client in Android?

How to create a private android application download server

What does it take to create a private Android application download server.
Or, at least, is there any documentation about the application loading process for Android?
Doesn't really take anything.
If you want you can put the APK (Android application) files in a public Dropbox if you like and distribute the urls. Similarly you could put the files on a web server. Just think of them as files in the same way you can download pdf files in your Android browser.
You need to have the "unknown sources" box ticked in Settings..Applications
Add file to server and create a download link for that file (plain html) . Add MIME TYPE of APK to your server . Now just browse the link ... And Enjoy !!!

Categories

Resources