diff --git a/AdminPanelApp/BUILD_INSTRUCTIONS.md b/AdminPanelApp/BUILD_INSTRUCTIONS.md new file mode 100644 index 00000000..39c2afda --- /dev/null +++ b/AdminPanelApp/BUILD_INSTRUCTIONS.md @@ -0,0 +1,42 @@ +# How to Build the APK + +This project uses Gradle to build the application. You can build the APK from the command line using the Gradle wrapper (`gradlew`). + +## Prerequisites + +- Java Development Kit (JDK) version 8 or higher installed. +- Android SDK installed and the `ANDROID_HOME` environment variable set. + +## Build Steps + +1. **Open a terminal or command prompt.** + +2. **Navigate to the project directory:** + ```bash + cd AdminPanelApp + ``` + +3. **On macOS or Linux, make the Gradle wrapper executable:** + Before you can run the Gradle wrapper, you need to make it executable. + ```bash + chmod +x ./gradlew + ``` + (This step is not needed on Windows.) + +4. **Run the build command:** + Now, you can start the build process. This command will download the required Gradle version and build the debug APK. + + - On **macOS or Linux**: + ```bash + ./gradlew assembleDebug + ``` + - On **Windows**: + ```bash + gradlew.bat assembleDebug + ``` + +5. **Find the APK:** + After the build finishes successfully, the APK file will be located in the following directory: + `app/build/outputs/apk/debug/app-debug.apk` + + You can now install this APK file on an Android device or emulator. \ No newline at end of file diff --git a/AdminPanelApp/app/build.gradle b/AdminPanelApp/app/build.gradle new file mode 100644 index 00000000..daed24b1 --- /dev/null +++ b/AdminPanelApp/app/build.gradle @@ -0,0 +1,38 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdk 31 + + defaultConfig { + applicationId "com.example.adminpanelapp" + minSdk 21 + targetSdk 31 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' +} \ No newline at end of file diff --git a/AdminPanelApp/app/src/main/AndroidManifest.xml b/AdminPanelApp/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..bff84f22 --- /dev/null +++ b/AdminPanelApp/app/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AdminPanelApp/app/src/main/java/com/example/adminpanelapp/DashboardActivity.java b/AdminPanelApp/app/src/main/java/com/example/adminpanelapp/DashboardActivity.java new file mode 100644 index 00000000..f4f78db0 --- /dev/null +++ b/AdminPanelApp/app/src/main/java/com/example/adminpanelapp/DashboardActivity.java @@ -0,0 +1,37 @@ +package com.example.adminpanelapp; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; +import android.widget.ArrayAdapter; +import android.widget.ListView; + +import java.util.ArrayList; + +public class DashboardActivity extends AppCompatActivity { + + private ListView userListView; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_dashboard); + + userListView = findViewById(R.id.user_list); + + // Create a sample list of users + ArrayList userList = new ArrayList<>(); + userList.add("User 1: user1@example.com"); + userList.add("User 2: user2@example.com"); + userList.add("User 3: user3@example.com"); + userList.add("User 4: user4@example.com"); + userList.add("User 5: user5@example.com"); + + + // Create an adapter to display the user list + ArrayAdapter adapter = new ArrayAdapter<>(this, + android.R.layout.simple_list_item_1, userList); + + userListView.setAdapter(adapter); + } +} \ No newline at end of file diff --git a/AdminPanelApp/app/src/main/java/com/example/adminpanelapp/MainActivity.java b/AdminPanelApp/app/src/main/java/com/example/adminpanelapp/MainActivity.java new file mode 100644 index 00000000..60003b13 --- /dev/null +++ b/AdminPanelApp/app/src/main/java/com/example/adminpanelapp/MainActivity.java @@ -0,0 +1,39 @@ +package com.example.adminpanelapp; + +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Bundle; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; + +public class MainActivity extends AppCompatActivity { + + private EditText emailEditText; + private EditText passwordEditText; + private Button loginButton; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + emailEditText = findViewById(R.id.email); + passwordEditText = findViewById(R.id.password); + loginButton = findViewById(R.id.login_button); + + loginButton.setOnClickListener(v -> { + String email = emailEditText.getText().toString(); + String password = passwordEditText.getText().toString(); + + if (email.equals("admin@example.com") && password.equals("password")) { + Intent intent = new Intent(MainActivity.this, DashboardActivity.class); + startActivity(intent); + finish(); + } else { + Toast.makeText(MainActivity.this, "Invalid credentials", Toast.LENGTH_SHORT).show(); + } + }); + } +} \ No newline at end of file diff --git a/AdminPanelApp/app/src/main/res/layout/activity_dashboard.xml b/AdminPanelApp/app/src/main/res/layout/activity_dashboard.xml new file mode 100644 index 00000000..a803708a --- /dev/null +++ b/AdminPanelApp/app/src/main/res/layout/activity_dashboard.xml @@ -0,0 +1,30 @@ + + + + + + + + \ No newline at end of file diff --git a/AdminPanelApp/app/src/main/res/layout/activity_main.xml b/AdminPanelApp/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..41efff64 --- /dev/null +++ b/AdminPanelApp/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,47 @@ + + + + + + + +