Giter Club home page Giter Club logo

graco911 / cloudrail-si-xamarin-android-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from agik45tt/cloudrail-si-xamarin-android-sdk

0.0 1.0 0.0 67.1 MB

Unified API Library for: Cloud Storage, Social Log-In, Social Interaction, Payment, Email, SMS, POIs, Video & Messaging. Included services are Dropbox, Google Drive, OneDrive, OneDrive for Business, Box, Egnyte, PayPal, Stripe, Google Places, Foursquare, Yelp, YouTube, Vimeo, Twitch, Facebook Messenger, Telegram, Line, Viber, Facebook, GitHub, Google+, LinkedIn, Slack, Twitter, Windows Live, Yahoo, Mailjet, Sendgrid, Twilio, Nexmo, Twizo.

Home Page: https://cloudrail.com

cloudrail-si-xamarin-android-sdk's Introduction

Click for Xamarin.iOS Version

CloudRail SI for Xamarin Android

Integrate Multiple Services With Just One API

CloudRail is an API integration solution which abstracts multiple APIs from different providers into a single and universal interface.

Current Interfaces:



Full documentation can be found at our website.

Learn more about CloudRail on https://cloudrail.com



With CloudRail, you can easily integrate external APIs into your application. CloudRail is an abstracted interface that takes several services and then gives a developer-friendly API that uses common functions between all providers. This means that, for example, Upload() works in exactly the same way for Dropbox as it does for Google Drive, OneDrive, and other Cloud Storage Services, and GetEmail() works similarly the same way across all social networks.

Download Nuget Package or DLL and Basic setup

You can download CloudRail SDK Nuget Package from: https://www.nuget.org/packages/Xamarin.CloudRail.Android Or just download and add the DLL cloudrail-si-xamarin-android-sdk.dll file to your project reference and starting using it

using Com.Cloudrail.SI;

CloudRail.AppKey = "{Your_License_Key}";

Get a free license key here

Current Interfaces

Interface Included Services
Cloud Storage Dropbox, Google Drive, OneDrive, Box, pCloud, Egnyte, OneDrive Business
Business Cloud Storage AmazonS3, Microsoft Azure, Rackspace, Backblaze, Google Cloud Platform
Social Profiles Facebook, GitHub, Google+, LinkedIn, Slack, Twitter, Windows Live, Yahoo, Instagram, Heroku
Social Interaction Facebook, FacebookPage, Twitter
Payment PayPal, Stripe
Email Maljet, Sendgrid, Gmail
SMS Twilio, Nexmo
Point of Interest Google Places, Foursquare, Yelp
Video YouTube, Twitch, Vimeo
Messaging Facebook Messenger, Telegram, Line, Viber

Cloud Storage Interface:

  • Dropbox
  • Box
  • Google Drive
  • Microsoft OneDrive
  • pCloud
  • Egnyte
  • OneDrive Business

Features:

  • Download files from Cloud Storage.
  • Upload files to Cloud Storage.
  • Upload files with modified date to Cloud Storage.
  • Get Meta Data of files, folders and perform all standard operations (copy, move, etc) with them.
  • Retrieve user and quota information.
  • Generate share links for files and folders.

Full Documentation

Code Example:

using Com.Cloudrail.SI;
using Com.Cloudrail.SI.Interfaces;
using Com.Cloudrail.SI.Exceptions;
using Com.Cloudrail.SI.Services;
using Com.Cloudrail.SI.Types;

CloudRail.AppKey = "{Your_License_Key};

// ICloudStorage cs = new Box(this, "[clientIdentifier]", "[clientSecret]");
// ICloudStorage cs = new OneDrive(this, "[clientIdentifier]", "[clientSecret]");
// ICloudStorage cs = new PCloud(this, "[clientIdentifier]", "[clientSecret]");

// Google Drive:
// GoogleDrive drive = new GoogleDrive(this, "[clientIdentifier]", "", "[redirectUri]", "[state]");
// drive.UseAdvancedAuthentication();
// ICloudStorage cs = drive;

