Random

Android studio payment app UI design

Pinterest LinkedIn Tumblr

Android studio Xml, Kotlin payment app ui with complete source code for free by Shashank Singhal. Ideal for payment app, homepage design templates etc.

Author

Author Name:- Vishal Swami
GitHub Link:- https://github.com/

Here’s an example of a payment app UI design using Android Studio. Below is a step-by-step guide:

Step 1: Set up your project
Create a new Android project in Android Studio.

Step 2: Create the layout files
Create the following layout files in your project:

activity_payment.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".PaymentActivity">

    <!-- Payment amount -->
    <TextView
        android:id="@+id/textViewAmount"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:gravity="center"
        android:text="Enter payment amount"
        android:textSize="18sp" />

    <!-- Payment input field -->
    <EditText
        android:id="@+id/editTextPayment"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="32dp"
        android:hint="Payment amount"
        android:inputType="numberDecimal"
        android:textSize="24sp" />

    <!-- Payment methods -->
    <TextView
        android:id="@+id/textViewPaymentMethods"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:gravity="center"
        android:text="Select payment method"
        android:textSize="18sp" />

    <!-- Payment method options -->
    <RadioGroup
        android:id="@+id/radioGroupPaymentMethods"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="32dp"
        android:orientation="vertical">

        <RadioButton
            android:id="@+id/radioButtonCreditCard"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Credit Card" />

        <RadioButton
            android:id="@+id/radioButtonPayPal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="PayPal" />

        <RadioButton
            android:id="@+id/radioButtonGooglePay"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Google Pay" />
    </RadioGroup>

    <!-- Pay button -->
    <Button
        android:id="@+id/buttonPay"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="32dp"
        android:text="Pay Now" />

</LinearLayout>

Step 3: Create the Activity class
Create a new Java or Kotlin class named PaymentActivity and update it with the following code:

PaymentActivity.java:

public class PaymentActivity extends AppCompatActivity {

    private TextView textViewAmount;
    private EditText editTextPayment;
    private RadioGroup radioGroupPaymentMethods;
    private Button buttonPay;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_payment);

        textViewAmount = findViewById(R.id.textViewAmount);
        editTextPayment = findViewById(R.id.editTextPayment);
        radioGroupPaymentMethods = findViewById(R.id.radioGroupPaymentMethods);
        buttonPay = findViewById(R.id.buttonPay);

        buttonPay.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String paymentAmount = editTextPayment.getText().toString();
                int selectedPaymentMethodId = radioGroupPaymentMethods.getCheckedRadioButtonId();
                String paymentMethod = "";

                switch (selectedPaymentMethodId) {
                    case R.id.radioButtonCreditCard:
                        paymentMethod = "Credit Card";
                        break;
                    case R.id.radioButtonPayPal:
                        paymentMethod = "PayPal";
                        break;
                    case R.id.radioButtonGooglePay:
                        paymentMethod = "Google Pay";
                        break;
                }

                String paymentDetails = "Payment Amount: " + paymentAmount +
                        "\nPayment Method: " + paymentMethod;

                Toast.makeText(PaymentActivity.this, paymentDetails, Toast.LENGTH_SHORT).show();
            }
        });
    }
}

Step 4: Connect the Activity to the layout file
Open the AndroidManifest.xml file and add the following line inside the <application> tag:

<activity android:name=".PaymentActivity" />

Step 5: Build and run the app
Build and run your app on an emulator or physical device.

Congratulations! You have created a payment app UI design in Android Studio. The UI includes an input field for the payment amount, radio buttons for selecting the payment method, and a button to initiate the payment. When the user clicks the “Pay Now” button, a Toast message is displayed showing the payment amount and selected payment method.

Feel free to customize the UI elements and add additional functionality as per your requirements.

Vishal Swami is a hardcore Android programmer and Android programming has been his passion since he compiled his first hello-world program. Solving real problems of Android developers through tutorials has always been an interesting part for him.

