All Projects → sushihangover → Realm.json.extensions

sushihangover / Realm.json.extensions

Licence: apache-2.0
Extension Methods for adding JSON APIs to a Realm Instance

Projects that are alternatives of or similar to Realm.json.extensions

Gittrends
A iOS and Android app to monitor the views and clones of your GitHub repos
Stars: ✭ 388 (+4211.11%)
Mutual labels:  xamarin, xamarin-android, xamarin-ios
Awesome Xamarin
A curated list of awesome Xamarin iOS/Android and Xamarin Forms bindings, ports, frameworks and much more!
Stars: ✭ 394 (+4277.78%)
Mutual labels:  xamarin, xamarin-android, xamarin-ios
XamarinAzureChallenge
Create an iOS/Android app using Xamarin.Forms and connect it to a serverless Azure Function
Stars: ✭ 59 (+555.56%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
arcgis-runtime-demos-dotnet
Demo applications provided by the ArcGIS Runtime SDK for .NET Team
Stars: ✭ 51 (+466.67%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
Docs Archive
Xamarin docs archive
Stars: ✭ 553 (+6044.44%)
Mutual labels:  xamarin, xamarin-android, xamarin-ios
xamarin-chat-signalr
Xamarin Forms Modern Chat Using SignalR ASP.NET
Stars: ✭ 12 (+33.33%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
Open Source Xamarin Apps
📱 Collaborative List of Open Source Xamarin Apps
Stars: ✭ 318 (+3433.33%)
Mutual labels:  xamarin, xamarin-android, xamarin-ios
Plugin.NFC
A Cross-Platform NFC (Near Field Communication) plugin to easily read and write NFC tags in your application.
Stars: ✭ 113 (+1155.56%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
Xamarin Bluetooth Le
Bluetooth LE plugin for Xamarin
Stars: ✭ 419 (+4555.56%)
Mutual labels:  xamarin, xamarin-android, xamarin-ios
SimpleXamarinGraphQL
An iOS and Android app built in Xamarin.Forms demonstrating how to interact with GitHub's GraphQL API
Stars: ✭ 18 (+100%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
WeakEventListener
The WeakEventListener allows the owner to be garbage collected if its only remaining link is an event handler.
Stars: ✭ 25 (+177.78%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
32feet
Personal Area Networking for .NET
Stars: ✭ 395 (+4288.89%)
Mutual labels:  xamarin, xamarin-android, xamarin-ios
XamCall
XamDesign Xamarin Forms Call screen Ui Design
Stars: ✭ 25 (+177.78%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
Arcgis Runtime Samples Dotnet
Sample code for ArcGIS Runtime SDK for .NET – UWP, WPF, Xamarin.Android, Xamarin.iOS, and Xamarin.Forms
Stars: ✭ 274 (+2944.44%)
Mutual labels:  xamarin, xamarin-android, xamarin-ios
InvestmentDataSampleApp
This app utilizes a SQLite databse, MVVM, along with these Xamarin.Forms controls: Search Bar, Picker, Grid, StackLayout, Navigation Page, ListView, ViewCell. It also shows how to tweak the UI to best appear on larger tablet screens.
Stars: ✭ 56 (+522.22%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
DarkModeSplashScreen
A sample app for iOS and Android written in Xamarin.Forms showing how to implement a Splash Page for Dark Mode
Stars: ✭ 28 (+211.11%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
vs-material-icons-generator
This plugin will help you to set material design icons to your Xamarin projects In Visual Studio.
Stars: ✭ 50 (+455.56%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
Xamarin.MediaGallery
This plugin is designed to picking and save images and video files from native gallery of Android and iOS devices and capture photos
Stars: ✭ 106 (+1077.78%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
InteractiveAlert-Xamarin
Interactive alerts to Xamarin
Stars: ✭ 17 (+88.89%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android
CouchDraw
A synchronized drawing app that utilizes Couchbase Sync Gateway and Xamarin to enable shared canvases.
Stars: ✭ 22 (+144.44%)
Mutual labels:  xamarin, xamarin-ios, xamarin-android

SushiHangover.RealmJson.Extensions

Extension Methods for adding JSON APIs to a Realm Instance

Current project status:

Build status

Nuget:

PM> Install-Package RealmJson.Extensions

Ref: https://www.nuget.org/packages/RealmJson.Extensions

Issues?

###Post issues on GitHub

Need Help?

Post on StackOverflow with the tags: [XAMARIN] [REALM] [JSON]

API Reference:

https://sushihangover.github.io/Realm.Json.Extensions/

Extension API:

  • A Realm Instance:

    • .CreateAllFromJson<T>(string)
    • .CreateAllFromJson<T>(Stream)
    • .CreateAllFromJsonViaAutoMapper<T>(Stream)
    • .CreateObjectFromJson<T>(string)
    • .CreateObjectFromJson<T>(Stream)
    • .CreateOrUpdateObjectFromJson<T>(string)
    • .CreateOrUpdateObjectFromJson<T>(Stream)
    • .CreateOrUpdateObjectFromJson<T>(Stream)
  • A RealmObject Instance:

    • .NonManagedCopy<T>()
  • A RealmResult Instance (IQueryable):

    • .NonManagedCopy

Github Repo:

https://github.com/sushihangover/Realm.Json.Extensions

Usage / Examples:

Copy a managed object to a non-managed instacne:

var syncedObject = realmObject.NonManagedCopy<ARealmClass>();

Re: https://stackoverflow.com/a/46629763/4984832

Single RealmObject from Json-based string:

using (var theRealm = Realm.GetInstance(RealmDBTempPath()))
{
	var realmObject = theRealm.CreateObjectFromJson<StateUnique>(jsonString);
}

Single RealmObject from a Stream:

using (var stream = new MemoryStream(byteArray))
using (var theRealm = Realm.GetInstance(RealmDBTempPath()))
{
	var testObject = theRealm.CreateObjectFromJson<StateUnique>(stream);
}

Using Json Arrays from a Android Asset Stream:

using (var theRealm = Realm.GetInstance(RealmDBTempPath()))
using (var assetStream = Application.Context.Assets.Open("States.json"))
{
	theRealm.CreateAllFromJson<State>(assetStream);
}

Using Json Arrays from a iOS Bundled Resource Stream:

using (var theRealm = Realm.GetInstance(RealmDBTempPath()))
using (var fileStream = new FileStream("./Data/States.json", FileMode.Open, FileAccess.Read))
{
	theRealm.CreateAllFromJson<State>(fileStream);
}

Note: Consult the Unit Tests for more usage details

(1)Xamarin.Forms Usage

AutoMapper does not support PCL Profile 259(2)) and thus adding this Nuget package will fail if applied to a default Xamarin.Form project.

You can change your Xamarin.From project to Profile 111, then retarget the Xamarin.Forms package, and you will be able to add the Nuget package.

See the Xamarin.Forms-based (Nuget.Test) project in the code repo as an example.

Note: Once Xamarin has full support for .NET Standard and AutoMapper releases v5.2 (3), this mess should go away.

(2) https://github.com/AutoMapper/AutoMapper/issues/1531

(3) https://github.com/AutoMapper/AutoMapper/issues/1532

##Build Documention:

API Reference documention is built via the great doxygen

doxygen Doxygen/realmthread.config

Building:

xbuild or msbuild based:

xbuild /p:SolutionDir=./ /target:Clean /p:Configuration=Release   RealmJson.Extensions/RealmJson.Extensions.csproj
xbuild /p:SolutionDir=./ /target:Build /p:Configuration=Release RealmJson.Extensions/RealmJson.Extensions.csproj

Testing / NUnitLite Automation:

Xamarin.Android

adb shell am instrument -w RealmJson.Test.Droid/app.tests.TestInstrumentation

Ref: Automate Android Nunit Test

Ref: Issue 32005

Xamarin.iOS

xbuild RealmJson.Test.iOS/RealmJson.Test.iOS.csproj /p:SolutionDir=~/
xcrun simctl list
open -a Simulator --args -CurrentDeviceUDID 360D3BC6-4A6D-4B7E-A899-5C7651EC2107
xcrun simctl install booted  ./RealmJson.Test.iOS/bin/iPhoneSimulator/Debug/RealmJson.Test.iOS.app
xcrun simctl launch booted com.sushihangover.realmjson-test-ios
cat ~/Library/Logs/CoreSimulator/360D3BC6-4A6D-4B7E-A899-5C7651EC2107/system.log

Performance Testing:

There is a #if PERF within Tests.Shared.Perf.Streaming.cs that contains multple tests to evaluate streaming performance and memory overhead.

These test methods try to evaluate:

  1. Realm.Manage vs. AutoMapper performance/effeciency
  2. Upper limits of the number of RealmObjects can be used in a Realm Transaction on a mobile device.

See Perf.md for details.

License

Consult LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].