Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed gradle in Restaurant-Management-System #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Commit to fix gradle in Restaurant-Management-System
  • Loading branch information
Shuruthinaya committed Oct 18, 2024
commit 7d05a0a1d8e9496a69aebfdc5a5f66cb02d75e23
Binary file added .gradle/8.9/checksums/checksums.lock
Binary file not shown.
Binary file added .gradle/8.9/checksums/md5-checksums.bin
Binary file not shown.
Binary file added .gradle/8.9/checksums/sha1-checksums.bin
Binary file not shown.
Empty file.
Binary file added .gradle/8.9/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/8.9/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/8.9/fileHashes/fileHashes.lock
Binary file not shown.
Empty file added .gradle/8.9/gc.properties
Empty file.
Empty file added .gradle/vcs-1/gc.properties
Empty file.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
50 changes: 24 additions & 26 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,50 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 27
compileSdkVersion 34
defaultConfig {
applicationId "com.dineout"
minSdkVersion 21
targetSdkVersion 27
targetSdkVersion 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// AndroidX dependencies (migrated from support libraries)
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.annotation:annotation:1.3.0'

//implementation 'com.android.support:recyclerview-v7:28.0.0'
//implementation 'com.android.support:cardview-v7:28.0.0'
//implementation 'com.android.support:support-v4:28.0.0'
//implementation 'com.android.support:appcompat-v7:28.0.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.android.support:cardview-v7:27.1.1'

implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.5'
// Firebase dependencies (updated versions)
implementation 'com.google.firebase:firebase-core:21.1.1'
implementation 'com.google.firebase:firebase-auth:22.1.0'
implementation 'com.google.firebase:firebase-database:20.3.0'

// Other dependencies
implementation 'com.hrules:horizontalnumberpicker:1.1.1'

implementation 'com.android.support:support-annotations:27.1.1'


implementation 'com.sun.mail:android-mail:1.5.5'
implementation 'com.sun.mail:android-activation:1.5.5'
implementation 'com.itextpdf:itextg:5.5.10'

// Test dependencies
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
64 changes: 31 additions & 33 deletions app/src/main/java/com/dineout/code/admin/AdminPanelActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,43 +210,41 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
}

public void checkdate() {
firebaseDatabase = FirebaseDatabase.getInstance(); //FIREBASE DATABASE KA OBJECT GET KIA

databaseReference = firebaseDatabase.getReference("Date"); //TABLE LIA

databaseReference.addChildEventListener(new ChildEventListener() {
public void onChildAdded(DataSnapshot dataSnapshot, String previousKey) {

date1 = dataSnapshot.getValue(String.class);
DateFormat f = new SimpleDateFormat("dd-MM-yyyy");
d1 = f.parse(date, new ParsePosition(0));
d2 = f.parse(date1, new ParsePosition(0));

if (d1.compareTo(d2) == 0) {
DatabaseReference ref1 = FirebaseDatabase.getInstance().getReference();
ref1.child("Date").child("date").setValue(date);
checkdb();
}


}

public void onChildChanged(DataSnapshot dataSnapshot, String s) {
}

public void onChildRemoved(DataSnapshot dataSnapshot) {
}

public void onChildMoved(DataSnapshot dataSnapshot, String s) {
public void checkDate() {
// Get the current date
String currentDate = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(new Date());

// Get the stored date from Firebase Realtime Database
DatabaseReference dateReference = FirebaseDatabase.getInstance().getReference("Date");
dateReference.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String previousKey) {
String storedDate = dataSnapshot.getValue(String.class);

// Compare the current date with the stored date
if (isSameDate(currentDate, storedDate)) {
// Update the stored date in Firebase Realtime Database
dateReference.child("date").setValue(currentDate);

// Check the database for notifications
checkDatabase();
}
}

@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
// Other methods of ChildEventListener
});
}

}
});
private boolean isSameDate(String date1, String date2) {
try {
DateFormat f = new SimpleDateFormat("dd-MM-yyyy");
Date d1 = f.parse(date1);
Date d2 = f.parse(date2);
return d1.compareTo(d2) == 0;
} catch (ParseException e) {
return false;
}
}

public void checkdb() {
firebaseDatabase = FirebaseDatabase.getInstance(); //FIREBASE DATABASE KA OBJECT GET KIA
Expand Down
14 changes: 8 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
jcenter()
mavenCentral() // Use Maven Central instead of JCenter
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.1'

// Updated Android Gradle Plugin
classpath 'com.android.tools.build:gradle:8.1.0'

// Updated Google Services plugin for Firebase integration
classpath 'com.google.gms:google-services:4.3.15'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -18,7 +20,7 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral() // Replacing JCenter with Maven Central
}
}

Expand Down
23 changes: 11 additions & 12 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

# JVM arguments for the Gradle daemon process
org.gradle.jvmargs=-Xmx2g

# Enable parallel build (optional, recommended for large multi-module projects)
org.gradle.parallel=true

# Enable the Gradle Daemon for faster builds
org.gradle.daemon=true

# If using AndroidX, these properties should be set
android.useAndroidX=true
android.enableJetifier=true
7 changes: 5 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#Sat Oct 19 03:16:24 IST 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
android.useAndroidX=true
android.enableJetifier=true