I'm inclined to say a Service would be better for Context access instead of
a noop Activity. You should be able to make the Service instantiate needed
resources or provide an implementation to instantiate those resources and a
method for communicating that logic in Go. If you don't want parallel
versions of the Go executable running, you may want to handle this in the
Service that spawns the subprocess as well.

> I guess we could spawn a noop activity in the subprocess but I am not
sure how that would work.

I'd imagine launching intents via os/exec should be possible by making
using the `am` command. See here for usage:
https://developer.android.com/studio/command-line/adb.html#am

I'm unaware of any backward-compatibility claims made for `am` though.

On Mon, Oct 16, 2017 at 1:09 PM <audrius.butkevic...@gmail.com> wrote:

> As it stands now, we have a pure java wrapper application that simply
> starts a subprocess with our pure go binary. I guess what you are saying is
> that our Go application needs to become a library, rather than a process.
> Which is complicated as I am not sure it can, as our cleanup assumes the
> process gets killed, which in this case would not be possible, so with
> every invocation we might leave more and more trash in the runtime.
>
> I wonder if passing the fds using unix sockets from java to go is not the
> easier option.
>
> Also, having a go binary that gets the vm instantiated somehow and then
> reverse binding to get the fd would be my other prefered option, yet I
> don't think its possible without an activity. I guess we could spawn a noop
> activity in the subprocess but I am not sure how that would work.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to