ICloudStorage cs = new Dropbox(this, "[clientIdentifier]", "[clientSecret]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
        IList<CloudMetaData> filesFolders = cs.GetChildren("/");
        //IList<CloudMetaData> filesFolders = cs.GetChildrenPage("/", 1, 4);  // Path, Offet, Limit
        //cs.Upload(/image_2.jpg,stream,1024,true);   // Path and Filename, Stream (data), Size, overwrite (true/false)
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }
})).Start();

Business Cloud Storage Interface:

  • Amazon S3
  • Microsoft Azure
  • Rackspace
  • Backblaze
  • Google Cloud Platform

Features:

  • Create, delete and list buckets
  • Upload files
  • Download files
  • List files in a bucket and delete files
  • Get file metadata (last modified, size, etc.)

Full Documentation

Code Sample

using Com.Cloudrail.SI;
using Com.Cloudrail.SI.Interfaces;
using Com.Cloudrail.SI.Exceptions;
using Com.Cloudrail.SI.Services;
using Com.Cloudrail.SI.Types;

CloudRail.AppKey = "{Your_License_Key};


// IBusinessCloudStorage cs = new MicrosoftAzure(this, "[accountName]", "[accessKey]");
// IBusinessCloudStorage cs = new Rackspace(this, "[username]", "[apiKey]", "[region]");
// IBusinessCloudStorage cs = new Backblaze(this, "[accountId]", "[appKey]");
// IBusinessCloudStorage cs = new GoogleCloudPlatform(this, "[clientEmail]", "[privateKey]", "[projectId]");
IBusinessCloudStorage cs = new AmazonS3(this, "[accessKeyId]", "[secretAccessKey]", "[region]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
        Bucket bucket = cs.CreateBucket("");
        AssetManager assetManager = this.Assets;
        System.IO.Stream stream = assetManager.Open("UserData.csv");
        long size = assetManager.OpenFd("UserData.csv").Length;
        cs.UploadFile(bucket,"Data.csv",stream,size);
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

})).Start();

Social Media Profiles Interface:

  • Facebook
  • Github
  • Google Plus
  • LinkedIn
  • Slack
  • Twitter
  • Windows Live
  • Yahoo
  • Instagram
  • Heroku

Features

  • Get profile information, including full names, emails, genders, date of birth, and locales.
  • Retrieve profile pictures.
  • Login using the Social Network.

Full Documentation

Code Example:

using Com.Cloudrail.SI;
using Com.Cloudrail.SI.Interfaces;
using Com.Cloudrail.SI.Exceptions;
using Com.Cloudrail.SI.Services;
using Com.Cloudrail.SI.Types;

CloudRail.AppKey = "{Your_License_Key};


// Google Plus:
// GooglePlus gPlus = new GooglePlus(this, "[clientIdentifier]", "", "[redirectUri]", "[state]");
// gPlus.UseAdvancedAuthentication();
// IProfile profile = gPlus;


// IProfile profile = new GitHub(this, "[clientIdentifier]", "[clientSecret]");
// IProfile = new Slack(this, "[clientIdentifier]", "[clientSecret]");
// IProfile = new Instagram(this, "[clientIdentifier]", "[clientSecret]");
// ...
IProfile profile = new Facebook(this, "[clientIdentifier]", "[clientSecret]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
       string email = profile.Email;
       string fullname = profile.FullName;
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

})).Start();

Social Media Interaction Interface:

  • Facebook
  • FacebookPage
  • Twitter

Features

  • Get a list of connections.
  • Make a post for the user.
  • Post images and videos.

Full Documentation

Code Example:

using Com.Cloudrail.SI;
using Com.Cloudrail.SI.Interfaces;
using Com.Cloudrail.SI.Exceptions;
using Com.Cloudrail.SI.Services;
using Com.Cloudrail.SI.Types;

CloudRail.AppKey = "{Your_License_Key};


