I am using firebase and have an Order-URL with some .pdf-files in it.
Here is an image, which shows it:
I have this code:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_wiki, container, false);
// Inflate the layout for this fragment
WebView webView = (WebView) view.findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
//FireBase Connection
StorageReference mStorageRef;
mStorageRef = FirebaseStorage.getInstance().getReference();
mStorageRef.getDownloadUrl();
String myPdfUrl = "https://firebasestorage.googleapis.com/v0/b/realtime-chat-46f4c.appspot.com/o/documents%2Fbf307aa5-79ae-4532-8128-ee394537b357.pdf?alt=media&token=2d0c5329-4717-4adc-9418-6614913e5bfa";
/* String url = "http://docs.google.com/gview?embedded=true&url=" + myPdfUrl;
webView.loadUrl(url);*/
try {
myPdfUrl = URLEncoder.encode(myPdfUrl,"UTF-8");
webView.loadUrl("https://docs.google.com/gview?embedded=true&url=" + myPdfUrl);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return view;
}
What I want is: - to get all the file-names of the Order-Url in firebase from the link, I show in the image above - Get the url of the download path of each of the file-names in the order
When I just copy the download URL, I can easy add it in code and load the file. But I want it dynamically, means, always, when I add an file in this storage in firebase, it should be detected and added/removed, and so on.
I dont want to change my code all the time, just to add the new download-url of the files.
Does anybody have experience, or idea how to solve it?
Thanks a lot