Basic answer is to use SmbFileInputStream to get InputStream You probably use this.

Now the tricky part is how to offer InputStream to other apps.

One possible approach, how many apps provide streaming of any InputStream to other apps on device, is to use http: URL scheme, and tunel your stream over http. Then apps that can handle http URLs can open and use your data.

For this you have to make some kind of http server, which sounds difficult, but actually is achievable task. Good source to start with is nanohttpd library which is just one java source, originally used to list files in dirs, but you can adapt it to stream your InputStream over http. That's what I did with success.

Your url would look like http:// localhost:12345 where 12345 is port on which your server listens for requests. This port may be obtained from ServerSocket.getLocalPort(). Then give this URL to some app and your server waits for connection and sends data.

A note about http streaming: some apps (e.g. video players) like seekable http streams (http Range header). Since you can get also SmbRandomAccessFile, you can make your tiny server to provide any part of data in file. Android's built-in video player needs such seekable http stream in order to allow seeking in video file, otherwise it gives "Video can't be played" error. Your server must be ready to handle disconnects and multiple connects with different Range values.

Basic tasks of http server:

create ServerSocket create Thread waiting for connection (Socket accept = serverSocket.accept()), one thread may be ok since you'd handle single client at a time read http request (socket.getInputStream()), mainly check GET method and Range header) send headers, mainly Content-Type, Content-Length, Accept-Ranges, Content-Range headers send actual binary data, which is plain copying of InputStream (file) to OutputStream (socket) handle disconnects, errors, exceptions

Good luck in implementation.

EDIT:

Here's my class that does the thing. It references some non-present classes for file, which should be trivial for you to replace by your file class.