Rent IT

Project Understanding and Overview

  1. Can you give us a brief overview of the Rent IT project and its main functionalities?

    Ans :

    1. A Small Animated Intro Screen

    2. A Login (Email and Password) and Registration (User Details NID,Phone,Email,Name) system using Firebase.

    3. A Simple Menu Screen

    4. Give Rent Form: Rent Your Product

      1. Product Name

      2. Product Image from gallery and host it in firebase Storage and Store the link in Firebase database

      3. Description, Rating, Location and Price

    5. Take Rent Page:

      1. A recycler product view showing available products for rent dynamically from database

      2. Click a product it will more details product information

      3. You can order it by clicking make payment

      4. A dummy Bkash Payment Interface

      5. Order Confirmation

    6. Same As Rent this Have Free Product Give and Take Page

    7. User Profile Page

    8. My Sales Page :

      1. Shows The Product That I Gave Rent

      2. How ?

        • When I Rent a product in give rent form, using the email, I also create a database collection using the unique email of that user and store what he rented every time he fill-up the form.

    9. My Order Page

      1. Show The Product That I took Rent

      2. How?

        • When I Rent a product in take rent form , using the email , I also create a database collection using the unique email of that user and store what he rented every time he fill-up the form.

  2. What motivated you to choose this project?

    Ans : The motivation behind Rent IT stems from the observation of significant resource wastage due to underutilized products and the financial burden on individuals needing items temporarily. The idea was to create a sustainable solution that would benefit both the owners of underutilized items and those seeking short-term access. By promoting reusability and reducing the need for new production, Rent IT aims to contribute to environmental sustainability and responsible consumption practices.

  3. Who was the target audience for the Rent IT app?

    1. Individuals Interested in Luxury Items: People who want access to luxury items for short-term use without investing in their purchase.

    2. General Vendors: Individuals and businesses who can rent out their products to generate extra income.

    3. Upper-Class Individuals: Those who need luxury items for special occasions or short-term purposes.

    4. Eco-conscious Consumers: People interested in sustainable consumption practices and reducing their environmental footprint.

    5. Budget-Conscious Users: Individuals who prefer renting items for temporary needs rather than purchasing them, thus saving money.

