Accessing media and pdf files stored in the subdirectory of TW folder in android

I have some local media files like images and pdf in a sub directory of my single file html TW folder. These files are embedded in the wiki as external files.

I can access them in both windows and Mac desktops since the wiki folder is in a onedrive folder. Is there a way to acces them in mobile devices also. I use tiddloid to access the TW files stored in the onedrive folder and it sync well to be accessed both in desktop and mobile. But I am unable to access those media files in android while using tiddloid app.
Anyone has prior experience in local media access in android?

1 Like

I believe Tiddloid imports the wiki. So the relative path isn’t applicable. You could experiment by applying the full, long unix-style path to the image. You can see the long path to the TW on the Tiddloid launch page (long press). You have to then type that perfectly including case in front of the current image file path.

If it works, it’s fairly easy to set up a button that will allow you to change the path of the image files depending on environment (I do this when using TiddlyHost vs. local file).

The fullpath is so long that it’s not that easy to type.

Is there any other option of accessing local files in android other than tiddloid. How about using Node js in android?

Right, it’s not that easy to type. Which is why you come up with tools for changing the path for you. But first of all, did it work when you made the change?

If you run node on Android using Termux or something, then it should be able to serve up files out of a ‘files’ subdirectory. It has to be ‘files’ or its subdirectories. I found running Termux was unreliable because Android kept seeing Termux as an application doing nothing and reclaiming the memory, but maybe someone with more memory will have a better experience.

I installed SimpleHttpServer on my Android tablet (the only Android device I own). It enabled me to serve up multiple TW solutions right on my tablet. My TW projects all reference external image and pdf files using relative paths.

2 Likes

I too, would like to find a good solution to Tiddloid access to local media files in Android. Tiddloid almost does everything i need.

I tried Tiddloid in Legacy mode (1). It does show local image files (relative and absolute path) but not pdf files. Also, images are displayed up to the screen size and cannot be pinch-zoom further, unlike in mobile Chrome browser, which severely limit what I can view in the images on small mobile screen. I can’t get Tiddloid to launch another app to view images (and pdf files).

(1) My understanding of Tiddloid default non-Legacy mode is it uses Android Storage Access Framework (https://github.com/donmor/Tiddloid) which imports the entire file directory into its own cache. That seems to require a long setup time to import my directory (with large number of images) initially and it’s not clear to me how it sync its cache (if it does) with the file directory subsequently.

I will have to next investigate using Android WebDav or http server to serve local media files. Not sure what limitations I will run into :frowning:

FWIW, for Android, TW5 on mobile Chrome browser can access local image files (images can be zoomed too!). TW5 files themselves need to be in Chrome Download directory but Chrome now permits access to image files elsewhere in local storage (not for pdf though! pdf needs to be within the Chrome Download directory) . So the catch is having to store TW5 files (and pdf files) in Chrome Download directory and the multiple saved file versioning issue. Mobile Chrome browser don’t support browser plugin while mobile Firefox browser don’t open local TW5 (html) files altogether :confounded:

PS: Edited for clarity

1 Like

Some of the information in this thread may be of interest:

1 Like

Thanks to Saqimtiaz I now have videos playing in Tiddlywiki on Android via RCX.
I would recommend this - it is very simple and seems be the simplest server that could do the job - no hassles I was up and running in minutes after downloading the app.

I found over a long period of time that many solutions posted online that attempted to find the correct file path on Android did not work on all phones - I believe what we are looking at here is a security feature that varies from Android installation on one make of phone to Android installation on a different make of phone. If you want a long term solution that can travel with you when you next change phone then the server route seems to be the way to go and RCX seems to be a very low impact, low hassle minimal solution tailored perfectly for the job.

2 Likes

Thank you @saqimtiaz
I had already installed RCX in my phone when I saw the discussion you linked before. But today only I learned to use it properly.

I used RCX to serve my onedrive folder of TW files and it’s was able to access the local images which were embedded in the wiki. Accessing local pdf is still a problem. When I click on the pdf link, it tries to download pdf file and a download dialogue box pops up to select the download location.

Also how does saving TW file works with RCX. When I tried to save the wiki, again the download dialogue box pops up to select the download location.

Can to provide a screenshot of the app you use. When I searched in palystore for simplehttpserver, there were a few apps with similar name in the search results.

1 Like

Does this help?

I tried using this app…but it was showing not found message when I tried to load the TW file

Now I figured out how saving works with RCX. No need to click the save button.

This is still a problem

Do you know for sure that your chosen Android browser can view PDF files inline ?

That must be the problem. Is there any workarounds ?
Saw this article Open PDF files directly in Chrome for Android - Android Enthusiasts Stack Exchange

I think its ok if I am not able to open pdfs in mobile from the TW file.

Wondering how @clsturgeon was able to do it ?

Did a quick test of RCX. Indeed, it works with minimal fuss :slight_smile:

Opening of pdf with RCX needs further exploration, perhaps somebody can advise:

a. Using mobile Firefox browser, pdf can be opened with long press on pdf link → Open link in external app → select “Drive PDF viewer” (i.e. Google Drive). Short tap on pdf link or selecting other PDF viewer will download the PDF instead.

b. Using mobile Chrome browser, pdf can be opened once directly with a short tap on pdf link. Chrome silently downloaded that pdf and opened it with “Google PDF viewer”. Once that pdf is downloaded in Chrome Download directory, subsequent tap on pdf link will prompt to download the pdf with a non-colliding name. If you delete the downloaded pdf in Chrome Download directory, short tap on pdf link will directly open the pdf again without further prompt. Long press on pdf link offers a “Preview page” option (which failed with “Preview page content is not viewable”) but no “Open link in external app” option.

c. “Google PDF viewer” and “Drive PDF viewer” came about on my phone from earlier exploration with TW5 and pdf files. I can’t recall exactly how they were installed.

RCX definitely works- it easily loads the local images in subdirectory of my wiki. I just had some doubts regarding the time taken for syncing to the onedrive folder.

Using Firefox seem like a better option I think from my short testing. It will allow to open the pdf in an external app or in the Google/drive pdf viewer.

Why I am so much interested in viewing pdf is bcos I have created a tiddlyclip configuration to open a specific page in the pdf on clicking the link attached to the clipped text based on this code
https://kookma.github.io/TW-Scripts/#demo%2Fexmp026%2Flink-pdf-use-tiddlerpath

This works well in desktop. I guess it won’t be possible in mobile.

I have not reviewed this recently. I recall having been unable to open pdf files in the browser with Chrome, Firefox, and Opera. The best I came up was using Samsung Browser. It provided an option to open the pdf in the viewer.

I tested SimpleHttpServer on Android as well. It simply works, like RCX :slight_smile: The behavior of mobile Firefox browser and mobile Chrome on PDF document with SimpleHttpServer are similiar to that with RCX. SimpleHttpServer is much smaller though and I suspect runs with less overhead than RCX. However, I will stick with RCX simply because it can run on localhost internally on the phone without sharing files on the phone’s wifi/mobile network. My usage of TW5 is local within the phone anyway. SimpleHttpServer defaults to the phone’s wifi/mobile network on port 12345. For info.

2 Likes

Hi everyone,
I am us going RCX in my android phone to serve my TW files saved in a one drive folder over WebDAV server. There some pdf files and images in the subdirectory of the TW file. I am embedding the pdf file in tiddlers using _canonical_uri field with relative path of the file. It works in desktop and opens the pdf. But not in mobile broswers (tried both chrome and Firefox). Tiddler shows a message- plug in not supported -in chrome. Tiddler is blank in Firefox. Any suggestions?