88 Comments

  1. Thanks for the sensible critique. Me & my neighbor were just preparing to do a little research on this. We got a grab a book from our local library but I think I learned more from this post. I’m very glad to see such wonderful information being shared freely out there.

  2. Great write-up, I am regular visitor of one¦s web site, maintain up the nice operate, and It is going to be a regular visitor for a long time.

  3. Hello! I just wanted to ask if you ever have any trouble with hackers? My last blog (wordpress) was hacked and I ended up losing months of hard work due to no data backup. Do you have any solutions to protect against hackers?

  4. With havin so much content and articles do you ever run into any problems of plagorism or copyright infringement? My website has a lot of exclusive content I’ve either authored myself or outsourced but it seems a lot of it is popping it up all over the internet without my authorization. Do you know any ways to help reduce content from being ripped off? I’d truly appreciate it.

  5. Wow, incredible blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your site is wonderful, let alone the content!

  6. Does your website have a contact page? I’m having a tough time locating it but, I’d like to send you an e-mail. I’ve got some suggestions for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it grow over time.

  7. I’ll immediately grab your rss as I can’t to find your e-mail subscription link or e-newsletter service. Do you have any? Kindly permit me recognise so that I may subscribe. Thanks.

  8. I have seen that these days, more and more people are being attracted to cams and the issue of digital photography. However, being a photographer, you should first spend so much period deciding the model of photographic camera to buy in addition to moving via store to store just so you could potentially buy the most inexpensive camera of the brand you have decided to pick. But it would not end there. You also have take into consideration whether you can purchase a digital digital camera extended warranty. Thx for the good tips I obtained from your website.

  9. Thanks for every other informative web site. Where else could I am getting that type of info written in such an ideal way? I’ve a project that I am simply now operating on, and I’ve been at the look out for such information.

  10. What Is Exactly Emperor’s Vigor Tonic? Emperor’s Vigor Tonic is a clinically researched natural male health formula that contains a proprietary blend of carefully selected ingredients.

  11. hello!,I really like your writing very a lot! percentage we keep up a correspondence extra about your post on AOL? I require a specialist on this space to resolve my problem. Maybe that’s you! Taking a look ahead to peer you.

  12. The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.

  13. I like what you guys are up also. Such intelligent work and reporting! Carry on the superb works guys I?¦ve incorporated you guys to my blogroll. I think it’ll improve the value of my site 🙂

  14. I have been exploring for a little bit for any high-quality articles or blog posts on this sort of house . Exploring in Yahoo I finally stumbled upon this site. Reading this info So i?¦m happy to show that I’ve a very good uncanny feeling I found out just what I needed. I so much definitely will make certain to do not omit this web site and provides it a glance regularly.

  15. I have recently started a web site, the info you provide on this website has helped me tremendously. Thank you for all of your time & work.

  16. Hello, you used to write magnificent, but the last several posts have been kinda boringK I miss your great writings. Past few posts are just a little out of track! come on!

  17. Thank you for sharing excellent informations. Your website is very cool. I’m impressed by the details that you have on this web site. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for more articles. You, my pal, ROCK! I found simply the info I already searched all over the place and simply couldn’t come across. What a great website.

  18. Good site! I really love how it is simple on my eyes and the data are well written. I am wondering how I might be notified when a new post has been made. I have subscribed to your feed which must do the trick! Have a great day!

  19. Hi my family member! I want to say that this article is amazing, great written and come with almost all important infos. I’d like to look extra posts like this.

  20. Hi there just wanted to give you a quick heads up and let you know a few of the images aren’t loading correctly. I’m not sure why but I think its a linking issue. I’ve tried it in two different internet browsers and both show the same outcome.

  21. Unquestionably consider that that you said. Your favourite reason seemed to be on the internet the easiest thing to understand of. I say to you, I certainly get irked whilst other people consider worries that they just don’t recognise about. You managed to hit the nail upon the top as well as defined out the entire thing with no need side-effects , other people can take a signal. Will likely be back to get more. Thank you

  22. Hello would you mind letting me know which hosting company you’re working with? I’ve loaded your blog in 3 completely different browsers and I must say this blog loads a lot quicker then most. Can you suggest a good hosting provider at a honest price? Thanks a lot, I appreciate it!

  23. Hi there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thank you for sharing!

  24. You completed certain good points there. I did a search on the subject matter and found nearly all people will consent with your blog.

  25. I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.

  26. A person essentially help to make seriously articles I would state. This is the very first time I frequented your web page and thus far? I surprised with the research you made to create this particular publish incredible. Excellent job!

  27. I have realized some points through your blog post post. One other stuff I would like to convey is that there are plenty of games in the marketplace designed in particular for preschool age young children. They involve pattern identification, colors, pets, and patterns. These usually focus on familiarization as opposed to memorization. This helps to keep children engaged without experiencing like they are studying. Thanks

  28. Another thing I have noticed is for many people, a bad credit score is the reaction to circumstances beyond their control. One example is they may have already been saddled with illness and because of this they have substantial bills for collections. It could be due to a employment loss or maybe the inability to do the job. Sometimes divorce proceedings can send the financial circumstances in a downward direction. Many thanks for sharing your thinking on this blog site.

  29. After study a couple of of the weblog posts in your website now, and I actually like your way of blogging. I bookmarked it to my bookmark web site record and can be checking again soon. Pls try my web site as nicely and let me know what you think.

Write A Comment