Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

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.



396LW NO topic_id


Další témata ....(Topics)


Hashtable find value by key Java Android example | hashtable-find-value-by-key-java-android-example

Hashtable find value by key Java Android basic example.

import java.util.Hashtable;

public class MainClass {
	public static void main(String[] arg) {
		// english;germany dictionary
		String[] arrayOfString = { "one;eine", "two;zwei", "three;drei" };

	    Hashtable hashTable = new Hashtable();
	    for(String s: arrayOfString){
	    	String[] array = s.split(";");
	    	String sKey ="", sValue="";
	    	if(array.length > 1){
	    	sKey = array[0]; sValue = array[1];
	    		hashTable.put(sKey, sValue);

       // check if key exists 	    
	   if( hashTable.containsKey("two")){
		System.out.print("two = " + hashTable.get("two"));
two = zwei

Emulator window was out of view and was recentred - Android emulator warning | emulator-window-was-out-of-view-and-was-recentred-android-emulator-warning

Emulator window was out of view and was recentred
Emulator] WARNING: Data partition already in use. Changes will not persist!
Emulator] WARNING: SD Card image already in use: C:\Documents and Settings\user_name\.android\avd\hvga21_up1_7.avd/sdcard.img
Emulator] WARNING: Cache partition already in use. Changes will not persist!

Basic step
Try restart Eclipse if using from menu File->Restart

Other solutions

Solution 1: try restart ADB server

Solution 2:

Delete Run Configuration


Solution 3:
Try delete:

c:\Documents and Settings\user_name\.android\avd\my_avd.avd\cache.img
c:\Documents and Settings\user_name\.android\avd\my_avd.avd\userdata-qemu.img

Try solution 4:
Eclipse menu select Window->Preferences->Android

Windows 32

FROM: C:\Program Files\Android\android-sdk
TO: C:\PROGRA~1\Android\android-sdk

Windows 64

FROM: C:\Program Files (x86)\Android\android-sdk
TO: C:\PROGRA~2\Android\android-sdk

HTC Incredible 2 | htc-incredible-2

HTC Incredible 2 cena od 6 000 KCZ Kč (únor.2012)
Spokojenost uživatelů nadprůměrná.
HTC Incredible 2 je chytrý telefon s operačním systémem Android.
HTC Incredible 2 je (22.února2012) 7. nejpoužívanějším chytrým telefonem u programu Sky Map viz tabulka.

HTC Incredible 2 - video recense