mirror of
https://github.com/zoriya/Opus.git
synced 2025-12-06 06:26:15 +00:00
youtube playing now working but add too many time the same song in queue
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
||||
<TargetFrameworkVersion>v7.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
@@ -41,6 +41,7 @@
|
||||
<BundleAssemblies>false</BundleAssemblies>
|
||||
<Debugger>Xamarin</Debugger>
|
||||
<AndroidSupportedAbis />
|
||||
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="MusicApp.MusicApp" android:versionCode="1" android:versionName="1.0" android:installLocation="preferExternal">
|
||||
<uses-sdk android:minSdkVersion="20" android:targetSdkVersion="25" />
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="25" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
@@ -96,7 +96,17 @@ namespace MusicApp.Resources.Portable_Class
|
||||
return StartCommandResult.Sticky;
|
||||
|
||||
if (file != null)
|
||||
{
|
||||
string title = intent.GetStringExtra("title");
|
||||
if(title != null)
|
||||
{
|
||||
string artist = intent.GetStringExtra("artist");
|
||||
string thumbnailURI = intent.GetStringExtra("thumbnailURI");
|
||||
Play(file, title, artist, thumbnailURI);
|
||||
return StartCommandResult.Sticky;
|
||||
}
|
||||
Play(file);
|
||||
}
|
||||
|
||||
return StartCommandResult.Sticky;
|
||||
}
|
||||
@@ -113,12 +123,20 @@ namespace MusicApp.Resources.Portable_Class
|
||||
player.AddListener(this);
|
||||
}
|
||||
|
||||
public void Play(string filePath)
|
||||
public void Play(string filePath, string title = null, string artist = null, string thumbnailURI = null)
|
||||
{
|
||||
isRunning = true;
|
||||
if (player == null)
|
||||
InitializeService();
|
||||
|
||||
if(mediaSession == null)
|
||||
{
|
||||
mediaSession = new MediaSessionCompat(Application.Context, "MusicApp");
|
||||
mediaSession.SetFlags(MediaSessionCompat.FlagHandlesMediaButtons | MediaSessionCompat.FlagHandlesTransportControls);
|
||||
PlaybackStateCompat.Builder builder = new PlaybackStateCompat.Builder().SetActions(PlaybackStateCompat.ActionPlay | PlaybackStateCompat.ActionPause);
|
||||
mediaSession.SetPlaybackState(builder.Build());
|
||||
}
|
||||
|
||||
DefaultDataSourceFactory dataSourceFactory = new DefaultDataSourceFactory(Application.Context, "MusicApp");
|
||||
IExtractorsFactory extractorFactory = new DefaultExtractorsFactory();
|
||||
Handler handler = new Handler();
|
||||
@@ -129,49 +147,19 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Console.WriteLine("Can't Get Audio Focus");
|
||||
return;
|
||||
}
|
||||
player.PlayWhenReady = true;
|
||||
player.Prepare(mediaSource, true, true);
|
||||
|
||||
GetTrackSong(filePath, out Song song);
|
||||
CreateNotification(song.GetName(), song.GetArtist(), song.GetAlbumArt());
|
||||
queue.Clear();
|
||||
Song song = null;
|
||||
if(title == null)
|
||||
GetTrackSong(filePath, out song);
|
||||
else
|
||||
{
|
||||
song = new Song(title, artist, thumbnailURI, -1, -1, filePath);
|
||||
}
|
||||
CreateNotification(song.GetName(), song.GetArtist(), song.GetAlbumArt(), song.GetAlbum());
|
||||
//queue.Clear();
|
||||
AddToQueue(song);
|
||||
|
||||
//if (mediaSession != null)
|
||||
//{
|
||||
// player.Reset();
|
||||
// InitializePlayer();
|
||||
// await player.SetDataSourceAsync(Application.Context, Uri.Parse(filePath));
|
||||
// player.PrepareAsync();
|
||||
// GetTrackSong(filePath, out Song song);
|
||||
// CreateNotification(song.GetName(), song.GetArtist(), song.GetAlbumArt());
|
||||
// queue.Clear();
|
||||
// AddToQueue(filePath);
|
||||
// return;
|
||||
//}
|
||||
//try
|
||||
//{
|
||||
// mediaSession = new MediaSessionCompat(Application.Context, "MusicApp");
|
||||
// mediaSession.SetFlags(MediaSessionCompat.FlagHandlesMediaButtons | MediaSessionCompat.FlagHandlesTransportControls);
|
||||
// PlaybackStateCompat.Builder builder = new PlaybackStateCompat.Builder().SetActions(PlaybackStateCompat.ActionPlay | PlaybackStateCompat.ActionPause);
|
||||
// mediaSession.SetPlaybackState(builder.Build());
|
||||
|
||||
// await player.SetDataSourceAsync(Application.Context, Android.Net.Uri.Parse(filePath));
|
||||
// var audioFocus = audioManager.RequestAudioFocus(this, Stream.Music, AudioFocus.Gain);
|
||||
// if (audioFocus != AudioFocusRequest.Granted)
|
||||
// {
|
||||
// Console.WriteLine("Can't Get Audio Focus");
|
||||
// return;
|
||||
// }
|
||||
// player.PrepareAsync();
|
||||
// GetTrackSong(filePath, out Song song);
|
||||
// CreateNotification(song.GetName(), song.GetArtist(), song.GetAlbumArt());
|
||||
// queue.Clear();
|
||||
// AddToQueue(filePath);
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// Console.WriteLine("Error: " + ex);
|
||||
//}
|
||||
}
|
||||
|
||||
public async void RandomPlay(List<string> filePath)
|
||||
@@ -249,10 +237,17 @@ namespace MusicApp.Resources.Portable_Class
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spArtist).Text = song.GetArtist();
|
||||
ImageView art = smallPlayer.FindViewById<ImageView>(Resource.Id.spArt);
|
||||
|
||||
var songCover = Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, song.GetAlbumArt());
|
||||
if(song.GetAlbum() == null)
|
||||
{
|
||||
var songCover = Uri.Parse("content://media/external/audio/albumart");
|
||||
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, song.GetAlbumArt());
|
||||
|
||||
Picasso.With(Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(art);
|
||||
Picasso.With(Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(art);
|
||||
}
|
||||
else
|
||||
{
|
||||
Picasso.With(Application.Context).Load(song.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Into(art);
|
||||
}
|
||||
}
|
||||
|
||||
public static int CurrentID()
|
||||
@@ -298,16 +293,10 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
string Title = "Unknow";
|
||||
string Artist = "Unknow";
|
||||
string Album = "Unknow";
|
||||
long AlbumArt = 0;
|
||||
long id = 0;
|
||||
string path = filePath;
|
||||
|
||||
if (false /*Check if it's a youtube video*/)
|
||||
{
|
||||
//return information about a youtube video
|
||||
}
|
||||
|
||||
Uri musicUri = MediaStore.Audio.Media.ExternalContentUri;
|
||||
|
||||
CursorLoader cursorLoader = new CursorLoader(Application.Context, musicUri, null, null, null, null);
|
||||
@@ -317,7 +306,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
int titleID = musicCursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Title);
|
||||
int artistID = musicCursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Artist);
|
||||
int albumID = musicCursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Album);
|
||||
int thisID = musicCursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Id);
|
||||
int pathID = musicCursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Data);
|
||||
do
|
||||
@@ -328,7 +316,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
Artist = musicCursor.GetString(artistID);
|
||||
Title = musicCursor.GetString(titleID);
|
||||
Album = musicCursor.GetString(albumID);
|
||||
AlbumArt = musicCursor.GetLong(musicCursor.GetColumnIndex(MediaStore.Audio.Albums.InterfaceConsts.AlbumId));
|
||||
id = musicCursor.GetLong(thisID);
|
||||
|
||||
@@ -336,16 +323,13 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Title = "Unknown Title";
|
||||
if (Artist == null)
|
||||
Artist = "Unknow Artist";
|
||||
if (Album == null)
|
||||
Album = "Unknow Album";
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (musicCursor.MoveToNext());
|
||||
musicCursor.Close();
|
||||
}
|
||||
song = new Song(Title, Artist, Album, AlbumArt, id, filePath);
|
||||
song = new Song(Title, Artist, null, AlbumArt, id, filePath);
|
||||
}
|
||||
|
||||
async void CreateNotification(string title, string artist, long albumArt = 0, string imageURI = "")
|
||||
@@ -353,28 +337,45 @@ namespace MusicApp.Resources.Portable_Class
|
||||
MusicPlayer.title = title;
|
||||
Bitmap icon = null;
|
||||
|
||||
if (albumArt != 0)
|
||||
if (imageURI == null)
|
||||
{
|
||||
Uri songCover = Uri.Parse("content://media/external/audio/albumart");
|
||||
Uri iconURI = ContentUris.WithAppendedId(songCover, albumArt);
|
||||
|
||||
await Task.Run(() =>
|
||||
if (albumArt != 0)
|
||||
{
|
||||
try
|
||||
Uri songCover = Uri.Parse("content://media/external/audio/albumart");
|
||||
Uri iconURI = ContentUris.WithAppendedId(songCover, albumArt);
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
icon = Picasso.With(Application.Context).Load(iconURI).Error(Resource.Drawable.MusicIcon).Placeholder(Resource.Drawable.MusicIcon).NetworkPolicy(NetworkPolicy.Offline).Resize(400, 400).CenterCrop().Get();
|
||||
}
|
||||
catch (System.Exception)
|
||||
try
|
||||
{
|
||||
icon = Picasso.With(Application.Context).Load(iconURI).Error(Resource.Drawable.MusicIcon).Placeholder(Resource.Drawable.MusicIcon).NetworkPolicy(NetworkPolicy.Offline).Resize(400, 400).CenterCrop().Get();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
icon = Picasso.With(Application.Context).Load(Resource.Drawable.MusicIcon).Get();
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
icon = Picasso.With(Application.Context).Load(Resource.Drawable.MusicIcon).Get();
|
||||
}
|
||||
});
|
||||
icon = Picasso.With(Application.Context).Load(imageURI).Get();
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
icon = Picasso.With(Application.Context).Load(imageURI).Get();
|
||||
try
|
||||
{
|
||||
icon = Picasso.With(Application.Context).Load(imageURI).Error(Resource.Drawable.MusicIcon).Placeholder(Resource.Drawable.MusicIcon).NetworkPolicy(NetworkPolicy.Offline).Resize(400, 400).CenterCrop().Get();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
icon = Picasso.With(Application.Context).Load(Resource.Drawable.MusicIcon).Get();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -412,6 +413,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
if(player != null && isRunning)
|
||||
{
|
||||
isRunning = false;
|
||||
Intent tmpPauseIntent = new Intent(Application.Context, typeof(MusicPlayer));
|
||||
tmpPauseIntent.SetAction("Pause");
|
||||
PendingIntent pauseIntent = PendingIntent.GetService(Application.Context, 0, tmpPauseIntent, PendingIntentFlags.UpdateCurrent);
|
||||
@@ -436,6 +438,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
if(player != null && !isRunning)
|
||||
{
|
||||
isRunning = true;
|
||||
Intent tmpPauseIntent = new Intent(Application.Context, typeof(MusicPlayer));
|
||||
tmpPauseIntent.SetAction("Pause");
|
||||
PendingIntent pauseIntent = PendingIntent.GetService(Application.Context, 0, tmpPauseIntent, PendingIntentFlags.UpdateCurrent);
|
||||
|
||||
@@ -88,10 +88,17 @@ namespace MusicApp.Resources.Portable_Class
|
||||
artist.Selected = true;
|
||||
artist.SetMarqueeRepeatLimit(3);
|
||||
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, current.GetAlbumArt());
|
||||
if(current.GetAlbum() == null)
|
||||
{
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, current.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(imgView);
|
||||
Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(imgView);
|
||||
}
|
||||
else
|
||||
{
|
||||
Picasso.With(Android.App.Application.Context).Load(current.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Into(imgView);
|
||||
}
|
||||
|
||||
bar = playerView.FindViewById<SeekBar>(Resource.Id.songTimer);
|
||||
MusicPlayer.SetSeekBar(bar);
|
||||
@@ -103,11 +110,19 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Song next = MusicPlayer.queue[MusicPlayer.CurrentID() + 1];
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextTitle).Text = "Next music:";
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextArtist).Text = next.GetName();
|
||||
|
||||
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, next.GetAlbumArt());
|
||||
|
||||
ImageView nextArt = playerView.FindViewById<ImageView>(Resource.Id.nextArt);
|
||||
Picasso.With(Android.App.Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(nextArt);
|
||||
|
||||
if(next.GetAlbum() == null)
|
||||
{
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, next.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(nextArt);
|
||||
}
|
||||
else
|
||||
{
|
||||
Picasso.With(Android.App.Application.Context).Load(next.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Into(nextArt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -133,11 +148,17 @@ namespace MusicApp.Resources.Portable_Class
|
||||
title.Text = current.GetName();
|
||||
artist.Text = current.GetArtist();
|
||||
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, current.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(imgView);
|
||||
if (current.GetAlbum() == null)
|
||||
{
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, current.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(imgView);
|
||||
}
|
||||
else
|
||||
{
|
||||
Picasso.With(Android.App.Application.Context).Load(current.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Into(imgView);
|
||||
}
|
||||
|
||||
bool asNext = MusicPlayer.queue.Count > MusicPlayer.CurrentID() + 1;
|
||||
if (asNext)
|
||||
@@ -145,11 +166,19 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Song next = MusicPlayer.queue[MusicPlayer.CurrentID() + 1];
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextTitle).Text = "Next music:";
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextArtist).Text = next.GetName();
|
||||
|
||||
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, next.GetAlbumArt());
|
||||
|
||||
ImageView nextArt = playerView.FindViewById<ImageView>(Resource.Id.nextArt);
|
||||
Picasso.With(Android.App.Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(nextArt);
|
||||
|
||||
if (next.GetAlbum() == null)
|
||||
{
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, next.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(nextArt);
|
||||
}
|
||||
else
|
||||
{
|
||||
Picasso.With(Android.App.Application.Context).Load(next.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Into(nextArt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -236,6 +236,9 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.PutExtra("file", streamInfo.Url);
|
||||
intent.PutExtra("title", videoInfo.Title);
|
||||
intent.PutExtra("artist", videoInfo.Author.Title);
|
||||
intent.PutExtra("thumbnailURI", videoInfo.ImageThumbnailUrl);
|
||||
Android.App.Application.Context.StartService(intent);
|
||||
}
|
||||
|
||||
|
||||
672
MusicApp/Resources/Resource.Designer.cs
generated
672
MusicApp/Resources/Resource.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,6 @@
|
||||
public long GetAlbumArt() { return AlbumArt; }
|
||||
public long GetID() { return id; }
|
||||
public string GetPath() { return path; }
|
||||
|
||||
|
||||
public Song(string Name, string Artist, string Album, long AlbumArt, long id, string path)
|
||||
{
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
Additions allow you to add arbitrary C# to the generated classes
|
||||
before they are compiled. This can be helpful for providing convenience
|
||||
methods or adding pure C# classes.
|
||||
|
||||
== Adding Methods to Generated Classes ==
|
||||
|
||||
Let's say the library being bound has a Rectangle class with a constructor
|
||||
that takes an x and y position, and a width and length size. It will look like
|
||||
this:
|
||||
|
||||
public partial class Rectangle
|
||||
{
|
||||
public Rectangle (int x, int y, int width, int height)
|
||||
{
|
||||
// JNI bindings
|
||||
}
|
||||
}
|
||||
|
||||
Imagine we want to add a constructor to this class that takes a Point and
|
||||
Size structure instead of 4 ints. We can add a new file called Rectangle.cs
|
||||
with a partial class containing our new method:
|
||||
|
||||
public partial class Rectangle
|
||||
{
|
||||
public Rectangle (Point location, Size size) :
|
||||
this (location.X, location.Y, size.Width, size.Height)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
At compile time, the additions class will be added to the generated class
|
||||
and the final assembly will a Rectangle class with both constructors.
|
||||
|
||||
|
||||
== Adding C# Classes ==
|
||||
|
||||
Another thing that can be done is adding fully C# managed classes to the
|
||||
generated library. In the above example, let's assume that there isn't a
|
||||
Point class available in Java or our library. The one we create doesn't need
|
||||
to interact with Java, so we'll create it like a normal class in C#.
|
||||
|
||||
By adding a Point.cs file with this class, it will end up in the binding library:
|
||||
|
||||
public class Point
|
||||
{
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
This directory is for Android .jars.
|
||||
|
||||
There are 3 types of jars that are supported:
|
||||
|
||||
== Input Jar and Embedded Jar ==
|
||||
|
||||
This is the jar that bindings should be generated for.
|
||||
|
||||
For example, if you were binding the Google Maps library, this would
|
||||
be Google's "maps.jar".
|
||||
|
||||
The difference between EmbeddedJar and InputJar is, EmbeddedJar is to be
|
||||
embedded in the resulting dll as EmbeddedResource, while InputJar is not.
|
||||
There are couple of reasons you wouldn't like to embed the target jar
|
||||
in your dll (the ones that could be internally loaded by <uses-library>
|
||||
feature e.g. maps.jar, or you cannot embed jars that are under some
|
||||
proprietary license).
|
||||
|
||||
Set the build action for these jars in the properties page to "InputJar".
|
||||
|
||||
|
||||
== Reference Jar and Embedded Reference Jar ==
|
||||
|
||||
These are jars that are referenced by the input jar. C# bindings will
|
||||
not be created for these jars. These jars will be used to resolve
|
||||
types used by the input jar.
|
||||
|
||||
NOTE: Do not add "android.jar" as a reference jar. It will be added automatically
|
||||
based on the Target Framework selected.
|
||||
|
||||
Set the build action for these jars in the properties page to "ReferenceJar".
|
||||
|
||||
"EmbeddedJar" works like "ReferenceJar", but like "EmbeddedJar", it is
|
||||
embedded in your dll. But at application build time, they are not included
|
||||
in the final apk, like ReferenceJar files.
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,23 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Android.App;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
[assembly: AssemblyTitle ("YouTubeApi")]
|
||||
[assembly: AssemblyDescription ("")]
|
||||
[assembly: AssemblyConfiguration ("")]
|
||||
[assembly: AssemblyCompany ("")]
|
||||
[assembly: AssemblyProduct ("")]
|
||||
[assembly: AssemblyCopyright ("Nish")]
|
||||
[assembly: AssemblyTrademark ("")]
|
||||
[assembly: AssemblyCulture ("")]
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
[assembly: AssemblyVersion ("1.0.0")]
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<enum-field-mappings>
|
||||
<!--
|
||||
This example converts the constants Fragment_id, Fragment_name,
|
||||
and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag
|
||||
to an enum called Android.Support.V4.App.FragmentTagType with values
|
||||
Id, Name, and Tag.
|
||||
|
||||
<mapping clr-enum-type="Android.Support.V4.App.FragmentTagType" jni-class="android/support/v4/app/FragmentActivity$FragmentTag">
|
||||
<field clr-name="Id" jni-name="Fragment_id" value="1" />
|
||||
<field clr-name="Name" jni-name="Fragment_name" value="0" />
|
||||
<field clr-name="Tag" jni-name="Fragment_tag" value="2" />
|
||||
</type>
|
||||
|
||||
Notes:
|
||||
- An optional "bitfield" attribute marks the enum type with [Flags].
|
||||
- For Java interfaces, use "jni-interface" attribute instead of "jni-class" attribute.
|
||||
-->
|
||||
</enum-field-mappings>
|
||||
@@ -1,18 +0,0 @@
|
||||
<enum-method-mappings>
|
||||
<!--
|
||||
This example changes the Java method:
|
||||
android.support.v4.app.Fragment.SavedState.writeToParcel (int flags)
|
||||
to be:
|
||||
android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags)
|
||||
when bound in C#.
|
||||
|
||||
<mapping jni-class="android/support/v4/app/Fragment.SavedState">
|
||||
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" />
|
||||
</mapping>
|
||||
|
||||
Notes:
|
||||
- For Java interfaces, use "jni-interface" attribute instead of "jni-class" attribute.
|
||||
- To change the type of the return value, use "return" as the parameter name.
|
||||
- The parameter names will be p0, p1, ... unless you provide JavaDoc file in the project.
|
||||
-->
|
||||
</enum-method-mappings>
|
||||
@@ -1,13 +0,0 @@
|
||||
<metadata>
|
||||
<!--
|
||||
This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask:
|
||||
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" />
|
||||
|
||||
This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground:
|
||||
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
|
||||
-->
|
||||
<attr path="/api/package[@name='com.google.android.youtube.player']" name="managedName">Google.YouTube.Player</attr>
|
||||
|
||||
<remove-node path="/api/package[@name='com.google.android.youtube.player']/class[@name='YouTubePlayerView']/method[@name='onConfigurationChanged' and count(parameter)=1 and parameter[1][@type='android.content.res.Configuration']]" />
|
||||
<remove-node path="/api/package[@name='com.google.android.youtube.player']/class[@name='YouTubeThumbnailView']/method[@name='finalize' and count(parameter)=0]" />
|
||||
</metadata>
|
||||
@@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A4CA43B8-7140-4483-96BA-6AFC8E935470}</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>YouTubeApi</RootNamespace>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
||||
<AssemblyName>YouTubeApi</AssemblyName>
|
||||
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
|
||||
<ReleaseVersion>1.2.1</ReleaseVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;__MOBILE__;__ANDROID__;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<DefineConstants>__MOBILE__;__ANDROID__;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Mono.Android" />
|
||||
<Reference Include="Mono.Android.Support.v4" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Additions\AboutAdditions.txt" />
|
||||
<None Include="Jars\AboutJars.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<TransformFile Include="Transforms\EnumFields.xml" />
|
||||
<TransformFile Include="Transforms\EnumMethods.xml" />
|
||||
<TransformFile Include="Transforms\Metadata.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Novell\Xamarin.Android.Bindings.targets" />
|
||||
<ItemGroup>
|
||||
<EmbeddedJar Include="Jars\YouTubeAndroidPlayerApi.jar" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user