Showing posts with label Android Studio. Show all posts
Showing posts with label Android Studio. Show all posts

Saturday, October 23, 2021

List and Run AVD from CMD - Windows

 List:


Run:



Sunday, October 1, 2017

Failed to Resolve: com.android.support.constraint:constraint-layout:1.0.2


Solution : Click File->Settings->Android SDK->SDK Tools. Then Install :
1. Constrains layout for android
2. Solver for constrains layout

Next... Clean your android project and rebuild again... :)
Doneee...

Sunday, July 10, 2016

Basic Drawable Vector Android

These are the basic commands for drawing drawable in Android :
  • M = moveto
  • L = lineto
  • H = horizontal lineto
  • V = vertical lineto
  • C = curveto
  • S = smooth curveto
  • Q = quadratic Bézier curve
  • T = smooth quadratic Bézier curveto
  • A = elliptical Arc
  • Z = closepath
So let's create a new drawable vector on androd. Right click on drawable folder, choose "new" then "drawable resource file" :
We're going to have a new file like this :
aaand... let's try to make a triangle first... :D :D :D
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="34dp"
    android:width="34dp"
    android:viewportHeight="340"
    android:viewportWidth="340"
    >
    <path
        android:fillColor="#FF0000"
        android:pathData="M150,0 L75,200 L225,200 Z"
        />

</vector>
Sooo... As you might notice from pathData. The first step is we moved to point 150,0 {M150,0}, Then drawing a line to point 75,200 {L75,200} and the last we drawed line to 225,200 {L225,200}. We finally closed the path by putting Z at the end. We don't really need this Z btw... :D But it just a sign that this is the end of the path...:D

So...If we want to draw a start using just L command, the code should be looking like this :
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="34dp"
    android:width="34dp"
    android:viewportHeight="340"
    android:viewportWidth="340"
    >
    <path
        android:fillColor="#90FF0F"
        android:pathData="M150,0 L75,200 L245,75 L55,75 L225,200 Z"
        />

</vector>
Okieee...That's all for Part I

Continue to Part II...

Monday, May 23, 2016

Android Gradient Color Examples

To the point ajjah.... Terserah org2 mo ngerti ato g'... yg penting Hisoka ngerti ehehe... :D

Teruuus....

Please pay attention to the angle value...

type and gradientRadius :


For more tag detail please take a look at android doc...
https://developer.android.com/reference/android/graphics/drawable/GradientDrawable.html

Friday, May 20, 2016

Glowing Pressed Button Part II

Okiee... Let's continue our game about button glowing... :v
Next let's add a new button in main layout....
Theeen... Instead of using clickListener, we are using touchListener here...
Aand the result is like this :
Okieee... That's the end of this part... :D
You can see my source code here....

Glowing Pressed Button Part I

This post will gonna show you steps for making a glowing button when pressed... :)
First let's create new project using android studio 2.1...



Next... Let's create our first button...
Then let's create new drawable xml file for default button gradient, right click on drawable folder, choose "New" then "Drawable resource file" as shown in picture below :
Give a name to that xml file :
Then give a code to default_gradient like this :

Nexxt... Add another drawable gradient {pressed_gradient} :
And then button_selector :
Aaaand.... finally we can assign this style to our button... :D
Result.....
Yeeeei... That's the end of part I... :D
Aaand.... You can download above android studio source code here....

Go to Part II....

Thursday, May 19, 2016

My Android Studio SDK Size

Size Awal :



Terus diganti jadi.... kek gini :
Daan...sizenya berkurang drastis .. yeeeei.. ... :)

Membuat Kotak EditText di Android

Okiee... Di sini Hisoka punya edittext default kyk gambar di bawah :
Naaah...edittext yang itu tuuh...pengen kita ubah...biar bentuknya jadi kotak, jadi sama kyk textbox di C#-wpf...eheh... :D
Soo...pertama-tama tambain resource drawable, klik kanan di folder drawable, pilih new, terus pilih drawable resource file :
Terus masukin nama file xml-nya terus tekan ok...
Naah...  kita dapat file kyk gini :
Naaah... di file-nya kita taroin kode xml kek gini :
Naaaah... uuudaaaah... terus kita ganti background di editextnya biar ngereference ke kotak.xml yang kita buat
Daaaan... hasilnyaaa.... kyk gini :
Naaah... itu warna tepinya biru... itu bisa diganti2 juga... silahkan dicoba2 tag2 lain di xml-nya terus liad perubahannya... :D