Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Android CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: gradle

- name: Java version print
run: echo 'java-version'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build --stacktrace --warning-mode=all

apk:
name: Generate APK
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build APK
run: bash ./gradlew assembleDebug --stacktrace
- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: apk
path: app/build/outputs/apk/debug/app-debug.apk

- name: Send mail
if: always()
uses: dawidd6/action-send-mail@v2
with:
# mail server settings
server_address: smtp.gmail.com
server_port: 465
# user credentials
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# email subject
subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
# email body as text
body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
# comma-separated string, send email to
to: spacece_web_dev@spacece.co, spacece-web-test@spacece.co
# from email name
from: SpacECE Technology Team
7 changes: 6 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 17 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

android {
compileSdk 30
compileSdk 31

defaultConfig {
applicationId "com.spacECE.spaceceedu"
Expand Down Expand Up @@ -33,28 +33,29 @@ android {

dependencies {

implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
testImplementation 'junit:junit:4.+'
implementation 'androidx.compose.animation:animation-core:1.1.0-rc01'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.google.android.gms:play-services-auth:19.2.0'
implementation 'com.google.android.gms:play-services-auth:20.0.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.5'
implementation 'com.synnapps:carouselview:0.1.5'
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:11.0.1'
implementation 'androidx.drawerlayout:drawerlayout:1.1.1'
implementation 'com.synnapps:carouselview:0.1.5'

//
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
Expand All @@ -65,6 +66,8 @@ dependencies {

implementation 'com.squareup.okhttp3:okhttp:4.9.3'

implementation 'io.agora.rtc:full-sdk:3.2.1'
implementation 'io.agora.rtc:full-sdk:3.6.0.1'

implementation 'com.wdullaer:materialdatetimepicker:4.2.3'

}
10 changes: 5 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
<activity
android:name=".ConsultUS.ConsultUs_SplashScreen"
android:exported="true" />
<activity android:name=".LibForSmall.ChatUS" />
<activity android:name=".LibForSmall.Chat_Us" />
<activity android:name=".VideoLibrary.VideoLibrary_Activity_SplashScreen" />
<activity android:name=".LibForSmall.LibForSmall_SplashScreen"/>
<activity android:name=".LibForSmall.AddBook" />
<activity android:name=".LearnOnApp.LearnDetailed" />
<activity android:name=".LearnOnApp.LearnOn_Main" />
Expand Down Expand Up @@ -72,6 +73,8 @@
android:name=".ActivityDetailsActivity"
android:exported="true" />

<activity android:name=".LibForSmall.libraryDetailed" />

<activity
android:name=".ConsultUS.ConsultantProfile"
android:exported="true" />
Expand All @@ -88,10 +91,7 @@
android:name=".Authentication.LoginActivity"
android:exported="true" />
<activity
android:name=".LibForSmall.Library_main"
android:exported="true" />
<activity
android:name=".LibForSmall.My_books"
android:name=".LibForSmall.Library_Main"
android:exported="true" />
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,10 @@ private Bitmap getBitmapFromUri(Uri uri) throws IOException {
return image;
}

public static byte[] encodeBase64(Bitmap image) {
public static byte[] compressBitmap(Bitmap image) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
image.compress(Bitmap.CompressFormat.JPEG, 90, byteArrayOutputStream);
byte[] encoded = byteArrayOutputStream.toByteArray();
return encoded;
return byteArrayOutputStream.toByteArray();
}

private void sendUserRegistration(String name, String email, String password, String phone, Uri image){
Expand All @@ -200,20 +199,20 @@ private void sendUserRegistration(String name, String email, String password, St

JSONObject jsonObject;
Bitmap selectedImage;
byte[] encodedImage = {5};
byte[] ImageBytes = {5};


@Override
public void run() {

try {
selectedImage = getBitmapFromUri(image);
encodedImage = encodeBase64(selectedImage);
ImageBytes = compressBitmap(selectedImage);
} catch (IOException e) {
e.printStackTrace();
}

if(encodedImage.length == 1){
if(ImageBytes.length == 1){
runOnUiThread(new Runnable() {
@Override
public void run() {
Expand All @@ -230,8 +229,6 @@ public void run() {

}

System.out.println("hello");

OkHttpClient client = new OkHttpClient();
RequestBody fromBody;

Expand All @@ -243,8 +240,8 @@ public void run() {
.addFormDataPart("email", email)
.addFormDataPart("password", password)
.addFormDataPart("phone", phone)
.addFormDataPart("image", name+".jpg",
RequestBody.create(MediaType.parse("image/*jpg"), encodedImage))
.addFormDataPart("image", name+".jpeg",
RequestBody.create(ImageBytes, MediaType.parse("image/*jpeg")))
.addFormDataPart("type", "consultant")
.addFormDataPart("c_categories", TYPE)
.addFormDataPart("c_office", ADDRESS)
Expand All @@ -263,8 +260,8 @@ public void run() {
.addFormDataPart("email", email)
.addFormDataPart("password", password)
.addFormDataPart("phone", phone)
.addFormDataPart("image", name+".jpg",
RequestBody.create(MediaType.parse("image/*jpg"), encodedImage))
.addFormDataPart("image", name+".jpeg",
RequestBody.create(ImageBytes, MediaType.parse("image/*jpeg")))
.addFormDataPart("type", "customer")
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,7 @@ public void onClick(DialogInterface dialog, int which) {
} catch (JSONException e) {
e.printStackTrace();
}
Consultant_Main.categoryList = new ArrayList<>();
try {
for (int i = 0; i < jsonArray.length(); i++) {
ConsultantCategory newCategory = new ConsultantCategory((String) jsonArray.get(i), "nice");
Consultant_Main.categoryList.add(newCategory);
}

} catch (JSONException e) {
e.printStackTrace();
}

CreateArrayOfCategories(jsonArray);

Intent intent = new Intent(ConsultUs_SplashScreen.this, Consultant_Main.class);
startActivity(intent);
Expand All @@ -99,4 +89,17 @@ public void onClick(DialogInterface dialog, int which) {
thread.start();

}

static void CreateArrayOfCategories(JSONArray jsonArray) {
Consultant_Main.categoryList = new ArrayList<>();
try {
for (int i = 0; i < jsonArray.length(); i++) {
ConsultantCategory newCategory = new ConsultantCategory((String) jsonArray.get(i), "nice");
Consultant_Main.categoryList.add(newCategory);
}

} catch (JSONException e) {
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.spacECE.spaceceedu.ConsultUS;

public class Consultant {
private String name,consultant_id,profilePic_src,categories,address,language,timing_start,timing_end,qualification;
private String name,consultant_id,profilePic_src,categories,address,language,timing_start,timing_end,available_days,qualification;
private String price;

//TODO in this class days on which consultant is available is missing and needs to implemented from the server side and proper string array to be added.

public Consultant(String name, String consultant_id, String profilePic_src, String categories
, String address, String language, String timing_start, String timing_end,
, String address, String language, String timing_start, String timing_end, String available_days,
String qualification, String price) {
this.name = name;
this.consultant_id = consultant_id;
Expand All @@ -17,6 +17,7 @@ public Consultant(String name, String consultant_id, String profilePic_src, Stri
this.language = language;
this.timing_start = timing_start;
this.timing_end = timing_end;
this.available_days = available_days;
this.qualification = qualification;
this.price = price;
}
Expand Down Expand Up @@ -57,7 +58,12 @@ public String getTiming_end() {
return timing_end;
}

public String getAvailable_days() {
return available_days;
}

public String getPrice() {
return price;
}

}
Loading