damonkohler / sl4a

SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.
Apache License 2.0
2.42k stars 804 forks source link

Ability to open() content:// uris as well as file:/// uris #240

Open damonkohler opened 9 years ago

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:26

I'm trying to work with photos in python.
v = droid.pick('content://media/external/images/media')
location = v['result']['data']

I want to ftp this file somewhere, and ftplib works fine (thanks!)

To STOR the file I need to first open() it.  I pass the content uri into 
open(location) and get no love.

if you can't make open(location) work, could we get a method to resolve a file 
uri from a content uri? 
see snippet: 
http://www.androidsnippets.org/snippets/130/

Original issue reported on code.google.com by snarkh...@gmail.com on 10 Jun 2010 at 10:53

Copied from original issue: damonkohler/android-scripting#346