/**
For user satisfaction, all features provided in Palio have been tested to meet certain performance, reliability, and availability standards. If you need to test these features (Audio Call, Video Call, Conference, Online Seminar, etc.), please download catchUp from Google Play Store. catchUp is a Social Media built entirely using Palio.io to demonstrate Palio's performance, reliability, and availability standards.
=====================
NOTES
=====================
For user security and privacy reasons, Palio.io for Android will not work in the following environments:
1. Rooted Devices
2. Emulators
3. Android devices version below 6.0 (API 23). You need to set minSdkVersion 23 in your build.gradle (:app)
4. Applications that uses the backup and restore infrastructure. Please make sure you have the following 3 lines of code in your Manifest file:
android:allowBackup="false"
android:fullBackupOnly="false"
android:fullBackupContent="false"
=====================
Layout Customization
=====================
You can customize the look and layout of our live streaming, online seminar, and audio-video call features. To do so, follow these steps:
1. Download the activity layout (.xml) files by clicking this link: activity_layouts.zip
2. Extract the .xml files into your project folder -> app -> src -> main -> res -> layout folder.
3. Edit the activity layouts as you need.
Notice:
Please refrain from deleting view components or altering their id's as it may cause errors in the application.
*/
/**
Untuk menjaga kepuasan pelanggan, seluruh fitur yang disediakan Palio telah diuji untuk memenuhi kriteria performa, kehandalan dan ketersediaan. Jika kamu ingin menguji fitur-fitur dimaksud (Audio Call, Video Call, Conference, Online Seminar, dll.) kamu bisa mengunduh catchUp dari Google Play Store. catchUp adalah Media Sosial yang dibangun sepenuhnya menggunakan Palio.io untuk menunjukkan fitur dan standar performa dan kehandalan dari Palio.io
=====================
NOTES
=====================
Untuk alasan Keamanan dan Privasi pengguna, Palio.io untuk Android tidak akan dapat berjalan pada kondisi berikut:
1. Rooted Devices
2. Emulators
3. Perangkat Android dengan version dibawah 6.0 (API 23). Pastikan kamu sudah menentukan minSdkVersion 23 didalam build.gradle (:app)
4. Aplikasi yang melakukan backup & restore data pada infrastruktur backup. Pastikan kamu sudah menentukan 3 variabel berikut didalam Manifest file mu
android:allowBackup="false"
android:fullBackupOnly="false"
android:fullBackupContent="false"
=====================
Layout Customization
=====================
Kamu dapat mengubah tampilan dan layout live streaming, online seminar, dan audio-video call features.Ikuti Langkah-langkah berikut untuk melakukan perubahan tsb:
1. Download file activity layout (.xml) files dari link: activity_layouts.zip
2. Extract file .xml kedalam folder project mu -> app -> src -> main -> res -> layout folder.
3. Ubah activity layouts sesuai kebutuhanmu.
Catatan:
Hindari menghapus view components atau mengubah id komponen karena akan mengakibatkan error pada application.
*/
/***********************************************************************************************************
If your MainActivity extends the standard Activity or AppCompatActivity from the
Android Library then you can simply make MainActivity extend PalioBaseActivity instead,
and simply follow the example below.
However, if your MainActivity extends a non-standard Activity (i.e., your own custom
Activity), or you don't want to make your MainActivity extend PalioBaseActivity, please
follow the sample code on Option-2. Please note that you will need to
manually override the required events with Palio related events so the code runs properly.
************************************************************************************************************/
package com.example.paliolitesamplecode;
import android.os.Bundle;
import android.widget.Toast;
// Import Palio.io Libraries
import io.newuniverse.PalioLibrary.Callback;
import io.newuniverse.PalioLibrary.PalioBaseActivity;
// Extend the MainActivity with PalioBaseActivity
public class MainActivity extends PalioBaseActivity {
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_main);
/***********************************************************************************************************
Connect to our server with your Palio.io Account, and implement the required Callback.
Please Subscribe or contact us to get your Palio.io Account.
Do not share your Palio.io Account or ever give it out to someone outside your organization.
************************************************************************************************************/
connect("***REPLACE***WITH***YOUR***PALIO***ACCOUNT***", this, new Callback() {
@Override
public void onSuccess(final String userId) {
/******************************************************************************************************************
The userId parameter in the onSuccess method will provide an identification of the Palio User ID
which is generated automatically and it can be mapped to the User ID on the application level.
For example, Palio User ID (e.g. User001) can be mapped into your Application User ID (e.g. John Doe),
so you don't have to share your Application User ID with Palio.io, but you can still monitor your user activities.
******************************************************************************************************************/
/*** do something ***/
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getBaseContext(), "Your Palio User ID: " + userId, Toast.LENGTH_LONG).show();
}
});
}
@Override
public void onFailed(final String reasonCode) {
/*** do something ***/
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getBaseContext(), reasonCode, Toast.LENGTH_LONG).show();
}
});
}
});
}
}
/***********************************************************************************************************
If your MainActivity extends a non-standard Activity (i.e., your own custom Activity), or
you don't want to make your MainActivity extend PalioBaseActivity, please follow the
sample code below. Please note that you will need to manually override the required
events with Palio related events so the code runs properly.
However, if your MainActivity extends the standard Activity or AppCompatActivity from
the Android Library then you can simply make MainActivity extend PalioBaseActivity
instead, and simply follow the sample code on Option-1.
************************************************************************************************************/
package com.example.paliolitesamplecode;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
// Import Palio.io Libraries
import io.newuniverse.PalioLibrary.Callback;
import io.newuniverse.PalioLibrary.Palio;
public class MainActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_main);
/***********************************************************************************************************
Connect to our server with your Palio.io Account, and implement the required Callback.
Please Subscribe or contact us to get your Palio.io Account.
Do not share your Palio.io Account or ever give it out to someone outside your organization.
************************************************************************************************************/
Palio.getInstance().connect("***REPLACE***WITH***YOUR***PALIO***ACCOUNT***", this, new Callback() {
@Override
public void onSuccess(final String userId) {
/******************************************************************************************************************
The userId parameter in the onSuccess method will provide an identification of the Palio User ID
which is generated automatically and it can be mapped to the User ID on the application level.
For example, Palio User ID (e.g. User001) can be mapped into your Application User ID (e.g. John Doe),
so you don't have to share your Application User ID with Palio.io, but you can still monitor your user activities.
******************************************************************************************************************/
/*** do something ***/
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getBaseContext(), "Your Palio User ID: " + userId, Toast.LENGTH_LONG).show();
}
});
}
@Override
public void onFailed(final String reasonCode) {
/*** do something ***/
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getBaseContext(), reasonCode, Toast.LENGTH_LONG).show();
}
});
}
});
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
Palio.getInstance().onNewIntent(intent);
}
@Override
protected void onResume() {
super.onResume();
Palio.getInstance().onResume();
}
@Override
protected void onStart() {
super.onStart();
Palio.getInstance().onStart();
}
@Override
protected void onPause() {
super.onPause();
Palio.getInstance().onPause();
}
@Override
protected void onStop() {
super.onStop();
Palio.getInstance().onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
Palio.getInstance().onDestroy();
}
@Override
public void onBackPressed() {
super.onBackPressed();
Palio.getInstance().onBackPressed();
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
Palio.getInstance().onRequestPermissionsResult(requestCode, permissions, grantResults);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Palio.getInstance().onActivityResult(requestCode, resultCode, data);
}
}
// Please make sure you have set minSdkVersion to 23.
// Add the following lines to include the Palio.io repository into your app
repositories {
maven {
url "https://palio.io/artifactory/libs-release-local"
credentials {
username = "***REPLACE***WITH***YOUR***MAVEN***USERNAME***"
password = "***REPLACE***WITH***YOUR***MAVEN***PASSWORD***"
}
}
}
dependencies {
// *** Please make sure you have the Material library in your dependencies ***
implementation 'com.google.android.material:material:1.3.0'
// *** Add Palio Lite dependencies ***
implementation 'io.palio:palio-lite:1.0.64'
implementation('com.google.apis:google-api-services-gmail:v1-rev98-1.25.0') {
exclude group: 'org.apache.httpcomponents'
transitive = true
}
implementation('com.github.bumptech.glide:glide:4.12.0@aar') {
transitive = true
}
implementation ('net.zetetic:android-database-sqlcipher:4.4.2@aar') {
transitive = true
}
}