Java & OOP

  1. Java Basics and OOP Principles:

    • Explain the core principles of Object-Oriented Programming (OOP) and how you applied them in your project.

      1. Encapsulation: Each class encapsulates related data and functionality. For instance, the Products class encapsulates product data such as name, description, rating, price, and image. This encapsulation allows for better organization and prevents direct access to the class's internal state from outside.

        Here Product is a object class and all its characteristic like name , description, rating, price and image is private variable and encapsulated. Only way to access this is the getter and setter method of class.

      2. Abstraction: Abstraction is achieved by defining classes with clear and concise interfaces. In the Products class, getter methods like getName(), getDescription(), etc., abstract away the internal details of the class's implementation, allowing other parts of the program to interact with product objects without needing to know their internal structure.

    • How did you manage state and behavior in your Java classes for the app?

      Ans:

      • I managed state within my classes by storing instance variables like name, description, etc., and provided getter methods to access this state. This ensured controlled access to the class's internal state and promoted data encapsulation.

      • Behavior management was exemplified in classes like buyScreen, where I defined behavior related to displaying product information and handling user interactions. For example, the onBindViewHolder() method specified how product data was bound to RecyclerView items, while the onClick() method defined the behavior when a user clicked on a product image.

      Passing the values of user email whenever i am going to another page of app

          // login info passing
          Intent intent = getIntent();
          emails = intent.getStringExtra("emails");
          // login info passing
      
          // home button
          home = findViewById(R.id.homeBut);
          home.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  Intent intent = new Intent(acountSccreen.this, menuScreen.class);
                  // pass login data to menuScreen
                  intent.putExtra("emails", emails);
                  // pass login data to menuScreen
                  startActivity(intent); // go to menuScreen screen
              }
          });
          // home button

    • Can you describe any design patterns you used in this project and why?

      Ans : In that time , I didn't that much about design patterns so a specifically didn't Introduced any design pattern.. But i had done this project now i would like use this design patterns

      1. Model-View-Controller (MVC): MVC separates an application into three interconnected components: Model (data), View (presentation/UI), and Controller (logic). You can refactor your code to adhere more closely to this pattern, separating concerns and making your codebase more modular and easier to maintain.

      2. Singleton: The Singleton pattern ensures that a class has only one instance and provides a global point of access to that instance. This pattern can be useful for managing global resources or configurations, such as a database connection or a logging mechanism.

      3. Factory Method: The Factory Method pattern defines an interface for creating objects but allows subclasses to alter the type of objects that will be created. You can use this pattern to decouple object creation from object usage, making your code more flexible and easier to extend.

      4. Observer: The Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. You can apply this pattern to implement event handling or notifications within your application, improving its responsiveness and modularity.

      5. Builder: The Builder pattern separates the construction of a complex object from its representation, allowing the same construction process to create different representations. This pattern can be useful when dealing with objects that have many optional parameters or configurations, simplifying their construction and improving readability.

      6. Adapter: The Adapter pattern allows incompatible interfaces to work together by providing a bridge between them. You can use this pattern to integrate third-party libraries or components into your project without modifying their existing interfaces, promoting code reuse and interoperability.

  2. Java Specifics:

    • How did you handle exceptions in your project?

      1. Using Try-Catch Blocks

        • Purpose: To catch and handle exceptions that might occur during runtime, such as network errors, database access issues, or invalid input.

        • Implementation Example:

          try {
              firebaseFirestore.collection("Products").add(items)
                  .addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
                      @Override
                      public void onSuccess(DocumentReference documentReference) {
                          pd.dismiss();
                          Toast.makeText(sellRentScreen.this, "Post Successful", Toast.LENGTH_SHORT).show();
                      }
                  })
                  .addOnFailureListener(new OnFailureListener() {
                      @Override
                      public void onFailure(@NonNull Exception e) {
                          pd.dismiss();
                          Toast.makeText(sellRentScreen.this, "Post Failed: " + e.getMessage(), Toast.LENGTH_SHORT).show();
                      }
                  });
          } catch (Exception e) {
              pd.dismiss();
              Log.e("DatabaseError", "Error adding product: ", e);
              Toast.makeText(sellRentScreen.this, "An unexpected error occurred.", Toast.LENGTH_SHORT).show();
          }
        • Explanation: The try-catch block is used to catch general exceptions that might not be caught by the addOnFailureListener. This ensures that any unexpected errors are logged and a user-friendly message is displayed.

      2. Using Listeners for Firebase Operations

        • Purpose: To handle success and failure scenarios specifically for Firebase operations.

        • Implementation Example:

          firebaseFirestore.collection(emails).add(item)
              .addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
                  @Override
                  public void onSuccess(DocumentReference documentReference) {
                      Toast.makeText(UserActivity.this, "Item added successfully", Toast.LENGTH_SHORT).show();
                  }
              })
              .addOnFailureListener(new OnFailureListener() {
                  @Override
                  public void onFailure(@NonNull Exception e) {
                      Toast.makeText(UserActivity.this, "Failed to add item: " + e.getMessage(), Toast.LENGTH_SHORT).show();
                      Log.e("FirestoreError", "Error adding item to Firestore: ", e);
                  }
              });
        • Explanation: addOnSuccessListener and addOnFailureListener are used to handle the outcomes of Firebase operations. This ensures that success and failure are managed appropriately, providing feedback to the user and logging errors for debugging.

      3. User Feedback

        • Purpose: To inform users when an error occurs, providing clear and helpful messages.

        • Implementation Example:

          try {
              // Some operation
          } catch (Exception e) {
              Toast.makeText(context, "An error occurred. Please try again.", Toast.LENGTH_SHORT).show();
          }
        • Explanation: Displaying a Toast message to the user ensures that they are aware something went wrong, without exposing technical details that might confuse them.

      4. Validation and Preemptive Checks

        • Purpose: To minimize the chances of exceptions occurring by validating inputs and pre-checking conditions.

        • Implementation Example:

          String nameInput = name.getText().toString();
          if (nameInput.isEmpty()) {
              Toast.makeText(context, "Name cannot be empty", Toast.LENGTH_SHORT).show();
              return;
          }
          
          try {
              // Proceed with operations assuming valid input
          } catch (Exception e) {
              Log.e("ValidationError", "Error after input validation: ", e);
          }
        • Explanation: By validating inputs and preemptively checking conditions, the application reduces the likelihood of exceptions and ensures that only valid data is processed.

    • Explain how you managed multithreading or asynchronous tasks in your app.

    • Describe how you used collections in your project, and why you chose specific types (e.g., List, Set, Map).

    Map: The Map collection type, specifically HashMap, was chosen for storing product attributes because it allows for efficient key-based access to data. This makes it easy to retrieve specific details about a product without needing to iterate through a collection, enhancing performance and simplicity in code when dealing with product details.

  3. How you handle Images in Project?

    1. Using Glide Framework : Glide.with(sellRentScreen.this).load(imageUri).into(img);

    2. Showing Progress Dialog: When an image upload or data insertion starts, a ProgressDialog is shown: ProgressDialog pd = new ProgressDialog(this); pd.setMessage("Uploading"); pd.show();

Android Development

  1. Activity and Fragment Lifecycle:

    • Explain the Android Activity lifecycle and how you managed state across configuration changes. How did you utilize Fragments in your app, if at all?

    Answer:

    Android Activity Lifecycle

    The Android Activity lifecycle consists of 7 key stages:

    1. onCreate(): Initializes the activity and sets up the initial UI components.

    2. onStart(): The activity becomes visible to the user.

    3. onRestart(): It is invoked after the activity has been stopped and prior to its starting stage and thus is always followed by onStart() when any activity is revived from background to on-screen.

    4. onResume(): The activity is currently running and interacting with the user.

    5. onPause(): Another activity is starting and takes focus; the current activity is partially obscured.

    6. onStop(): The activity is no longer visible to the user.

    7. onDestroy(): The activity is being destroyed.

    To manage state across configuration changes (like screen rotations), you can override onSaveInstanceState() to save the state of your activity into a Bundle. This bundle is passed to onCreate() and onRestoreInstanceState() methods to restore the state when the activity is recreated.

    Utilizing Fragments

    Fragments represent a portion of the user interface in an Activity. Each Fragment has its own lifecycle, which is managed by the FragmentManager. Key lifecycle methods for Fragments include:

    • onAttach(): The fragment is attached to its hosting activity.

    • onCreate(): Sets up the fragment's initial state.

    • onCreateView(): Creates the view hierarchy for the fragment

    • onActivityCreated(): Indicates that the activity's onCreate() has been called and the view hierarchy is now created.

    • onStart(): The fragment is visible to the user.

    • onResume(): The fragment is actively running and interacting with the user.

    • onPause(): The fragment is partially obscured.

    • onStop(): The fragment is no longer visible to the user.

    • onDestroyView(): The view hierarchy of the fragment is being removed.

    • onDestroy(): The fragment is being destroyed.

    • onDetach(): The fragment is detached from its hosting activity.

    To manage state across configuration changes in Fragments, similar strategies apply as with Activities. You can save the state in onSaveInstanceState() and restore it in onCreate() or onRestoreInstanceState(). Additionally, Fragments have a setRetainInstance(boolean) method that, when set to true, prevents the fragment from being destroyed and recreated during configuration changes, allowing you to retain the fragment's state.

  2. UI Components and Layouts:

    • What UI components did you use for the main screens of your app?

      • Button

      • MaterialButton

      • ImageView

      • EditText

      • ProgressDialog

      • RecyclerView

    • Can you describe the layout structure of a key screen in your app and how you ensured it was responsive?

      • ConstraintLayout could be used for more complex layouts to achieve better control over the positioning and scaling of UI elements.

      • UI components use match_parent and wrap_content for width and height to adapt to various screen sizes.

      • If the content is expected to be longer than the screen height, wrapping the entire layout in a ScrollView ensures that users can scroll to see all the content.

      • Testing the app on various emulators and physical devices with different screen sizes and resolutions helps identify and fix any layout issues.

      • Also RecyclerView && CardView

  3. Data Handling and Storage:

    • Can you describe the process of integrating Firebase Realtime Database in your app?

      Ans : To integrate Firebase Firestore in the app, the following steps were taken:

      1. Firebase Initialization: Firebase Firestore is initialized in the onCreate() method using FirebaseFirestore.getInstance().

      2. Querying Data: A query is created to access the "Products" collection from the Firestore database. This is achieved by calling collection("Products") on the FirebaseFirestore instance.

      3. Setting Up RecyclerView: A RecyclerView is initialized and configured to display the queried data. This involves creating a FirestoreRecyclerAdapter with appropriate options, including the query and the model class (Products).

      4. ViewHolder Implementation: A custom ViewHolder class (ProductsViewHolder) is implemented to hold references to the views inside each item of the RecyclerView.

      5. Binding Data: Inside the onBindViewHolder() method of the adapter, data retrieved from Firestore (such as name, description, rating, price, and image URL) is bound to the corresponding views in the ViewHolder.

      6. Image Loading: Picasso library is used to load images from the provided URLs into the ImageView inside each RecyclerView item.

      7. Handling Click Events: Clicking on an item in the RecyclerView triggers an intent to start the orderBuy activity, passing relevant data (such as product details and user email) as extras.

      8. Listening for Firestore Changes: The startListening() and stopListening() methods of the adapter are called in onStart() and onStop() respectively to ensure that data is fetched and updated in real-time.

      This integration ensures that the app can fetch and display product data from Firebase Firestore in real-time, providing users with an up-to-date and dynamic shopping experience.

  4. User Experience (UX):

    • What steps did you take to ensure your app was user-friendly?

      Ans:

      1. User Feedback: Let many user to use our app and what changes they want in looks and as we participated many projects showcasing, we updated the Ui many times based on judges' suggestions.

      2. Intuitive UI Design: The UI design follows common Android design principles and guidelines, ensuring that users can easily navigate through the app. Elements like buttons, text fields, and RecyclerViews are appropriately sized and spaced for easy interaction.

      3. Efficient Data Loading: Data loading from the Firestore database is done asynchronously, ensuring that the UI remains responsive even while data is being fetched.

    • How did you test and validate the user experience during development?

Firebase Integration

  1. Firebase Authentication:

    • Describe how you implemented user registration and authentication using Firebase.

      Ans:

      1. Firebase Authentication Setup: The Firebase Authentication SDK is included in the app's dependencies, and an instance of FirebaseAuth is obtained using FirebaseAuth.getInstance().

      2. Registration Process: When the user clicks on the registration button (move3), they are redirected to the createUserWithEmailAndPassword activity. This activity allows the user to create a new account by providing their email and password. Upon successful registration, the user's credentials are stored securely in Firebase Authentication.

      3. Login Process: When the user fills in their credentials and clicks on the login button (move2), their email and password are authenticated against the stored credentials in Firebase Authentication using signInWithEmailAndPassword(). If the authentication is successful, the user is redirected to the menuScreen activity.

      4. Error Handling: Error messages are displayed to the user in case of authentication failures (e.g., incorrect credentials, network issues) using Toast messages.

      5. Back Button Handling: When the user presses the back button, an alert dialog is displayed asking for confirmation to exit the app. This ensures a smooth user experience and prevents accidental app closures.

      Login with Firebase
      Registration With Firebase
    • How did you handle user sessions and secure data storage with Firebase?

      Ans :

      • Session Management: FirebaseAuth automatically manages the user session once logged in. Use FirebaseAuth.getInstance().getCurrentUser() to get the current user.

  2. Realtime Database:

    • Explain how you integrated Firebase Realtime Database for dynamic data updates.

    • How did you structure the database to manage different types of data (user info, product details, rental history)?

  3. Security Rules:

    • How did you configure Firebase security rules to protect user data and ensure proper access control?

      Updated The Time Limit to 2025

      {
        "rules": {
      	".read": "now < 1779621600000", // 2025-12-31
      	".write": "now < 1779621600000", // 2025-12-31
        }
      }