// ISocial social = new Twitter(this, "[clientID]", "[clientSecret]");
// ISocial social = new Facebook(this, "[pageName]", "[clientID]", "[clientSecret]");
ISocial social = new Facebook(this, "[clientID]", "[clientSecret]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
       social.PostUpdate("Hey there! I'm using CloudRail.");
       IList<String> connections = social.Connections;
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

})).Start();

Payment Interface:

  • PayPal
  • Stripe

Features

  • Perform charges
  • Refund previously made charges
  • Manage subscriptions

Full Documentation

Code Example

using Com.Cloudrail.SI;
using Com.Cloudrail.SI.Interfaces;
using Com.Cloudrail.SI.Exceptions;
using Com.Cloudrail.SI.Services;
using Com.Cloudrail.SI.Types;

CloudRail.AppKey = "{Your_License_Key};


// IPayment payment = new Stripe(this, "[secretKey]");
IPayment payment = new PayPal(this, true, "[clientIdentifier]", "[clientSecret]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
       CreditCard source = new CreditCard(null, (Java.Lang.Long)6, (Java.Lang.Long)2021, "xxxxxxxxxxxxxxxx", "visa", "<FirstName>", "<LastName>", null);
       Charge charge = payment.CreateCharge((Java.Lang.Long)500, "USD", source);
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

})).Start();

Email Interface:

  • Mailjet
  • Sendgrid
  • Gmail

Features

  • Send Email (with Attachments)

Full Documentation

Code Example

using Com.Cloudrail.SI;
using Com.Cloudrail.SI.Interfaces;
using Com.Cloudrail.SI.Exceptions;
using Com.Cloudrail.SI.Services;
using Com.Cloudrail.SI.Types;

CloudRail.AppKey = "{Your_License_Key};


// IEmail email = new MailJet(this, "[clientIdentifier]", "[clientSecret]");
// IEmail email = new GMail(this, "[clientIdentifier]", "", "[redirectUri]", "[state]");
IEmail email = new SendGrid(this, "API Key");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
       IList<string> toAddresses = new List<string>();
       toAddresses.Add("[email protected]");
       toAddresses.Add("[email protected]");
       
       Attachment imageFile = new Attachment(Stream, "image/jpg", "File.jpg"); //Stream, MimeType, File Name
       IList<Attachment> attachments = new List<Attachment>();
       attachments.Add(imageFile);
       
       email.SendEmail("[email protected]", "CloudRail", toAddresses, "Welcome", "Hello from CloudRail", null, null, null, attachments);
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

})).Start();

SMS Interface:

  • Twilio
  • Nexmo
  • Twizo

Features

  • Send SMS

Full Documentation

Code Example

using Com.Cloudrail.SI;
using Com.Cloudrail.SI.Interfaces;
using Com.Cloudrail.SI.Exceptions;
using Com.Cloudrail.SI.Services;
using Com.Cloudrail.SI.Types;

CloudRail.AppKey = "{Your_License_Key};


// ISMS sms = new Nexmo(this, "[clientIdentifier]", "[clientSecret]");
ISMS sms = new Twilio(this, "[clientIdentifier]", "[clientSecret]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
       sms.SendSMS("CloudRail", "+4912345678", "Hello from CloudRail");
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

})).Start();

Points of Interest Interface:

  • Google Places
  • Foursquare
  • Yelp

Features

  • Get a list of POIs nearby
  • Filter by categories or search term

Full Documentation

Code Example

using Com.Cloudrail.SI;
using Com.Cloudrail.SI.Interfaces;
using Com.Cloudrail.SI.Exceptions;
using Com.Cloudrail.SI.Services;
using Com.Cloudrail.SI.Types;

CloudRail.AppKey = "{Your_License_Key};


// IPointsOfInterest poi = new Foursquare(this, "[clientID]", "[clientSecret]");
// IPointsOfInterest poi = new Yelp(this, "[consumerKey]", "[consumerSecret]", "[token]", "[tokenSecret]");
IPointsOfInterest poi = new GooglePlaces(this, "[apiKey]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
       IList<POI> res = poi.GetNearbyPOIs((Java.Lang.Double)49.4557091, (Java.Lang.Double)8.5279138, (Java.Lang.Long)1000, "restaurant", null);
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

})).Start();

