Curso is an education technology application with Chat Feature that provides an online learning and teaching platform. Students take courses primarily to improve job-related skills Some courses generate credit toward technical certification This is an Android application that allows users to enroll in courses and lecturer articles. The application uses Realm Cloud to store user data and course information. Firebase Cloud Messaging is used to send push notifications to users when new course materials are available. Firebase Storage is used to store course materials articles, videos and images. Dropbox is used to backup user data and course materials. Amazon AWS Storage is used to videos.
To get started with this application, you will need to have Android Studio installed on your computer. You will also need to create accounts with Realm Cloud, Firebase, Dropbox, and Amazon AWS.
- Realm Cloud: Provides cloud-based data storage.
- Firebase Cloud Messaging: Provides push notification services.
- Retrofit: Provides REST API for push notifications.
- Firebase Storage: Provides cloud storage services for videos and images.
- Dropbox: Provides cloud storage services for videos and images.
- pCloud: Provides cloud storage services for videos and images.
- Share File: Provides cloud storage services for videos and images.
- Amazon AWS: Provides cloud storage services for videos and images.
- Dagger Hilt: Provides dependency injection.
- Create a Realm Cloud account.
- Create a new Realm app.
- Add the following to your project-level
build.gradle
file:
plugins {
id("io.realm.kotlin") version "1.12.0" apply false
}
- Add the following to your app-level
build.gradle
file:
dependencies {
implementation("io.realm.kotlin:library-base:1.12.0")
implementation("io.realm.kotlin:library-sync:1.12.0")
}
-
Follow the instructions provided by Firebase to add Firebase to your Android project.
-
Create a Firebase account.
-
Create a new Firebase project.
-
Enable Firebase Messaging.
-
Add the Firebase configuration file to the
app
directory. -
Add the following to your project-level
build.gradle
file:
plugins {
id("com.google.gms.google-services") version("4.4.0") apply false
}
- Add the following to your app-level
build.gradle
file:
dependencies {
implementation(platform("com.google.firebase:firebase-bom:32.5.0"))
implementation("com.google.firebase:firebase-messaging-ktx:23.3.1")
implementation("com.google.firebase:firebase-messaging-directboot:23.3.1")
}
- Add the following to your app's manifest file:
<service
android:name=".MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
- Create a new class called
MyFirebaseMessagingService
that extendsFirebaseMessagingService
:
class MyFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
// Handle FCM message here.
}
}
- Follow the instructions provided by Firebase to add Firebase to your Android project.
- Enable Firebase Messaging Storage .
- Add the following to your app-level
build.gradle
file:
dependencies {
implementation("com.google.firebase:firebase-storage-ktx:20.3.0")
}
- Use the following code to upload a file to Firebase Storage:
val storage = FirebaseStorage.getInstance()
val storageRef = storage.reference
val fileRef = storageRef.child("path/to/file")
val file = Uri.fromFile(File("path/to/local/file"))
val uploadTask = fileRef.putFile(file)
-
Follow the instructions provided by Dropbox to add Dropbox to your Android project.
-
Add the following to your app-level
build.gradle
file:
dependencies {
implementation("com.dropbox.core:dropbox-core-sdk:3.1.0")
}
- Use the following code to upload a file to Dropbox:
val config = DbxRequestConfig.newBuilder("dropbox/java-tutorial").build()
val client = DbxClientV2(config, ACCESS_TOKEN)
FileInputStream("path/to/local/file").use { inputStream ->
val metadata = client.files().uploadBuilder("/path/to/dropbox/file")
.uploadAndFinish(inputStream)
}
-
Follow the instructions provided by Amazon to add Amazon AWS Storage to your Android project.
-
Add the following to your app-level
build.gradle
file:
dependencies {
implementation "aws.sdk.kotlin:s3:0.25.0-beta"
}
- Use the following code to upload a file to Amazon AWS Storage:
val credentialsProvider = CognitoCachingCredentialsProvider(
applicationContext,
"identityPoolId",
Regions.US_EAST_1
)
val s3Client = AmazonS3Client(credentialsProvider)
val transferUtility = TransferUtility.builder()
.context(applicationContext)
.awsConfiguration(AWSMobileClient.getInstance().configuration)
.s3Client(s3Client)
.build()
val file = File("path/to/local/file")
val transferObserver = transferUtility.upload(
"bucketName",
"keyName",
file
)
-
Follow the instructions provided by pCloud to add pCloud to your Android project.
-
Add the following to your app-level
build.gradle
file:
dependencies {
implementation("com.pcloud.sdk:core-ktx:1.8.0")
implementation("com.pcloud.sdk:android:1.8.1")
}
- Use the following code to upload a file to pCloud:
PcloudSdk.init(context, "appKey", "appSecret")
PcloudAuth.startAuthActivityForResult(activity, requestCode)
-
Follow the instructions provided by Share File to add Share File to your Android project.
-
Add the following to your app-level
build.gradle
file:
dependencies {
implementation "com.citrix.sharefile:sfandroidsdk:1.0.0"
}
- Use the following code to upload a file to Share File:
val authManager = SFAuthenticationManager.getInstance()
authManager.login(activity, object : SFOAuthCallback {
override fun onSuccess() {
val file = SFSDKFile()
file.fileName = "file.txt"
file.filePath = "path/to/local/file"
SFSDKFileManager.getInstance().uploadFile(file, object : SFSDKFileManager.SFSDKFileManagerCallback {
override fun onSuccess() {
// File uploaded successfully.
}
override fun onError(e: Exception) {
// Error occurred while uploading file.
}
})
}
override fun onError(e: Exception) {
// Error occurred while logging in.
}
})