B4A Library CloudRail - CloudStorage (Dropbox, GoogleDrive, OneDrive and Box) Payment (PayPal, Stripe), POI

This is a Wrapper for the CloudStorage API from CloudRail.

At this point of development there is no Social-module wrapped. CloudRail does support more than just the CloudStorage-Api. But it was this i was interested in so i wrote the wrap for them...

I leave it up to the community to extend the library; i´ll share the written JAVA-Code

Requirements:
- B4A 6+ as the library is using a aar
- Account at CloudRail. Note that they also provide free subscription.
https://cloudrail.com/cloudrail-pricing/
- The file cloudrail-si.aar which can be downloaded here.
- An ClientID and Secret from the content-provider you want to use.
Dropbox
GoogleDrive
OneDrive
Box

Installation: Copy all three files from the library zip to your additional libs folder.
CloudRail.xml, CloudRail.jar and cloudrail-si.aar



Example-Code (for Dropbox)

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim dropbox As Dropbox
    Dim cr As CloudRail
End Sub

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    cr.Initialize("CloudRail","cloudrailid")
End Sub
Sub CloudRail_Ready(Success As Boolean)
    Log($"CloudRail_Ready(${Success})"$)
    If Success Then
        'dropbox.Initialize("Dropbox","client id","client secret")
    End If
End Sub

B4X:
Sub Dropbox_Ready(Success As Boolean)
    Log($"Dropbox_Ready(${Success})"$)
    dropbox.getChildren("/")
    dropbox.getChildren("/B4A")
    dropbox.checkAllocation
    dropbox.download("/B4A/MaterialDesign-Webfont-master.zip",rp.GetSafeDirDefaultExternal("Downloads"),"MaterialWebfont.zip")
End Sub
Sub Dropbox_DownloadFinished(success As Boolean, info As String, filePath As String, destPath As String, destFile As String)
    Log($"Dropbox_DownloadFinished(${destFile}->${success},${destFile},${filePath})"$)
End Sub
Sub Dropbox_Allocation(alloc As Object)
    Log($"Dropbox_Allocation()"$)
    If alloc <> Null Then
        Dim sa As SpaceAllocation = alloc
        Log($"${sa.Used} Used"$)
        Log($"${sa.Total} Total"$)
    End If
End Sub
Sub Dropbox_MetaData(path As String, meta As Object)
    Log($"Dropbox_MetaData(${path},${meta})"$)
End Sub
Sub Dropbox_Login(Success As Boolean)
    Log($"Dropbox_Login(${Success})"$)
End Sub
Sub Dropbox_Children(folder As List, files As List)
    Log($"Dropbox_Children()"$)
    If folder <> Null Then
        Log($"folder: ${folder.Size}"$)
    End If
    If files <> Null Then
        Log($"files: ${files.Size}"$)
    End If
    'Log($"Dropbox_Children(${folder})"$)
End Sub

CloudRail
Author:
DonManfred (wrapper)
Version: 1.5
CloudRail
Events:

  • Ready (Success As Boolean)
Methods:
  • validateKey As void
  • Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String, AppKey As java.lang.String) As void
Permissions:
  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.INTERNET
  • android.permission.READ_EXTERNAL_STORAGE
  • android.permission.WRITE_EXTERNAL_STORAGE
Properties:
  • AppKey As java.lang.String

Business CloudStorage:
AmazonS3
Backblaze
GoogleCloudPlatform
MicrosoftAzure
Rackspace
OneDriveBusiness


Cloud Storage:
Box
Google-Drive
Dropbox
Egnyte
OneDrive









SpaceAllocation
Methods:

  • hashCode As int
  • equals (o As java.lang.Object) As boolean
  • toString As java.lang.String
  • IsInitialized As boolean
  • Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String, space As com.cloudrail.si.types.SpaceAllocation) As void
Properties:
  • Used As java.lang.Long
  • Total As java.lang.Long
 

Attachments

  • CloudRailV1.51.zip
    189.7 KB · Views: 514
  • CloudRailV1.52.zip
    188.7 KB · Views: 529
  • CloudRailV1.54.zip
    188.8 KB · Views: 727
  • cloudrail-si.zip
    453.7 KB · Views: 701
  • cloudrailEx.zip
    8 KB · Views: 688
Last edited:

iz0ndg

Active Member
Licensed User
Longtime User
Hi DonManfred,
I received this email from CloudRail:
Hello Fabio Giordani!

This is a CloudRail API Change Management summary notification to inform you about problems with and/or improvements to the integrations for each of your apps.

Cloudrail ex:

* Android SDK - GoogleDrive: Google will ban the use of WebViews starting April 20, 2017. The newest CloudRail version supports an alternative authentication method that requires small changes by the developer. Please refer to the documentation and update. (critical)


Here are the latest SDK versions so you can update your dependencies:

Java: 2.14.0

Android: 2.14.1

Nodejs: 2.15.0

iOS: 5.4.3

Get the new SDK and more details at https://developers.cloudrail.com

Your CloudRail team

you should edit the wrapper?
Thanks
 

DonManfred

Expert
Licensed User
Longtime User
no
 

ashrafidkaidek

Member
Licensed User
Longtime User
I just downloaded the three files to the library folder, and open the example file without changing anything, but noticed the following error:

B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim kvs As KeyValueStore
End Sub

unknown KeyValueStore
Are you missing a library reference?


Am I missing anything? Also, is this library been tried and works fine with OneDrive?

Thank you for the good work.
 
Last edited:

ashrafidkaidek

Member
Licensed User
Longtime User
1. OK & 2. OK. 3. I will go through it, but it will be better if you cab provide a summary of what to do to be able to run your example.
Regarding OneDrive, if i manage to get your example compiling without errors, then i will try it and report my findings.
 

Mark Ryan Penafiel

Member
Licensed User
Longtime User
hi Sir, can you provide an example for paypal charge
why is it when i make a variable customer address, the last parameter is still an address

Thanks for the reply
 
Top