Video Interface:

  • YouTube
  • Twitch
  • Vimeo

Features

  • Search for videos
  • Upload videos
  • Get a list of videos for a channel
  • Get channel details
  • Get your own channel details
  • Get video details

Full Documentation

Code Example

using Com.Cloudrail.SI;
using Com.Cloudrail.SI.Interfaces;
using Com.Cloudrail.SI.Exceptions;
using Com.Cloudrail.SI.Services;
using Com.Cloudrail.SI.Types;

CloudRail.AppKey = "{Your_License_Key};


// IVideo video = new Twitch(this, "[clientID]", "[clientSecret]");
// IVideo video = new Vimeo(this, "[clientID]", "[clientSecret]");
IVideo video = new YouTube(this, "[clientIdentifier]", "", "[redirectUri]", "[state]");
video.UseAdvancedAuthentication(); //Used for youtube

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
    try
    {
       IList<VideoMetaData> searchVideos = video.SearchVideos("Game of Thrones", 0, 1);  // Query, Offet, Limit
        //VideoMetaData videoData = video.UploadVideo("Best Video","One of my best videos",stream,1024, "channelID", "video/mp4");   // Title, Description, Stream (data), Size, ChannelID (optional for Youtube) and Video Mime type
        
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }

})).Start();

Messaging Interface:

  • FacebookMessenger
  • Telegram
  • Line
  • Viber

Features

  • Send text messages
  • Send files, images, videos and audios
  • Parse a message received on your webhook
  • Download the content of an attachment sent to your webhook

Code Example - Objective-C

Full Documentation

using Com.Cloudrail.SI;
using Com.Cloudrail.SI.Interfaces;
using Com.Cloudrail.SI.Exceptions;
using Com.Cloudrail.SI.Services;
using Com.Cloudrail.SI.Types;

CloudRail.AppKey = "{Your_License_Key};

IMessaging service;

// service = new Viber(this, "[Bot Token]", "[Webhook URL]", "[Bot Name]");
// service = new Telegram(this, "[Bot Token]", "[Webhook URL]");
// service = new Line(this, "[Bot Token]");

service = = new FacebookMessenger(this, "[Bot Token]");

new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
	try
	{
	    Message result = service.SendMessage("12123242","It's so easy to send message via CloudRail");
	    Console.WriteLine(result);
	}
	catch (Exception e)
	{
	   Console.WriteLine(e.Message);
	}

})).Start();

More interfaces are coming soon.

Advantages of Using CloudRail

  • Consistent Interfaces: As functions work the same across all services, you can perform tasks between services simply.

  • Easy Authentication: CloudRail includes easy ways to authenticate, to remove one of the biggest hassles of coding for external APIs.

  • Switch services instantly: One line of code is needed to set up the service you are using. Changing which service is as simple as changing the name to the one you wish to use.

  • Simple Documentation: There is no searching around Stack Overflow for the answer. The CloudRail documentation at https://cloudrail.com/integrations is regularly updated, clean, and simple to use.

  • No Maintenance Times: The CloudRail Libraries are updated when a provider changes their API.

  • Direct Data: Everything happens directly in the Library. No data ever passes a CloudRail server.

Sample Applications

If you don't know how to start or just want to have a look at how to use our SDK in a real use case, we created a few sample application which you can try out:

License Key

CloudRail provides a developer portal which offers usage insights for the SDKs and allows you to generate license keys.

It's free to sign up and generate a key.

Head over to https://cloudrail.com/signup

Pricing

Learn more about our pricing on https://cloudrail.com/pricing

Other Platforms

CloudRail is also available for other platforms like iOS, Java and NodeJS. You can find all libraries on https://cloudrail.com

Questions?

Get in touch at any time by emailing us: [email protected]

or

Tag a question with cloudrail on StackOverflow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.