
- Android Basics
- Android - Home
- Android - Overview
- Android - Environment Setup
- Android - Architecture
- Android - Application Components
- Android - Hello World Example
- Android - Resources
- Android - Activities
- Android - Services
- Android - Broadcast Receivers
- Android - Content Providers
- Android - Fragments
- Android - Intents/Filters
- Android - User Interface
- Android - UI Layouts
- Android - UI Controls
- Android - Event Handling
- Android - Styles and Themes
- Android - Custom Components
- Android Advanced Concepts
- Android - Drag and Drop
- Android - Notifications
- Location Based Services
- Android - Sending Email
- Android - Sending SMS
- Android - Phone Calls
- Publishing Android Application
- Android Useful Examples
- Android - Alert Dialoges
- Android - Animations
- Android - Audio Capture
- Android - AudioManager
- Android - Auto Complete
- Android - Best Practices
- Android - Bluetooth
- Android - Camera
- Android - Clipboard
- Android - Custom Fonts
- Android - Data Backup
- Android - Developer Tools
- Android - Emulator
- Android - Facebook Integration
- Android - Gestures
- Android - Google Maps
- Android - Image Effects
- Android - ImageSwitcher
- Android - Internal Storage
- Android - JetPlayer
- Android - JSON Parser
- Android - Linkedin Integration
- Android - Loading Spinner
- Android - Localization
- Android - Login Screen
- Android - MediaPlayer
- Android - Multitouch
- Android - Navigation
- Android - Network Connection
- Android - NFC Guide
- Android - PHP/MySQL
- Android - Progress Circle
- Android - ProgressBar
- Android - Push Notification
- Android - RenderScript
- Android - RSS Reader
- Android - Screen Cast
- Android - SDK Manager
- Android - Sensors
- Android - Session Management
- Android - Shared Preferences
- Android - SIP Protocol
- Android - Spelling Checker
- Android - SQLite Database
- Android - Support Library
- Android - Testing
- Android - Text to Speech
- Android - TextureView
- Android - Twitter Integration
- Android - UI Design
- Android - UI Patterns
- Android - UI Testing
- Android - WebView Layout
- Android - Wi-Fi
- Android - Widgets
- Android - XML Parsers
- Android Useful Resources
- Android - Questions and Answers
- Android - Useful Resources
- Android - Discussion
How to draw profile icon shape in android?
This example demonstrate about How to draw profile icon shape in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?> <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" android:gravity="center" android:layout_marginTop="30dp" tools:context=".MainActivity"> <ImageView android:layout_width="100dp" android:layout_height="100dp" android:background="@drawable/background"/> </LinearLayout>
In the above code, we have taken imageview and added background as background.xml.
Step 3 − Add the following code to drawable/ background.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:autoMirrored="true" android:viewportWidth="277.58" android:viewportHeight="277.58"> <path android:fillColor="#D80027" android:pathData="M138.46,164.287c-38.628,0 -69.925,-37.519 -69.925,-83.767C68.535, 34.277 99.832,0 138.46,0c38.634,0 69.957,34.277 69.957,80.52C208.417, 126.768 177.093,164.287 138.46,164.287zM29.689,277.528c0,0 -14.832, 0.979 -21.365,-8.023c-3.53,-4.863 -1.071,-14.718 1.343,-20.217l5.912, -13.473c0,0 16.35,-36.567 34.962,-57.757c11.433,-12.994 25.031, -10.035 33.826,-5.809c5.417,2.6 11.542,10.176 16.018,14.191c6.168, 5.532 17.057,11.819 34.859,12.173h10.922c17.791,-0.354 28.68, -6.641 34.843,-12.173c4.471,-4.014 10.427,-11.825 15.795, -14.511c8.072,-4.041 20.358,-6.527 31.492,6.13c18.618,21.191 33.363, 58.421 33.363,58.421l6.059,13.212c2.507,5.461 5.075,15.267 1.643, 20.195c-6.124,8.811 -19.874,7.642 -19.874,7.642S29.689,277.528 29.689, 277.528z" /> </vector>
Let's try to run your application. I assume you have connected your actual Android Mobile device with your computer. To run the app from android studio, open one of your project's activity files and click Run icon from the toolbar. Select your mobile device as an option and then check your mobile device which will display your default screen –
Click here to download the project code
- Related Articles
- How to draw close shape in android?
- How to draw love shape in android?
- How to draw star shape in android?
- How to draw triangle shape in android?
- How to draw tick mark with circle background shape in android?
- How to add action icon in android?
- How to set android notification icon?
- How to set Large icon instead of small icon on Android Notification?
- How to change android overflow menu icon programmatically?
- How to draw a geometrical 2D shape in JavaFX?
- How to display count of notifications in toolbar icon in Android?
- How to display count of notifications in Android app launcher icon?
- How to draw a line in Android?
- How to change the Android Overflow menu icon programmatically using Kotlin?
- How to draw text on Image in Android?
