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)
CloudRail
Author: DonManfred (wrapper)
Version: 1.5
CloudRail
Events:
Business CloudStorage:
AmazonS3
Backblaze
GoogleCloudPlatform
MicrosoftAzure
Rackspace
OneDriveBusiness
Cloud Storage:
Box
Google-Drive
Dropbox
Egnyte
OneDrive
SpaceAllocation
Methods:
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)
- validateKey As void
- Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String, AppKey As java.lang.String) As void
- android.permission.ACCESS_NETWORK_STATE
- android.permission.INTERNET
- android.permission.READ_EXTERNAL_STORAGE
- android.permission.WRITE_EXTERNAL_STORAGE
- 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
- Used As java.lang.Long
- Total As java.lang.Long
Attachments
Last edited: