Fixes to android media sharing project
It wasn't building on mac and there were some minor path issues
Change-Id: I834e8fcd08a97264138715949996588700d7956c
diff --git a/.gitignore b/.gitignore
index f981a24..a44eefe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
/.v23
/android/.idea/
-/android/generated-src/
-/android/android.iml
-/android/app/app.iml
+/android/*.iml
+/android/app/*.iml
+/android/app/generated-src/
/go/pkg/
/go/bin/
/js/build
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 24d84f6..dd8e880 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -43,7 +43,6 @@
exclude 'META-INF/NOTICE.txt' // Duplicate clash between commons-io and joda-time
exclude 'META-INF/MANIFEST.MF' // Duplicate clash between commons-io and joda-time
}
- sourceSets.main.java.srcDirs = ['src/main/java', '../generated-src/vdl']
}
dependencies {
@@ -56,4 +55,4 @@
vdl {
inputPaths += "$projectDir/../../go"
-}
\ No newline at end of file
+}
diff --git a/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingClient.java b/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingClient.java
deleted file mode 100644
index 0cd50d8..0000000
--- a/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingClient.java
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015 The Vanadium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This file was auto-generated by the vanadium vdl tool.
-
-// Source: media.vdl
-package io.v.x.media_sharing;
-
-
-public interface MediaSharingClient {
-
-
-
-
-
- /**
- * DisplayURL will cause the server to display whatever media is at
- * the given URL. The server will rely on the ContentType response
- * header it gets when fetching the url to decide how to display
- * the media.
-*/
- void displayUrl(io.v.v23.context.VContext context, final java.lang.String url) throws io.v.v23.verror.VException;
- void displayUrl(io.v.v23.context.VContext context, final java.lang.String url, io.v.v23.Options vOpts) throws io.v.v23.verror.VException;
-
-
-
-
-
- /**
- * DisplayBytes will cause the server to display whatever media is
- * sent in the stream. In the case of audio or movie media, the
- * media should be played while the data is streaming. The mediaType
- * can be used by the server to decide how to display the media.
-*/
- io.v.v23.vdl.ClientStream<byte[], java.lang.Void, java.lang.Void> displayBytes(io.v.v23.context.VContext context, final java.lang.String mediaType) throws io.v.v23.verror.VException;
- io.v.v23.vdl.ClientStream<byte[], java.lang.Void, java.lang.Void> displayBytes(io.v.v23.context.VContext context, final java.lang.String mediaType, io.v.v23.Options vOpts) throws io.v.v23.verror.VException;
-
-}
diff --git a/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingClientFactory.java b/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingClientFactory.java
deleted file mode 100644
index f2cbde9..0000000
--- a/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingClientFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015 The Vanadium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This file was auto-generated by the vanadium vdl tool.
-
-// Source(s): media.vdl
-package io.v.x.media_sharing;
-
-/**
- * Factory for {@link MediaSharingClient}s.
- */
-public final class MediaSharingClientFactory {
- /**
- * Creates a new {@link MediaSharingClient}, binding it to the provided name.
- *
- * @param name name to bind to
- */
- public static MediaSharingClient getMediaSharingClient(java.lang.String name) {
- return getMediaSharingClient(name, null);
- }
-
- /**
- * Creates a new {@link MediaSharingClient}, binding it to the provided name and using the
- * provided options. Currently supported options are:
- * <p><ul>
- * <li>{@link io.v.v23.OptionDefs#CLIENT}, which specifies a {@link io.v.v23.rpc.Client} to use for all rpc calls.</li>
- * </ul>
- *
- * @param name name to bind to
- * @param opts creation options
- */
- public static MediaSharingClient getMediaSharingClient(java.lang.String name, io.v.v23.Options opts) {
- io.v.v23.rpc.Client client = null;
- if (opts != null && opts.get(io.v.v23.OptionDefs.CLIENT) != null) {
- client = opts.get(io.v.v23.OptionDefs.CLIENT, io.v.v23.rpc.Client.class);
- }
- return new MediaSharingClientImpl(client, name);
- }
-
- private MediaSharingClientFactory() {}
-}
diff --git a/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingClientImpl.java b/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingClientImpl.java
deleted file mode 100644
index d88f2c8..0000000
--- a/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingClientImpl.java
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2015 The Vanadium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This file was auto-generated by the vanadium vdl tool.
-
-// Source(s): media.vdl
-package io.v.x.media_sharing;
-
-/**
- * Implementation of the {@link MediaSharingClient} interface.
- */
-final class MediaSharingClientImpl implements io.v.x.media_sharing.MediaSharingClient {
- private final io.v.v23.rpc.Client client;
- private final java.lang.String vName;
-
-
-
-
- /**
- * Creates a new instance of {@link MediaSharingClientImpl}.
- *
- * @param client Vanadium client
- * @param vName remote server name
- */
- public MediaSharingClientImpl(io.v.v23.rpc.Client client, java.lang.String vName) {
- this.client = client;
- this.vName = vName;
-
-
- }
-
- private io.v.v23.rpc.Client getClient(io.v.v23.context.VContext context) {
- return this.client != null ? client : io.v.v23.V.getClient(context);
-
- }
-
- // Methods from interface MediaSharingClient.
-
-
-
- @Override
- public void displayUrl(io.v.v23.context.VContext context, final java.lang.String url) throws io.v.v23.verror.VException {
- displayUrl(context, url, null);
- }
-
- @Override
- public void displayUrl(io.v.v23.context.VContext context, final java.lang.String url, io.v.v23.Options vOpts) throws io.v.v23.verror.VException {
-
- // Start the call.
- java.lang.Object[] _args = new java.lang.Object[]{ url };
- java.lang.reflect.Type[] _argTypes = new java.lang.reflect.Type[]{ new com.google.common.reflect.TypeToken<java.lang.String>(){}.getType() };
- final io.v.v23.rpc.Client.Call _call = getClient(context).startCall(context, this.vName, "displayUrl", _args, _argTypes, vOpts);
-
- // Finish the call.
-
-
-
-
- java.lang.reflect.Type[] _resultTypes = new java.lang.reflect.Type[]{};
- _call.finish(_resultTypes);
-
-
-
- }
-
-
- @Override
- public io.v.v23.vdl.ClientStream<byte[], java.lang.Void, java.lang.Void> displayBytes(io.v.v23.context.VContext context, final java.lang.String mediaType) throws io.v.v23.verror.VException {
- return displayBytes(context, mediaType, null);
- }
-
- @Override
- public io.v.v23.vdl.ClientStream<byte[], java.lang.Void, java.lang.Void> displayBytes(io.v.v23.context.VContext context, final java.lang.String mediaType, io.v.v23.Options vOpts) throws io.v.v23.verror.VException {
-
- // Start the call.
- java.lang.Object[] _args = new java.lang.Object[]{ mediaType };
- java.lang.reflect.Type[] _argTypes = new java.lang.reflect.Type[]{ new com.google.common.reflect.TypeToken<java.lang.String>(){}.getType() };
- final io.v.v23.rpc.Client.Call _call = getClient(context).startCall(context, this.vName, "displayBytes", _args, _argTypes, vOpts);
-
- // Finish the call.
-
-
- return new io.v.v23.vdl.ClientStream<byte[], java.lang.Void, java.lang.Void>() {
- @Override
- public void send(byte[] item) throws io.v.v23.verror.VException {
- java.lang.reflect.Type type = new com.google.common.reflect.TypeToken<byte[]>() {}.getType();
- _call.send(item, type);
- }
- @Override
- public java.lang.Void recv() throws java.io.EOFException, io.v.v23.verror.VException {
- java.lang.reflect.Type type = new com.google.common.reflect.TypeToken<java.lang.Void>() {}.getType();
- java.lang.Object result = _call.recv(type);
- try {
- return (java.lang.Void)result;
- } catch (java.lang.ClassCastException e) {
- throw new io.v.v23.verror.VException("Unexpected result type: " + result.getClass().getCanonicalName());
- }
- }
- @Override
- public java.lang.Void finish() throws io.v.v23.verror.VException {
-
- java.lang.reflect.Type[] resultTypes = new java.lang.reflect.Type[]{};
- _call.finish(resultTypes);
- return null;
-
- }
- };
-
- }
-
-
-
-
-
-}
diff --git a/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingServer.java b/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingServer.java
deleted file mode 100644
index c2f1489..0000000
--- a/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingServer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015 The Vanadium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This file was auto-generated by the vanadium vdl tool.
-
-// Source: media.vdl
-package io.v.x.media_sharing;
-
-
-@io.v.v23.vdl.VServer(
- serverWrapper = io.v.x.media_sharing.MediaSharingServerWrapper.class
-)
-public interface MediaSharingServer {
-
-
-
-
-
- /**
- * DisplayURL will cause the server to display whatever media is at
- * the given URL. The server will rely on the ContentType response
- * header it gets when fetching the url to decide how to display
- * the media.
-*/
- void displayUrl(io.v.v23.context.VContext ctx, io.v.v23.rpc.ServerCall call, final java.lang.String url) throws io.v.v23.verror.VException;
-
-
-
-
-
- /**
- * DisplayBytes will cause the server to display whatever media is
- * sent in the stream. In the case of audio or movie media, the
- * media should be played while the data is streaming. The mediaType
- * can be used by the server to decide how to display the media.
-*/
- void displayBytes(io.v.v23.context.VContext ctx, io.v.v23.rpc.ServerCall call, final java.lang.String mediaType, io.v.v23.vdl.Stream<java.lang.Void, byte[]> stream) throws io.v.v23.verror.VException;
-
-}
diff --git a/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingServerWrapper.java b/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingServerWrapper.java
deleted file mode 100644
index d70ee56..0000000
--- a/android/app/generated-src/vdl/io/v/x/media_sharing/MediaSharingServerWrapper.java
+++ /dev/null
@@ -1,168 +0,0 @@
-// Copyright 2015 The Vanadium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This file was auto-generated by the vanadium vdl tool.
-
-// Source(s): media.vdl
-package io.v.x.media_sharing;
-
-/**
- * Wrapper for {@link MediaSharingServer}. This wrapper is used by
- * {@link io.v.v23.rpc.ReflectInvoker} to indirectly invoke server methods.
- */
-public final class MediaSharingServerWrapper {
- private final io.v.x.media_sharing.MediaSharingServer server;
-
-
-
-
- /**
- * Creates a new {@link MediaSharingServerWrapper} to invoke the methods of the
- * provided server.
- *
- * @param server server whose methods are to be invoked
- */
- public MediaSharingServerWrapper(io.v.x.media_sharing.MediaSharingServer server) {
- this.server = server;
-
-
- }
-
- /**
- * Returns a description of this server.
- */
- public io.v.v23.vdlroot.signature.Interface signature() {
- java.util.List<io.v.v23.vdlroot.signature.Embed> embeds = new java.util.ArrayList<io.v.v23.vdlroot.signature.Embed>();
- java.util.List<io.v.v23.vdlroot.signature.Method> methods = new java.util.ArrayList<io.v.v23.vdlroot.signature.Method>();
-
- {
- java.util.List<io.v.v23.vdlroot.signature.Arg> inArgs = new java.util.ArrayList<io.v.v23.vdlroot.signature.Arg>();
-
- inArgs.add(new io.v.v23.vdlroot.signature.Arg("", "", new io.v.v23.vdl.VdlTypeObject(new com.google.common.reflect.TypeToken<java.lang.String>(){}.getType())));
-
- java.util.List<io.v.v23.vdlroot.signature.Arg> outArgs = new java.util.ArrayList<io.v.v23.vdlroot.signature.Arg>();
-
- java.util.List<io.v.v23.vdl.VdlAny> tags = new java.util.ArrayList<io.v.v23.vdl.VdlAny>();
-
- methods.add(new io.v.v23.vdlroot.signature.Method(
- "displayUrl",
- "// DisplayURL will cause the server to display whatever media is at" +
-"// the given URL. The server will rely on the ContentType response" +
-"// header it gets when fetching the url to decide how to display" +
-"// the media." +
-"",
- inArgs,
- outArgs,
- null,
- null,
- tags));
- }
-
- {
- java.util.List<io.v.v23.vdlroot.signature.Arg> inArgs = new java.util.ArrayList<io.v.v23.vdlroot.signature.Arg>();
-
- inArgs.add(new io.v.v23.vdlroot.signature.Arg("", "", new io.v.v23.vdl.VdlTypeObject(new com.google.common.reflect.TypeToken<java.lang.String>(){}.getType())));
-
- java.util.List<io.v.v23.vdlroot.signature.Arg> outArgs = new java.util.ArrayList<io.v.v23.vdlroot.signature.Arg>();
-
- java.util.List<io.v.v23.vdl.VdlAny> tags = new java.util.ArrayList<io.v.v23.vdl.VdlAny>();
-
- methods.add(new io.v.v23.vdlroot.signature.Method(
- "displayBytes",
- "// DisplayBytes will cause the server to display whatever media is" +
-"// sent in the stream. In the case of audio or movie media, the" +
-"// media should be played while the data is streaming. The mediaType" +
-"// can be used by the server to decide how to display the media." +
-"",
- inArgs,
- outArgs,
- null,
- null,
- tags));
- }
-
-
- return new io.v.v23.vdlroot.signature.Interface("MediaSharing", "io.v.x.media_sharing", "", embeds, methods);
- }
-
- /**
- * Returns all tags associated with the provided method or {@code null} if the method isn't
- * implemented by this server.
- *
- * @param method method whose tags are to be returned
- */
- @SuppressWarnings("unused")
- public io.v.v23.vdl.VdlValue[] getMethodTags(java.lang.String method) throws io.v.v23.verror.VException {
-
- if ("displayBytes".equals(method)) {
- try {
- return new io.v.v23.vdl.VdlValue[] {
-
- };
- } catch (IllegalArgumentException e) {
- throw new io.v.v23.verror.VException(String.format("Couldn't get tags for method \"displayBytes\": %s", e.getMessage()));
- }
- }
-
- if ("displayUrl".equals(method)) {
- try {
- return new io.v.v23.vdl.VdlValue[] {
-
- };
- } catch (IllegalArgumentException e) {
- throw new io.v.v23.verror.VException(String.format("Couldn't get tags for method \"displayUrl\": %s", e.getMessage()));
- }
- }
-
-
- return null; // method not found
- }
-
-
-
- /**
- * DisplayURL will cause the server to display whatever media is at
- * the given URL. The server will rely on the ContentType response
- * header it gets when fetching the url to decide how to display
- * the media.
-*/
- public void displayUrl(io.v.v23.context.VContext ctx, final io.v.v23.rpc.StreamServerCall call, final java.lang.String url) throws io.v.v23.verror.VException {
-
- this.server.displayUrl(ctx, call , url );
- }
-
- /**
- * DisplayBytes will cause the server to display whatever media is
- * sent in the stream. In the case of audio or movie media, the
- * media should be played while the data is streaming. The mediaType
- * can be used by the server to decide how to display the media.
-*/
- public void displayBytes(io.v.v23.context.VContext ctx, final io.v.v23.rpc.StreamServerCall call, final java.lang.String mediaType) throws io.v.v23.verror.VException {
-
- io.v.v23.vdl.Stream<java.lang.Void, byte[]> _stream = new io.v.v23.vdl.Stream<java.lang.Void, byte[]>() {
- @Override
- public void send(java.lang.Void item) throws io.v.v23.verror.VException {
- java.lang.reflect.Type type = new com.google.common.reflect.TypeToken< java.lang.Void >() {}.getType();
- call.send(item, type);
- }
- @Override
- public byte[] recv() throws java.io.EOFException, io.v.v23.verror.VException {
- java.lang.reflect.Type type = new com.google.common.reflect.TypeToken< byte[] >() {}.getType();
- java.lang.Object result = call.recv(type);
- try {
- return (byte[])result;
- } catch (java.lang.ClassCastException e) {
- throw new io.v.v23.verror.VException("Unexpected result type: " + result.getClass().getCanonicalName());
- }
- }
- };
-
- this.server.displayBytes(ctx, call , mediaType ,_stream );
- }
-
-
-
-
-
-}