Skip to content

Sharing text with ownCloud #104

Closed
Closed

Description

@untitaker

It would be neat if i could share text from my twitter app (or from the sms app) and pipe the text into a new text file on ownCloud.

Activity

  1. untitaker commented on Mar 6, 2013

    @untitaker
    Author

    The current message for this is "no content recieved". I digged a bit in the sourcecode and found that https://github.com/owncloud/android/blob/master/src/com/owncloud/android/Uploader.java#L352 populates the ArrayList with null or something else that causes this method to return false.

    Using getStringExtra gets me the full text of the tweet though.

  2. davivel commented on Mar 6, 2013

    @davivel
    Contributor

    Well, right now the interface is thought to share files. Maybe we extend this in the future, but at this moment we have a lot of things with higher priority.

  3. untitaker commented on Mar 6, 2013

    @untitaker
    Author

    What would be a sensible way to detect whether the user is sharing text or something else? I am considering working on this.

  4. davivel commented on Mar 6, 2013

    @davivel
    Contributor

    Checking the 'type' field in the received Intent. If Twitter is polite, it should be filling it with a "text/something" value. A match with "text/*" in Uploader.java could be interpreted as a try to create a new text file.

    But if Twitter, or any other app sending text, is not polite enough... well, trying to parse whatever content is passed from any possible application is not a good idea, IMHO.

  5. untitaker commented on Mar 7, 2013

    @untitaker
    Author

    Couldn't the mimetype of a file be in there too? Since ownCloud would have to prompt a filename for text-only streams, it would be unfortunate if it did that for every textfile.

  6. davivel commented on Mar 7, 2013

    @davivel
    Contributor

    Mmmm, yes. I talked too fast.

    Seems that a file should be putting the data in Intent.EXTRA_STREAM, while a chunk of text should put them in Intent.EXTRA_TEXT. The second one is not being checked now in Uploader.java.

    More help from here: http://developer.android.com/reference/android/content/Intent.html#ACTION_SEND

  7. untitaker commented on Mar 7, 2013

    @untitaker
    Author

    Is it sensible to build a data-URI out of the text to store in mStreamsToUpload? Like this:

    data:text/plain,hueheuheauhfsrgjrsgr
    
  8. untitaker commented on Mar 7, 2013

    @untitaker
    Author

    I currently have the problem that there don't exist local paths for the files i am creating. Should i actually create local files? If so, what's the preferred way to do so?

  9. davivel commented on Mar 7, 2013

    @davivel
    Contributor

    Sorry, I do not understand what you mean with the question about the "data:text/plain,...".

    About the other, you have come to the key point for this functionality, IMHO. Right now there is no functionality in the code to create new files on the fly.

    UploadFileOperation now try to copy any file to upload in FileStorageUtils.getTemporalPath() before start to uploading it. Consider modify the UploadFileOperation to work with a piece of text (or still better, any piece of data in memory) instead of a file as source for that temporal copy; and later, what changes are necessary to let the piece of data arrives from Uploader.java to the UploadFileOperation, going through FileUploader.

  10. untitaker commented on Mar 7, 2013

    @untitaker
    Author

    I already think that your current model is sufficient for doing the functionality needed. Using java.io.File to actually create the file and then telling the file uploader through an intent the location doesn't really seem like a bad API.

    Coming from a Python background, I have to say it quite baffles me that OCFile doesn' t inherit from java.io.File, but is another model to represent the same thing. Why is that so?

  11. davivel commented on Mar 7, 2013

    @davivel
    Contributor

    Well, that was there when a I joined the project.

    I thought in making it inherit a couple of times, but it would affect a loooot of code, so the risk of breaking things is high, while the benefits at this moment would be cosmetic.

  12. untitaker commented on Mar 7, 2013

    @untitaker
    Author

    Meh, the effort isn't worth it for me, especially as somebody who hardly knows Java. I stopped working on this for now.

  13. davivel commented on Mar 7, 2013

    @davivel
    Contributor

    OK. Anyway, the Uploader.java itself needs a deep review for its current functions, there are some ugly crashes with the upload of images.

    A brave step going from Python to Java. I know some people recommending the opposite way to me :)

  14. untitaker commented on Mar 7, 2013

    @untitaker
    Author

    A brave step going from Python to Java. I know some people recommending the opposite way to me :)

    I didn't and won't stop writing Python. 😯

  15. 11 remaining items

  16. tobiasKaminsky commented on Aug 16, 2015

    @tobiasKaminsky
    Contributor

    So the workflow would be:

    • accepting text as input
    • write it to a temporary file
    • prompt for a file name
    • let user choose storage path
  17. torwag commented on Aug 16, 2015

    @torwag

    IMHO, it should be as easy as possible for 90% of all usage scenarios. That is, the settings should allow to set a default path and a file name structure. E.g. \notes\income\ $date-$time-$sending-app-name.
    The workflow would go straight to ask the user to save the text by the default settings (single click) and prompt for a file name and path otherwise.

  18. tobiasKaminsky commented on Aug 16, 2015

    @tobiasKaminsky
    Contributor

    I do not like the idea of a setting, here.
    Maybe just remember the last storage path of txt files (just like it is currently for upload files)

    @jancborchardt your opinion here, please!

  19. tobiasKaminsky commented on Aug 16, 2015

    @tobiasKaminsky
    Contributor
  20. purigarcia commented on Aug 21, 2015

    @purigarcia
    Contributor

    @tobiasKaminsky , @AndyScherzinger , @LukeOwncloud and whoever feels like, contributions are wellcome here :)

  21. AndyScherzinger commented on Aug 21, 2015

    @AndyScherzinger
    Contributor

    I agree with @tobiasKaminsky I also wouldn't like to see this realized using a setting, an expected behavior like Tobias described with "currently for upload files" seems to be a consistent way imho

  22. tobiasKaminsky commented on Aug 21, 2015

    @tobiasKaminsky
    Contributor

    @jancborchardt
    @davivel
    We need your opinion here first :)

  23. jancborchardt commented on Aug 24, 2015

    @jancborchardt
    Contributor

    Honestly this seems like a very specific usecase. Doing this properly would be to implement the ability to view & edit text files: #88 – then you can paste stuff and edit it afterwards too.

  24. tobiasKaminsky commented on Apr 16, 2016

    @tobiasKaminsky
    Contributor

    @jancborchardt @davivel
    It seems that now some more people would like to have this feature.
    So, in order to have someone that can implement this, we should discuss the proper way?

    In a first step I would just do this like files:
    An user shares text with owncloud app, selects the folder and then a dialog appears where the filename is entered with automatically extension ".txt" and save.

    Regarding linked #88: it seems that (at least) viewing text files is working.

  25. jancborchardt commented on Apr 17, 2016

    @jancborchardt
    Contributor

    Ok, functionality-wise that seems good. :)

  26. davivel commented on Apr 18, 2016

    @davivel
    Contributor

    @tobiasKaminsky , 👍 👍 👍 👍 👍 👍 👍

  27. tobiasKaminsky commented on May 1, 2016

    @tobiasKaminsky
    Contributor
  28. davivel commented on Apr 4, 2017

    @davivel
    Contributor

    This was resolved with #1926 and will be available in the next release 2.4.0

    Thanks, @cinnamonsalt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions