• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Need Help Please

I'm making a fake bank app for a trend on tiktok that uses fake dabloons to buy stuff for fun
I need help to make a balance working, buy working, and make a inventory to see what you bought
 
I'm making a fake bank app for a trend on tiktok that uses fake dabloons to buy stuff for fun
I need help to make a balance working, buy working, and make a inventory to see what you bought
i'm not a dev, but where are you stuck at? do you know how to code an app? are you asking for help on how to write the app? have you started?
 
i'm not a dev, but where are you stuck at? do you know how to code an app? are you asking for help on how to write the app? have you started?
I have started I have the basics down it has the name and three button one for balance one for buy and one for inventory, I don't know how to make a variable called dabloons and make it save, and I want to be able to click on the balance and see how many dabloons I have, and for buy I want to just put an item name and subtract dabloons by a input number, also when I buy have the item get sent to the inventory
 
To create a balance and inventory system for your fake bank app, you can follow these steps:

  1. Create a class to represent the items that can be purchased. This class should include variables to store the name, price, and any other relevant information about the item. For example:
Code:
class Item {
  private String name;
  private int price;
  // Other variables and methods
}

  1. Create a class to represent the user's balance and inventory. This class should include a variable to store the user's balance, and a list to store the items that the user has purchased. For example:
Code:
class User {
  private int balance;
  private List<Item> inventory;
 
  // Constructor to initialize balance and inventory
  public User(int balance) {
    this.balance = balance;
    this.inventory = new ArrayList<>();
  }
 
  // Method to purchase an item
  public void buyItem(Item item) {
    if (item.getPrice() <= balance) {
      balance -= item.getPrice();
      inventory.add(item);
    } else {
      // Insufficient funds
    }
  }
 
  // Other methods to get balance and inventory
}

  1. In your app's main activity, create an instance of the User class and initialize it with the starting balance. You can then use the buyItem() method to allow the user to purchase items from the app.

  2. To display the user's balance and inventory, you can create a separate activity or fragment to show this information. You can use a RecyclerView to display the items in the user's inventory, and display the balance using a TextView or similar widget.
I hope this helps! Let me know if you have any questions.
 
Back
Top Bottom