General Project Questions

  1. Project Management:

    • How did you manage your project timeline and tasks from December 2022 to November 2023?

    • What challenges did you face during the development of this app and how did you overcome them?

  2. Collaboration:

    • If you worked with a team, how did you coordinate and collaborate on this project?

    • How did you handle version control and code integration with your team?

  3. Feature Implementation:

    • Can you walk us through the implementation of a key feature (e.g., the product renting functionality)?

      1. First, I created an Object Class "Product.java". Encapsulating the characteristic of product like name, description, rating, price and location. Integrating Getter Setter method

      2. Create a Collection name "Product" in Fire store database

      3. Activity Setup

        1. Class Declaration: Extend AppCompatActivity for the sellRentScreen class.Create a SellRent.java connecting the UI with the Class

        2. Layout Setup: Set up activity_main_sell_rent.xml layout file in onCreate method. Create a Form UI in Activity.XML

      4. Login Info Handling

        • Intent Handling: Retrieve email information from the previous activity via Intent.

      5. UI Components Initialization

        • Buttons: Initialize buttons for image upload (select_img) and posting (post_it).

        • ImageView and EditTexts: Initialize ImageView for displaying selected image and EditText fields for product details.

      6. Image Uploading Functionality

        • Open Gallery: Set an OnClickListener for the upload button to open the device's gallery.

        • Handle Image Selection: Override onActivityResult to handle image selection and display it using Glide.

        • Upload Image to Firebase Storage:

          • Get File Extension: Retrieve file extension using ContentResolver and MimeTypeMap.

          • Upload Image: Upload the selected image to Firebase Storage and get the download URL.

      7. Insert Product Information into Firestore

        • Create Progress Dialog: Show a progress dialog while uploading data.

        • Prepare Data: Create a HashMap to store product details.

        • Add Data to Firestore:

          • Products Collection: Add product details to the "Products" collection.

          • User Collection: Add product status to the user's collection identified by email.

      8. Post Button Functionality

        • OnClick Listener: Set up OnClickListener for the post button to trigger data insertion.

        • Start New Activity: Start menuScreen activity and pass login email via Intent.

    • How did you ensure the real-time updates worked seamlessly for all users?

Problem-Solving

  1. Optimization:

    • Did you encounter any performance issues? How did you optimize the app's performance?

      Ans:

      1. Image Uploading Delays

        • Issue: Uploading large images to Firebase Storage could cause delays.

        • Optimization:

          • Image Compression: Compress images before uploading to reduce file size.

          • Asynchronous Tasks: Ensure image uploads run asynchronously to keep the UI responsive. Added a Progress Loading bar

    • How did you ensure that your app is scalable and maintainable?

Additional Questions

  1. Future Improvements:

    • If you had more time, what additional features or improvements would you like to add to your app?

      • Searching and Category System

      • Notification System After Date Expired / Overall System

Challenges and Learning

  1. What were the biggest challenges you encountered during this project?

  2. How did you handle security concerns related to user data and transactions?

  3. What have you learned from this project that you will apply to future projects?

Last updated