make a purchase, every address that items are shipped to, and the GPS metadata of every picture that is
uploaded to the internet. They build a profile of a user's age, gender, marital status, address, political affiliations,
religious affiliations, family circumstance, number of pets, and everything else they can get their hands on.
- They even buy up databases of credit card usage at stores, so they can track the off-line purchasing patterns of the users
+ They even buy up databases of credit card usage at local stores, so they can track the off-line purchasing patterns of the users
in their profiles. Because they already have much more accurate address information about a user than an IP address discloses,
Tor provides no real privacy protection against mega corporations.</p>
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
+import android.net.Uri;
import android.os.Bundle;
// `android.support.v7.app.AlertDialog` uses more of the horizontal screen real estate versus `android.app.AlertDialog's` smaller width.
import android.support.v7.app.AlertDialog;
// Create `argumentsBundle`.
Bundle argumentsBundle = new Bundle();
- // If `contentDisposition` is empty, use Android's standard string of `downloadfile.bin`.
String fileNameString;
- if (contentDisposition.isEmpty()) {
- fileNameString = "downloadfile.bin";
- } else {
- // Extract `fileNameString` from `contentDisposition` using the substring beginning after `filename="` and ending one character before the end of `contentDisposition`.
+ if (contentDisposition.isEmpty()) { // If `contentDisposition` is empty, use the last path segment of the URL as the file name.
+ Uri downloadUri = Uri.parse(urlString);
+ fileNameString = downloadUri.getLastPathSegment();
+ } else { // Extract `fileNameString` from `contentDisposition` using the substring beginning after `filename="` and ending one character before the end of `contentDisposition`.
fileNameString = contentDisposition.substring(contentDisposition.indexOf("filename=\"") + 10, contentDisposition.length() - 1);
}
// Use `AlertDialog.Builder` to create the `AlertDialog`. `R.style.lightAlertDialog` formats the color of the button text.
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
- dialogBuilder.setTitle(R.string.file_download);
+ dialogBuilder.setTitle(R.string.save_as);
// The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(layoutInflater.inflate(R.layout.download_file_dialog, null));
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
// Show the `DownloadFile` `AlertDialog` and name this instance `@string/download`.
DialogFragment downloadFileDialogFragment = DownloadFile.fromUrl(url, contentDisposition, contentLength);
- downloadFileDialogFragment.show(getFragmentManager(), getResources().getString(R.string.file_download));
+ downloadFileDialogFragment.show(getFragmentManager(), getResources().getString(R.string.download));
}
});
<string name="dom_storage_deleted">DOM Storage deleted</string>
<string name="open_navigation">Open Navigation Drawer</string>
<string name="close_navigation">Close Navigation Drawer</string>
- <string name="file_download">File Download</string>
+ <string name="save_as">Save as</string>
<string name="file_name">File name</string>
<string name="download">Download</string>