Skip to content

Commit

Permalink
1.2.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
edatkinvey committed Mar 11, 2015
1 parent 6685fec commit 95524a2
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Android-Libtester/Android-Libtester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<AndroidApplication>True</AndroidApplication>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<AssemblyName>Android-Libtester</AssemblyName>
<TargetFrameworkVersion>v4.4</TargetFrameworkVersion>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
36 changes: 14 additions & 22 deletions Kinvey-Xamarin.userprefs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<Properties StartupItem="../../ksamples/xamarin/TestDrive-Xamarin/android/Android-TestDrive.csproj">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release" PreferredExecutionTarget="Android.SelectDevice" />
<MonoDevelop.Ide.Workbench ActiveDocument="Kinvey-Xamarin/Core/KinveyHeaders.cs">
<Properties StartupItem="../../ksamples/xamarin/StatusShare-Xamarin/android/Android-StatusShare.csproj">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Android.lollipop" />
<MonoDevelop.Ide.Workbench ActiveDocument="../../ksamples/xamarin/StatusShare-Xamarin/android/src.model/UpdateEntity.cs">
<Files>
<File FileName="Kinvey-Xamarin-Android/Push/KinveyGCMService.cs" Line="6" Column="6" />
<File FileName="../../ksamples/xamarin/TestDrive-Xamarin/android/MyGCMBroadcastReceiver.cs" Line="1" Column="1" />
<File FileName="Kinvey-Xamarin-Android/Push/Push.cs" Line="1" Column="1" />
<File FileName="../../ksamples/xamarin/TestDrive-Xamarin/android/MyIntentService.cs" Line="1" Column="1" />
<File FileName="../../ksamples/xamarin/TestDrive-Xamarin/android/Properties/AndroidManifest.xml" Line="1" Column="1" />
<File FileName="Kinvey-Xamarin/Core/KinveyHeaders.cs" Line="41" Column="41" />
<File FileName="../../ksamples/xamarin/StatusShare-Xamarin/android/src.component/MyGCMBroadcastReceiver.cs" Line="37" Column="37" />
<File FileName="../../ksamples/xamarin/StatusShare-Xamarin/android/src.component/UpdateAdapter.cs" Line="1" Column="1" />
<File FileName="../../ksamples/xamarin/StatusShare-Xamarin/android/src.component/MyIntentService.cs" Line="1" Column="1" />
<File FileName="../../ksamples/xamarin/StatusShare-Xamarin/android/src.model/UpdateEntity.cs" Line="4" Column="4" />
<File FileName="Kinvey-Xamarin/File/KinveyFileRequest.cs" Line="1" Column="1" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
Expand Down Expand Up @@ -51,28 +50,21 @@
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/File/KinveyFileRequest.cs" line="131" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/File/KinveyFileRequest.cs" line="129" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/File/KinveyFileRequest.cs" line="107" column="1" />
<Breakpoint file="/Users/edward/code/ksamples/xamarin/StatusShare-Xamarin/android/src.component/UpdateAdapter.cs" line="47" column="1" />
<Breakpoint file="/Users/edward/code/ksamples/xamarin/StatusShare-Xamarin/android/src.model/UpdateEntity.cs" line="84" column="1" />
<Breakpoint file="/Users/edward/code/ksamples/xamarin/StatusShare-Xamarin/android/src.model/UpdateEntity.cs" line="93" column="1" />
<Breakpoint file="/Users/edward/code/ksamples/xamarin/StatusShare-Xamarin/android/src.fragments/ShareListFragment.cs" line="72" column="1" />
<Breakpoint file="/Users/edward/code/ksamples/xamarin/StatusShare-Xamarin/android/src.model/UpdateEntity.cs" line="89" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/File/KinveyFileRequest.cs" line="34" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/File/KinveyFileRequest.cs" line="40" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/File/KinveyFileRequest.cs" line="69" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/File/KinveyFileRequest.cs" line="70" column="16" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Async/AsyncAppData.cs" line="74" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/RestSharp.Portable/RestClient.cs" line="308" column="26" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/RestSharp.Portable/RestClient.cs" line="324" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Offline/AbstractKinveyOfflineClientRequest.cs" line="140" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Core/AbstractKinveyClientRequest.cs" line="357" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Offline/BackgroundExecutor.cs" line="170" column="9" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Core/AbstractKinveyClientRequest.cs" line="296" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Core/AbstractKinveyClientRequest.cs" line="300" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin-Android/Push/Push.cs" line="118" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Core/AbstractKinveyClientRequest.cs" line="354" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin-Android/Push/KinveyGCMService.cs" line="36" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin-Android/Push/Push.cs" line="64" column="1" />
<Breakpoint file="/Users/edward/code/ksamples/xamarin/TestDrive-Xamarin/android/MyIntentService.cs" line="30" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin-Android/Push/Push.cs" line="60" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Core/AbstractKinveyClientRequest.cs" line="372" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Core/AbstractKinveyClientRequest.cs" line="382" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Core/AbstractKinveyClientRequest.cs" line="377" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Core/AbstractKinveyClientRequest.cs" line="363" column="1" />
<Breakpoint file="/Users/edward/code/klibs/Kinvey-Xamarin/Kinvey-Xamarin/Core/AbstractKinveyClientRequest.cs" line="307" column="1" />
</BreakpointStore>
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.DebuggingService.PinnedWatches>
Expand Down
10 changes: 6 additions & 4 deletions Kinvey-Xamarin/Async/AsyncFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ public AsyncFile (AbstractClient client) : base(client)
/// <param name="metadata">The FileMetaData representing the file to download. This must contain an id.</param>
/// <param name="content">Where the contents of the file will be streamed.</param>
/// <param name="delegates">Delegates for success or failure.</param>
public void download(FileMetaData metadata, Stream content, KinveyDelegate<FileMetaData> delegates)
public void download(FileMetaData metadata, Stream content, KinveyFileDelegate delegates)
{
Task.Run (() => {
try {
FileMetaData entity = base.downloadBlocking (metadata).executeAndDownloadTo (content);
delegates.onSuccess (entity);
Stream stream = new MemoryStream();
FileMetaData entity = base.downloadBlocking (metadata).executeAndDownloadTo (ref stream);
//delegates.onSuccess (entity);
delegates.onDownload(stream);
} catch (Exception e) {
delegates.onError (e);
}
Expand All @@ -55,7 +57,7 @@ public void download(FileMetaData metadata, Stream content, KinveyDelegate<FileM
/// <param name="metadata">The FileMetaData representing the file to download. This must contain an id.</param>
/// <param name="content">Content.</param>
/// <param name="delegates">Delegates for success or failure.</param>
public void download(FileMetaData metadata, byte[] content, KinveyDelegate<FileMetaData> delegates)
public void download(FileMetaData metadata, byte[] content, KinveyDelegate<FileMetaData> delegates)
{
Task.Run (() => {
try {
Expand Down
19 changes: 19 additions & 0 deletions Kinvey-Xamarin/Async/KinveyFileDelegate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.IO;

namespace KinveyXamarin
{
/// <summary>
/// The Kinvey File Delegate class is used for the callback pattern when executing file specific requests asynchronously. All Async* File methods will take one as a parameter.
/// </summary>
public class KinveyFileDelegate : KinveyDelegate<FileMetaData>
{
/// <summary>
/// This Action is executed when the file is downloaded.
/// </summary>
public Action<Stream> onDownload;


}
}

2 changes: 1 addition & 1 deletion Kinvey-Xamarin/Core/KinveyHeaders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class KinveyHeaders : List<HttpHeader>
/// <summary>
/// The version of the library.
/// </summary>
private static string version = "1.2.0";
private static string version = "1.2.1";

/// <summary>
/// The kinvey API version key.
Expand Down
13 changes: 9 additions & 4 deletions Kinvey-Xamarin/File/KinveyFileRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public FileMetaData executeAndDownloadTo (byte[] output){
return metadata;
}

public FileMetaData executeAndDownloadTo(Stream stream){
public FileMetaData executeAndDownloadTo(ref Stream stream){
FileMetaData metadata = base.Execute ();
downloadFile (metadata, stream);
downloadFile (metadata, ref stream);
return metadata;
}

Expand All @@ -53,19 +53,24 @@ public FileMetaData executeAndUploadFrom(Stream stream){
return metadata;
}

private void downloadFile(FileMetaData metadata, Stream stream){
private void downloadFile(FileMetaData metadata, ref Stream stream){
string downloadURL = metadata.downloadURL;

RestClient client = new RestClient (downloadURL);
RestRequest request = new RestRequest ();

request.Method = Method.GET;

request.ResponseWriter = (responseStream) => responseStream.CopyTo (stream);
//request.ResponseWriter = (responseStream) => responseStream.CopyTo (stream);

var req = client.DownloadDataAsync (request);
var response = req.Result;


//stream = new MemoryStream();
//stream.Write(response, 0, response.Length);
//stream.
//
stream = new MemoryStream (response);
var x = 123;
}
Expand Down
1 change: 1 addition & 0 deletions Kinvey-Xamarin/Kinvey-Xamarin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<Compile Include="Async\AsyncCustomEndpoint.cs" />
<Compile Include="Model\KinveyFile.cs" />
<Compile Include="Model\AccessControlList.cs" />
<Compile Include="Async\KinveyFileDelegate.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
Expand Down
Binary file added release/kinvey-xamarin-1.2.1.zip
Binary file not shown.
Binary file added release/kinvey-xamarin-1.2.1/Kinvey-Utils.dll
Binary file not shown.
Binary file added release/kinvey-xamarin-1.2.1/Kinvey-Xamarin.dll
Binary file not shown.
9 changes: 9 additions & 0 deletions release/kinvey-xamarin-1.2.1/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
1. Right click the *References* folder within your project -> **Edit References** -> **.Net Assembly** -> Navigate to download location of kinvey library, and add all the dll files.
2. Right click your project -> **Add** -> **Add Packages**
1. Add "Json.NET" v6.0.6
2. Add "SQLite.Net.Async PCL" v2.4.1
3. Add "SQLite.Net PCL - <runtime> Platform" v2.4.1 where <runtime> is your project's target platform
4. Add "LinqExtender" v3.0.1
5. Add "Microsoft HTTP Client Libraries" v2.2.28
6. Add "Microsoft Async" v1.0.168
7. Add "Microsoft BCL Build Components" v1.0.14
Binary file not shown.

0 comments on commit 95524a2

Please sign in to comment.