Screen size density independent pixel resolution
Terms Screen size, density, density independent pixel, resolution as a picture - pictogram.
Test your knowledge
Q: How to find out the phone screen size?
A: (By length of display diagonale in inch - Not to measure a diagonal of device!!!)
Q: What resolution has 720 x 1280 display?
A: (921600 pixels)
Q: What does it mean "240 dpi" screen density?
A: (Display have density 240 x 240 dots - "Tri-color LED etc." - per every physical (real) square inch. If you have icon 240x240 pixels, this will just occupy an area of one square inch on the display.)
Q: Phone have screen density 240 dpi. Image for 160 dpi screen density have size 128x 128 pixels. What will be the size of the image for 240 dpi screen density?
A: (Calculate the virtual pixels size. 128 * (240/160) = 192. You have to resize image to new size 192 x 192 physical pixels and put into folder drawable-hdpi (high) ~240dpi for phone with screen density 240 dpi. ) or use density independend pixels 128dp x 128dp.

Test your knowledge
Q: How to find out the phone screen size?
A: (By length of display diagonale in inch - Not to measure a diagonal of device!!!)
Q: What resolution has 720 x 1280 display?
A: (921600 pixels)
Q: What does it mean "240 dpi" screen density?
A: (Display have density 240 x 240 dots - "Tri-color LED etc." - per every physical (real) square inch. If you have icon 240x240 pixels, this will just occupy an area of one square inch on the display.)
Q: Phone have screen density 240 dpi. Image for 160 dpi screen density have size 128x 128 pixels. What will be the size of the image for 240 dpi screen density?
A: (Calculate the virtual pixels size. 128 * (240/160) = 192. You have to resize image to new size 192 x 192 physical pixels and put into folder drawable-hdpi (high) ~240dpi for phone with screen density 240 dpi. ) or use density independend pixels 128dp x 128dp.
396LW NO topic_id
AD
Další témata ....(Topics)
Basic difference remember it!!!
if(TRUE && TRUE && TRUE) return TRUE otherwise FALSE
if(FALSE || FALSE || FALSE) return FALSE otherwise TRUE
Logical operator and &&
If all conditions/operands is TRUE return TRUE, otherwise return FALSE
Logical operator or ||
The logical OR operator (||) returns the boolean value true if either or both operands is true and returns false otherwise.
If one operands is TRUE, condition is TRUE:
rev
if(TRUE && TRUE && TRUE) return TRUE otherwise FALSE
if(FALSE || FALSE || FALSE) return FALSE otherwise TRUE
Logical operator and &&
If all conditions/operands is TRUE return TRUE, otherwise return FALSE
if( true and true and true){
// return true - do something
}
int a = 6;
if(a == 6 && a == 6 ) {
// if TRUE
// true && true return true, do something
}
if(a == 6 && a == 5){
// nothing, not attended
}else{
// true && false return false, or false && false return false
// do something
}
Logical operator or ||
The logical OR operator (||) returns the boolean value true if either or both operands is true and returns false otherwise.
If one operands is TRUE, condition is TRUE:
if(FALSE OR FALSE OR TRUE) return TRUE
if(FALSE OR TRUE OR FALSE) return TRUE
if(FALSE OR FALSE OR FALSE) return FALSE
int a = 6;
if(a==6 || a==5){ // TRUE || FALSE return TRUE
//if return TRUE
//one from operadns is TRUE return true, do something
}
if(a==5 || a==4){ // FALSE || FALSE return FALSE
// not attended
}else{
//if return FALSE, do something
}
rev
Eclipse make own color of toolbars, windows, status bar etc.
https://github.com/jeeeyul/eclipse-themes/wiki/Alternative-Install
https://github.com/jeeeyul/eclipse-themes/wiki/Alternative-Install


Eclipse Navigation Shortcuts.
Keyboard_shortcuts_(3.0).pdf
Ctrl+1 Quick fix problem
Ctrl+O Quick Outline
Ctrl+Shift+G Find references in workspace
Ctrl+Shift+U Find all references in file
Ctrl+Shift+T Find Java Typ
[caption id="attachment_1214" align="alignleft" width="150" caption="eclipse-ctrl-shift-t"]
[/caption]
Ctrl+Shift+R Find Resource
Ctrl+E Open Editor Drop-Down
Ctrl+Space Content Assist
Ctrl+Shift+Space Context Information
F3 Open Declaration of variable
F4 Open Type Hierarchy
Ctrl+H Open Search Dialog
Alt+Shift+R Rename - Refactoring
Alt+Shift+M Extract Method
Alt+Shift+L Extract Local Variable
Alt Shift Up Expand selection to enclosing element
Alt Shift Right Expand selection to next element
Alt Shift Left Expand selection to previous element
Alt Shift Down Restore previous selection
Breakpoints Shift+Alt+Q B
Cheat Sheets Shift+Alt+Q H
Console Shift+Alt+Q C
Java Declaration Shift+Alt+Q D
Java Package Explorer Shift+Alt+Q P
Java Type Hierarchy Shift+Alt+Q T
Javadoc Shift+Alt+Q J
Search Shift+Alt+Q S
Show View (View: Outline)Shift+Alt+Q O
Show View (View: Problems)Shift+Alt+Q X
Synchronize Shift+Alt+Q Y
Variables Shift+Alt+Q V

Keyboard_shortcuts_(3.0).pdf
Ctrl+1 Quick fix problem

Ctrl+O Quick Outline

Ctrl+Shift+G Find references in workspace
Ctrl+Shift+U Find all references in file

Ctrl+Shift+T Find Java Typ
[caption id="attachment_1214" align="alignleft" width="150" caption="eclipse-ctrl-shift-t"]

Ctrl+Shift+R Find Resource

Ctrl+E Open Editor Drop-Down
Ctrl+Space Content Assist

Ctrl+Shift+Space Context Information

F3 Open Declaration of variable
F4 Open Type Hierarchy
Ctrl+H Open Search Dialog
Alt+Shift+R Rename - Refactoring
Alt+Shift+M Extract Method
Alt+Shift+L Extract Local Variable
Alt Shift Up Expand selection to enclosing element
Alt Shift Right Expand selection to next element
Alt Shift Left Expand selection to previous element
Alt Shift Down Restore previous selection
Breakpoints Shift+Alt+Q B
Cheat Sheets Shift+Alt+Q H
Console Shift+Alt+Q C
Java Declaration Shift+Alt+Q D
Java Package Explorer Shift+Alt+Q P
Java Type Hierarchy Shift+Alt+Q T
Javadoc Shift+Alt+Q J
Search Shift+Alt+Q S
Show View (View: Outline)Shift+Alt+Q O
Show View (View: Problems)Shift+Alt+Q X
Synchronize Shift+Alt+Q Y
Variables Shift+Alt+Q V

Android development
Java float is 32 bit single precision type and used when fractional precision calculation is required.
Java float je 32 bitů veliké číslo sloužící především pro přesný výsledek za desetinnou tečkou například při dělení čísel. Pro větší přesnost použíijte 64 bitový typ Double.
Java float is 32 bit single precision type and used when fractional precision calculation is required.
Java float je 32 bitů veliké číslo sloužící především pro přesný výsledek za desetinnou tečkou například při dělení čísel. Pro větší přesnost použíijte 64 bitový typ Double.
// declaration and assignment of value type float
float x = 18.41785f;
//print formated value
System.out.printf("The value of x is %.3f%n", x); // 18.418
// declaring more variables in single statement
float f1 = 12.4F, f2 = 564.5F, f3 = 14.589F;
// float range of value
System.out.println(Float.MIN_VALUE); // 4E-45
System.out.println(Float.MAX_VALUE); // 4028235E38
// is NaN Not-a-Number
float f = (float) Math.sqrt(-15);
boolean bNaN = Float.isNaN(f);
System.out.print(bNaN); // true
// check if a string is a valid number in Java example
// convert string to float Java example
String sF = "12.8";
float fParse = Float.parseFloat(sF);
// convert strings to numbers
String sFl = "15.48";
float fFromString = (Float.valueOf(sFl)).floatValue();
// float to string in Java example code
Float fObj = new Float(68.5);
String str = fObj.toString();
// else
Float fS = 11.6f;
String sFloat = fS.toString();
// compare two float variables
Float fComp1 = 4.3f;
if(fComp1.equals(4.3f))
System.out.print("true");
// compares the two specified float values in Java example
int i = Float.compare(11.5f, 11.7f); // -1 first < second
// 0 first == second
// 1 first > second
System.out.print(i);
HorizontalScrollView ScrollView LinearLayout horizontal vertical Android xml basic example and image.
[caption id="attachment_889" align="alignleft" width="200" caption="horizontal scrollview horizontalscrollview android"]
[/caption]
Other sample
[caption id="attachment_889" align="alignleft" width="200" caption="horizontal scrollview horizontalscrollview android"]

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="//schemas.android.com/apk/res/android">
// horizontal and vertical Scrollview
<ScrollView android:id="@+id/ScrollView01"
android:layout_height="135px" android:layout_width="wrap_content"
android:scrollbars="horizontal|vertical">
// HorizontalScrollview
<HorizontalScrollView android:id="@+id/HorizontalScrollView01"
android:layout_height="fill_parent" android:layout_width="wrap_content">
<LinearLayout android:id="@+id/LinearLayout02"
android:layout_width="wrap_content" android:orientation="vertical"
android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<TextView android:text="red" android:gravity="center_horizontal"
android:background="#aa0000" android:layout_width="200px"
android:layout_height="fill_parent" android:layout_weight="1" />
<TextView android:text="green" android:gravity="center_horizontal"
android:background="#00aa00" android:layout_width="200px"
android:layout_height="fill_parent" android:layout_weight="1" />
<TextView android:text="blue" android:gravity="center_horizontal"
android:background="#0000aa" android:layout_width="200px"
android:layout_height="fill_parent" android:layout_weight="1" />
<TextView android:text="yellow" android:gravity="center_horizontal"
android:background="#aaaa00" android:layout_width="200px"
android:layout_height="fill_parent" android:layout_weight="1" />
</LinearLayout>
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<TextView android:text="row one" android:textSize="15pt"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView android:text="row two" android:textSize="15pt"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView android:text="row three" android:textSize="15pt"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView android:text="row four" android:textSize="15pt"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
</ScrollView>
</LinearLayout>
Other sample
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/layout"
android:orientation="vertical" >
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello world! First TextView" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
Editace: 2015-11-29 12:26:12
Počet článků v kategorii: 396
Url:screen-size-density-independent-pixel-resolution