amake / orgro

An Org Mode file viewer for iOS and Android
https://orgro.org
GNU General Public License v3.0
452 stars 21 forks source link

Android: Change Filepicker #46

Closed AlessandroW closed 3 years ago

AlessandroW commented 3 years ago

Is it possible to change the filepicker when clicking on +? The stock filepicker is not the best one for finding .org files.

Edit: Related to https://github.com/amake/orgro/issues/18

On a sidenote: The drawback of a filepicker in general is that you cannot see the #+TITLE when searching. This makes searching for a file much more cumbersome compared to searching by document title, e.g. implemented in org-roam as org-roam-find-file

I would like to contribute to this project but I have some troubles setting up Android Studio + Flutter + Emulator, especially performance wise. Do you have any resources/advice to make it easier?

amake commented 3 years ago

Is it possible to change the filepicker when clicking on +?

I don't think so. The file picker is the system one. As far as I know, there are not multiple system file pickers to choose from. We can't make our own, because by definition we would not have permission to see the filesystem.

On a sidenote: The drawback of a filepicker in general is that you cannot see the #+TITLE when searching.

This will probably never happen with the system file picker because the file would need to be parsed in order to show you the title, and the system will probably never have a built-in Org Mode parser.

This makes searching for a file much more cumbersome compared to searching by document title, e.g. implemented in org-roam as org-roam-find-file

Searching unopened files is possible, assuming the app has been given directory access permission. But I am not currently planning to work on such a thing.

I would like to contribute to this project but I have some troubles setting up Android Studio + Flutter + Emulator, especially performance wise.

Do I understand that you have everything working, it's just slow? For that I can only recommend either

AlessandroW commented 3 years ago

I don't think so. The file picker is the system one.

I see, so I need to differentiate between the file picker and a file manager.

Searching unopened files is possible, assuming the app has been given directory access permission. But I am not currently planning to work on such a thing.

Then this sounds like a thing I could tackle. I'll have a look.

Do I understand that you have everything working, it's just slow? For that I can only recommend either

Yes, it just really slow. I checked again and it should work on my Ryzen 5 2600 with 16 GB RAM, so I'll have a look at the Android Developer docs. Thanks!

amake commented 3 years ago

Then this sounds like a thing I could tackle. I'll have a look.

I think it's a pretty big task: not only the actual searching itself (which will have to take place on the native side) but also how to present such a feature in the UI. I suggest the following steps:

  1. Investigating feasibility. This is mostly figuring out what kind of implementation will be needed. Pretty deep knowledge of Dart, iOS, and Android will be required.
  2. Based on your investigation, make a proposal for discussion. This should include UI mockups, as it will be a very big change to the existing UI.

I should also say that in order to continue publishing on the App Store I will require copyright assignment of any code contributions to myself.

AlessandroW commented 3 years ago

Oh wow. Thanks for the effort estimate and putting that into perspective. Then I suggest as next steps:

If we see that it is feasible we can solve the copyright assignment. As long as the project is open source, I don't see a problem from my side with the assignment.

bradyt commented 3 years ago

I have seen mobile development on a PC with only 4 gigs of RAM, and it was a little awkward. To avoid OS-level freezes and crashes, you can avoid having a browser, IDE and emulator open. Even with a text editor and terminals open, you'll want to check how many Dart processes you have explicitly or implicitly spawned, each might be using a few hundred megs of RAM. If there are occasions where you really need to use an IDE and emulator, you can consider quitting out your browser until you're done with that task.

Using software to monitor which apps or processes are using the most RAM may also help find contributors to the issue.

amake commented 3 years ago

With 16GB things should be tolerable assuming you don't have tons of other things running.

I did just realize that there's an important point I forgot to mention: be sure to use an x86 system image for your AVD, not an ARM one. That really is night-and-day in terms of speed.

amake commented 3 years ago

I would like to close this ticket because changing the file picker is not feasible.

Taking a second look at your other item:

This makes searching for a file much more cumbersome compared to searching by document title, e.g. implemented in org-roam as org-roam-find-file

Searching unopened files is possible, assuming the app has been given directory access permission. But I am not currently planning to work on such a thing.

I'm a bit confused: are you interested in searching for files, or searching in files? Because those are probably quite different.

Could you open a new ticket explaining your proposal in more detail?

AlessandroW commented 3 years ago

I would like to close this ticket because changing the file picker is not feasible.

I agree, and I wanted to suggest the same.

I'm a bit confused: are you interested in searching for files, or searching in files? Because those are probably quite different.

Searching for files by their +TITLE property instead of their filename. I will create a new Issue.