Design a custom button and get the XML for your Android app.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#3b82f6" />
<corners android:radius="8dp" />
<stroke
android:width="2dp"
android:color="#1e40af" />
<padding
android:left="16dp"
android:top="8dp"
android:right="16dp"
android:bottom="8dp" />
</shape><Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="My Button"
android:textColor="#FFFFFF"
android:background="@drawable/custom_button" />The Android XML Button Generator is a time-saving tool for mobile developers. It eliminates the need to write complex XML from scratch by providing an intuitive visual editor for creating custom button designs. Use the interactive controls to customize properties like background color, gradients, corner radius, borders, and padding. The tool provides a live preview of your button and instantly generates the necessary XML code for both the shape drawable and the Button widget, ready to be copied directly into your Android Studio project.
- Use the controls on the left to customize your button's appearance.
- Adjust properties like "Button Text," "Text Color," "Background Color" (solid or gradient), "Corner Radius," and "Border."
- The live preview on the right will update in real-time to reflect your changes.
- Once you are satisfied with the design, copy the generated XML code from the two output boxes:
- Drawable XML: Save this code as a new file in your project's `res/drawable/` folder (e.g., `custom_button.xml`).
- Layout XML: Use this `<Button>` tag in your layout files and set its `android:background` attribute to reference the new drawable file you created (e.g., `android:background="@drawable/custom_button"`).
Password Strength Analyzer
Test the exact strength of your passwords against realistic cracking algorithms. Discover how long it would take a hacker to guess your password.
RSA Key Pair Generator
Generate secure RSA Public and Private Key pairs securely within your browser using the native Web Crypto API. Export to standard PEM format instantly.
CIDR Subnet Calculator
Calculate IPv4 subnets, broadcast addresses, wildcard masks, and usable host ranges seamlessly with this instant CIDR notation calculator.
SQL Query Formatter
Format, beautify, and standardize your SQL queries. Instantly turn unreadable, minified, or messy SQL statements into beautifully indented and color-coded code.