Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to export to SimpleNotes out of other apps #705

Open
ShadyMedic opened this issue Nov 16, 2023 · 13 comments
Open

Ability to export to SimpleNotes out of other apps #705

ShadyMedic opened this issue Nov 16, 2023 · 13 comments

Comments

@ShadyMedic
Copy link

Hi there. First of all, it's quite possible that SimpleNotes already have this feature and my phone just doesn't know, but just in case, I'm posting this.

I miss the ability to create a new note from other apps via the "Share" function. Quick example: I'm searching for a bus connection in iDos, want to keep the result for later, so I click "Share" and get a list of (mostly messaging) apps to send a string describing the desired connection. Between these apps, I see some of the Notes apps I have installed, but not SimpleNotes, which is a pity, as I want to transition to using SimpleNotes only.

@Aga-C
Copy link
Contributor

Aga-C commented Nov 16, 2023

It works on my Android 13 - I see Simple Notes among other apps. Can you provide more details about your phone?

@ShadyMedic
Copy link
Author

I also have Android 13, my phone is Motorola E30. App version is 6.17.0 Pro (from F-droid).

Not sure what other details would be useful, but feel free to ask.

@Aga-C
Copy link
Contributor

Aga-C commented Nov 16, 2023

Maybe it is among other apps and you just haven't noticed it? I don't know what language you use, but for most languages the app name is translated (e.g. in Polish instead of "Simple Notes" I have "Notatki"). Please check by icon and the name in your language.

@ShadyMedic
Copy link
Author

Nope, just double-checked, not there.

If that helps, I was trying to degoogle my phone and uninstall many google-related packages with ADB, but I don't think that is something that could intervine with this, right?

@BreakfastSerial
Copy link

This also works for me already. I believe it also depends what the source app defines as a valid destination for their shared content.
For example, Simple-Notes shows up as a possible destination if I share the URL from Firefox. Can you verify if that works for you?

@ShadyMedic
Copy link
Author

Hello. Yes, I can confirm that Firefox offers this app as a possible target for sharing. The popup that opens in Firefox looks different than what it looks like in the app where it doesn't work though.

How can the developer of the app decide which apps will be available in the share menu? Since I can see some really obscure apps in the app, I believe that the devepopers do not need to specify a list of exact package names that are supported 🤔

@BreakfastSerial
Copy link

BreakfastSerial commented Nov 21, 2023

I am by no means a developer, but I believe this is achieved by the source app, defining an intent and a source MIME Type (e.g. text/plain). The Android base system then offers all target apps, that match these values in their intent-filter. See also https://developer.android.com/guide/components/intents-filters.

So I believe the source app you're attempting to share data from, attempts to send a MIME type that is not registered by Simple-Notes. If you wanted to, that could be easily reverse engineered, by checking the AndroidMainfest.xml of both apps.

But again - I am no developer.

edit: I just checked. I think Simple-Notes has an intent-filter for <data android:mimeType="text/*" />, so any MIME type starting with text/

@ShadyMedic
Copy link
Author

That sounds like how it might actually work. And if it's so, it might be a key to solving this issue.

I don't know what MIME type does the app in question use when I want to share content out of it, but one of the apps I can select as a target is the Simple SMS App. So if we compare the lists of content types that Simple Notes and Simple SMS listens to, we will see which content type should be implemented in Simple Notes.

@BreakfastSerial
Copy link

Kinda. I see Simple SMS Messenger uses <data android:mimeType="*/*" />, so basically anything ;)

text/* for simple notes makes sense, as it only processes text. What app, or rather what type, are you trying to export data from?

@ShadyMedic
Copy link
Author

ShadyMedic commented Nov 24, 2023 via email

@BreakfastSerial
Copy link

Hey mate, I've just downloaded that app and checked the AndroidManifest.xml (see AndroidManifest.txt, if you're interested).

I believe (again, I'm no dev), the issue you're having is, that the IDOS only expects sending data to apps that offer the following schemes.

<data android:scheme="smsto"/>
<data android:scheme="mailto"/>

@ShadyMedic
Copy link
Author

Thank you for putting so much time into a niche issue like this. So from what I undestand, the only thing that is needed is to make Simple Notes listen to smsto schemes, right?

Any idea what file would I need to edit in a fork of this repository? I know pretty much nothing about Kotlin and programming for Android.

@BreakfastSerial
Copy link

You're welcome. I believe that would resolve your issue. Either patch the IDOS app to export to text/* or make SimpleNote accept smsto or mailto.

I have no idea, what kind of work forking and building this project yourself entails. Personally I'd try to get the .apk of SimpleNotes, take it apart with apktool, change the AndroidManifest.xml to also accept smsto and then repack the apk with apktool again.

I also just noticed that I've mixed scheme and mimetype in my previous comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants