Okhelp.cz

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.

Change Screen Orientation Programmatically Android


AD MOB

Landscape - portrait orientation change:

boolean mbOrientationLandscape = true;
if(mbOrientationLandscape ){
	setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
	mbOrientationLandscape =false;
}else{
	setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
	mbOrientationLandscape =true;
}


397LW NO topic_id




AD

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


328

Screen size density independent pixel resolution | screen-size-density-independent-pixel-resolution


Terms Screen size, density, density independent pixel, resolution as a picture - pictogram.
mobile-phone-screen-resolution-terms

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.

 

 
250

Drawable Bitmap get width height Android | drawable-bitmap-get-width-height-android



		Drawable dr = getResources().getDrawable(R.drawable.algebra);
		int h = dr.getIntrinsicHeight();
		int w = dr.getIntrinsicWidth();

		Bitmap ball = BitmapFactory.decodeResource(getResources(), R.drawable.algebra);
		int _nWidth = ball.getWidth();
		int _nHeight = ball.getHeight();


179

Samsung Galaxy S | samsung-galaxy-s


Samsung Galaxy S nejlepší cena od 4 500 KCZ Kč (únor.2012)
Samsung Galaxy S je chytrý telefon s operačním systémem Android.
Samsung Galaxy S je (22.února2012) 5. a 6. nejpoužívanějším chytrým telefonem u programu Sky Map viz tabulka.


Samsung Galaxy S byl představen firmou Samsung v březnu 2010. Je vybaven 1 GHz ARM "Hummingbird - kolibřík" procesorem, 8-16 GB interní flash pamětí, 4-palcovým 480 × 800 pixelů Super AMOLED kapacitním dotykovým displejem, Wi-Fi připojením, 5-megapixelovým fotoaparátem s maximálním rozlišením 2560x1920 a u vybraných modelů předním čelním 0,3 MP fotoaparátem VGA (640x480).

Samsung Galaxy S photo pic image
samsung galaxy s2
Zdroj obrázku: wikipedia
100

How evaluate any expression in Eclipse debugger editor Android example | how-evaluate-any-expression-in-eclipse-debugger-editor-android-example


Tutorial by pictures how evaluate a variable in Eclipse debugger window.

1.) Open Debug perspective in Eclipse and to start debugging a Activity.
eclipse-debug-perspective


2.) Open Display window from menu Window->Show view->Display

eclipse dislplay window

3.) Set breakpoint where you need to evaluate a variable.

eclipse-toggle-breakpoint

4.) Debug the Activity to breakpoint.

eclipse-debugger-breakpoint


5.) Into the Display window type code for evaluate your variable and execute code.

eclipse-type-evaluate-code-to-display-window


6.) Check if change of value a variable

eclipse-evaluate-a-variable

244

Include xml into another xml Android Example | include-xml-into-another-xml-android-example


How include layout defined in other xml file into another xml file example:
res/layout/my_layout.xml into
main.xml

<include  layout="@layout/my_layout" android:id="@+id/idMyLayout" />


Editace: 2013-07-21 11:21:34
Počet článků v kategorii: 397
Url:change-screen-orientation-programmatically-android

AD
11 Share
Share
Tweet