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.

No title bar Android application without titlebar style Theme NoTitleBar Android example



Set in AndroidManifest.xml android:theme="@android:style/Theme.NoTitleBar" AndroidManifest.xml example source code.
AndroidManifest.xml


<manifest xmlns:android="//schemas.android.com/apk/res/android"
    package="com.myexample.without_titlebar">
    <application android:label="My app">
      <activity android:name="NoTitleBar"
        android:theme="@android:style/Theme.NoTitleBar"
        android:screenOrientation="portrait"
        android:configChanges="keyboardHidden|orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>


397LW NO topic_id



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


200

Seznam smartphonu podle ceny | seznam-smartphonu-podle-ceny


Chytré telefony s Androidem - tabulka srovnání dle ceny:
























































































































































































































































































































































































































































































































































































































































































































































































































Výrobce

Model (codename)

Cena, včetně DPH

CPU MHz

displej-rozlišení

Velikost displeje v palcích

ROM

RAM

Huawei

Vodafone 845 (U8120, Joy)

1979

528

240x320

2.8

512

256

ZTE

Vodafone 945 (ZTE Joe)

1999

600

240x400

3.2

512

512

Huawei

Vodafone 858 Smart (U8160)

2177

528

240x320

2.8

512

256

Alcatel

T-Mobile Move (OT 908)

2294

600

240x320

2.8

512

512

Samsung

Galaxy Y (S5360)

2495

832

240x320

3

512

256

ZTE

Racer II (Arizona)

2536

500

240x320

2.8

512

256

Huawei

Ideos X1 (U8180, Orange Stockholm)

2549

528

240x320

2.8

512

256

Huawei

U8100

2595

528

240x320

2.8

512

256

Huawei

U8500

2699

600

320x480

3.2

512

256

Samsung

Galaxy Mini (S5570)

2799

600

240x320

3.14

512

256

Samsung

Galaxy 5, 550 (i5500)

2855

600

240x320

2.8

512

256

LG

Optimus Me (P350)

2924

600

240x320

2.8

512

512

SE

Xperia X8

2977

600

320x480

3

512

256

Gigabyte

GSmart G1310 (Roy)

2990

528

320x480

3.2

512

256

MyPhone

A210

2990

624

240x400

3

256

128

ZTE

Orange San Francisco (ZTE Blade, U880, P729V)

2999

600

480x800

3.5

512

512

HTC

Explorer (Pico)

3104

600

320x480

3.2

512

512

Huawei

U8650 (Sonic)

3290

600

320x480

3.5

512

256

Huawei

Ideos X3 (U8510, Blaze)

3377

600

320x480

3.2

512

256

Samsung

Galaxy Y Pro (B5510)

3390

832

240x320

2.6



Gigabyte

GSmart G1317D (Rola)

3504

528

240x400

3.2

512

256

SE

Xperia Live Walkman (WT19i)

3554

1000

320x480

3.2

1024

512

Huawei

T-Mobile Comet (Ideos, U8150)

3600

528

240x320

2.8

512

256

SE

Xperia X10 mini pro (U20i, Mimmi)

3777

600

240x320

2.55

512

256

LG

Optimus Swift (GT540)

3800

600

320x480

3

512

256

SE

Xperia Mini (ST15)

3800

1000

320x480

3

1024

512

LG

Optimus One (P500)

3919

600

320x480

3.2

512

512

LG

Optimus Pro

3928

800

240x320

2.8

512

256

HTC

Wildfire (Buzz, Mocha, A3333)

3999

528

240x320

3.2

512

384

LG

Optimus Net (P690)

4108

800

320x480

3.2

512

512

Samsung

Galaxy Gio (S5660)

4185

800

320x480

3.2

512

384

LG

Optimus Hub (Univa)

4195

800

320x480

3.5

512

512

SE

Xperia  X10 mini (E10i, Robyn)

4195

600

240x320

2.55

512

256

Samsung

Galaxy 3, 580, Taos (i5800)

4500

667

240x400

3.2

512

256

Samsung

Galaxy Ace+ (S7500)

4550

1000

320x480

3.65

4096

512

LG

Optimus Chic (E720)

4550

600

320x480

3.2

512

512

Samsung

Galaxy 551 (i5510)

4577

667

240x400

3.2

512

512

Motrolola

Liquid Mini E310

4600

600

320x480

3.2

512

512

HTC

Wildfire S (Marvell)

4777

600

320x480

3.2

512

512

Verzo

Kinzo

4799

1000

480x800

4.3

512

512

Samsung

 Galaxy Ace (S5830)

4800

800

320x480

3.5

512

256

Motorola

Defy mini

4800

600

320x480

3.2

512

512

Samsung

Galaxy Spica, Portal, Lite (i5700)

4800

800

320x480

3.2

512

256

HTC

Gratia (A6380, Liberty, Aria)

4937

480

320x480

3.2

512

384

SE

Xperia mini pro (SK17i, Mango)

4944

1000

320x480

3

1024

320

Huawei

Ideos X5 (U8800)

4977

800

480x800

3.8

4096

512

HTC

Salsa (C510e)

4990

600

320x480

3.4

576

512

Huawei

Boulder

4998

528

240x320

2.6

512

256

ZTE

Orange Monte Carlo (ZTE Skate)

5177

800

480x800

4.3

512

512

Samsung

Galaxy S (i9000)

5300

1000

480x800

4

15600

512

Gigabyte

GSmart G1315

5490

528

320x480

3.5

512

256

SE

Xperia Active

5500

1000

320x480

3

1024

512

Samsung

Google Nexus One

5750

1000

480x800

3.7

512

512

HTC

Desire  (A8181, Bravo)

5999

1000

480x800

3.7

576

512

LG

Optimus Black (P970)

6000

1000

480x800

4

1908

512

SE

Xperia Play

6000

1000

480x854

4



LG

Optimus Sol (Victor, E730)

6000

1000

480x800

3.8

2048

512

Acer

Liquid Metal S120

6061

800

480x800

3.6

512

512

Samsung

Google Nexus S

6200

1000

480x800

4

15600

512

HTC

Desire Z (A7272, Vision)

6200

800

480x800

3.7

1536

512

Samsung

Galaxy W (i8150, Ancora)

6200

1400

480x800

3.7

4096

512

SE

Xperia Ray (ST18i)

6344

1000

480x854

3.3

1024

512

Motorola

Defy (MB525, Jordan)

6377

800

480x854

3.7

1908

512

Motorola

Defy + (MB526)

6377

1000

480x854

3.7

1908

512

Samsung

Galaxy XCover (S5690)

6399

800

320x480

3.65

512

512

Gigabyte

GSmart G1345

6490

800

320x480

3.5

512

512

HTC

Evo 3D

6500

1200

540x960

4.3

1024

1024

HTC

Desire HD (Ace)

6500

1000

480x800

4.3

1900

768

Huawei

Honour (U8660)

6500

1400

480x854

4

4096

512

SE

Xperia Neo

6590

1000

480x854

3.7

1024

512

HTC

Legend (A6363)

6784

600

320x480

3.2

512

384

Huawei

Vision (U8850)

6999

1000

480x800

3.7

2048

512

SE

Xperia Arc (LT15i)

7390

1000

480x854

4.2

1024

512

SE

Xperia Pro (MK16i)

7890

1000

480x854

3.7

1024

512

HTC

Hero

7975

528

320x480

3.2

288

512

SE

Xperia Arc S (LT18i)

8590

1400

480x854

4.2

1024

512

Samsung

Xperia Live Walkman (WT19i)

9700

1500

480x800

4.3

16000

1024

Motorola

Droid Razr

11800

1200

540x960

4.3

15600

1024
161

Append text and ad text to TextView Android example | append-text-and-ad-text-to-textview-android-example



String s = "Some text for appending

"; TextView mTitle = (TextView) findViewById(R.id.title_text); mTitle.setText(R.string.app_name); // insert text from strings.xml mTitle.append(s); // append string like a variable value mTitle.append("My string will appended
"); // append string

You can insert this source code into onCreate in your activity file
36

Titlebar title bar change text setTile Android example | titlebar-title-bar-change-text-android-example


Change the title associated with this activity. If this is a top-level activity, the title for its window will change. If it is an embedded activity, the parent can do whatever it wants with it.




 String sTitle = "My new title";
 setTitle(sTitle);



313

findViewById in onCreate returns NULL when using Fragment | findviewbyid-in-oncreate-returns-null-when-using-fragment


Call findViewById from onCreateView

public class MainActivity extends ActionBarActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		if (savedInstanceState == null) {
			getSupportFragmentManager().beginTransaction()
					.add(R.id.containerMoje, new PlaceholderFragment()).commit();
		}
		
	}


	/**
	 * A placeholder fragment containing a simple view.
	 */
	public static class PlaceholderFragment extends Fragment {
		public PlaceholderFragment() {
		}

		@Override
		public View onCreateView(LayoutInflater inflater, ViewGroup container,
				Bundle savedInstanceState) {
			View rootView = inflater.inflate(R.layout.fragment_main, container,
					false);
			if (container == null) {
		        return null;
		    }


			 TextView mText;
			mText = (TextView)rootView.findViewById(R.id.idText);
			mText.setText("Hello from fragment_main");

			return rootView;
		}
	}
}




res\layout
activity_main.xml

<FrameLayout xmlns:android="//schemas.android.com/apk/res/android"
    xmlns:tools="//schemas.android.com/tools"
    android:id="@+id/containerMoje"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="cz.okhelp.autoskola.MainActivity"
    tools:ignore="MergeRootFrame" />



fragment_main.xml

<RelativeLayout xmlns:android="//schemas.android.com/apk/res/android"
    xmlns:tools="//schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="cz.okhelp.autoskola.MainActivity$PlaceholderFragment" >

    <TextView
        android:id="@+id/idText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />

</RelativeLayout>
12

TTS text to speech Android example | tts-text-to-speech


Android development example source code


// import
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
// you have to add implementation
public class Main extends Activity implements TextToSpeech.OnInitListener {
        private int _langTTSavailable = -1; // set up in onInit method
        // declaration
	private TextToSpeech mTts;


	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
// assigned handle - initialisation
			mTts = new TextToSpeech(this,
			        (OnInitListener) this  // TextToSpeech.OnInitListener
			        );
}

   // Implements TextToSpeech.OnInitListener.
    public void onInit(int status) {
        if (status == TextToSpeech.SUCCESS) {
            // Set preferred language to US english.
             _langTTSavailable = mTts.setLanguage(Locale.US); // Locale.FRANCE etc.
            if (_langTTSavailable == TextToSpeech.LANG_MISSING_DATA ||
            	_langTTSavailable == TextToSpeech.LANG_NOT_SUPPORTED) {
             } else if ( _langTTSavailable >= 0) {
			 mTts.speak("Good morning",
            TextToSpeech.QUEUE_FLUSH,  // Drop all pending entries in the playback queue.
            null);
            }
        } else {
            // Initialization failed.
        }
    }

    @Override
    public void onDestroy() {
        // TTS shutdown!
        if (mTts != null) {
            mTts.stop();
            mTts.shutdown();
        }

        super.onDestroy();
    }

}










Get supported language:


private TextToSpeech mTts;
// public void onInit(int status){
int result;
String s;
result = mTts.setLanguage(	Locale.	CANADA	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	CANADA	 not supported<br>"	;}else{s+="	CANADA	 supported<br>";}
result = mTts.setLanguage(	Locale.	CANADA_FRENCH	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	CANADA_FRENCH	 not supported<br>"	;}else{s+="	CANADA_FRENCH	 supported<br>";}
result = mTts.setLanguage(	Locale.	CHINA	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	CHINA	 not supported<br>"	;}else{s+="	CHINA	 supported<br>";}
result = mTts.setLanguage(	Locale.	CHINESE	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	CHINESE	 not supported<br>"	;}else{s+="	CHINESE	 supported<br>";}
result = mTts.setLanguage(	Locale.	ENGLISH	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	ENGLISH	 not supported<br>"	;}else{s+="	ENGLISH	 supported<br>";}
result = mTts.setLanguage(	Locale.	FRANCE	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	FRANCE	 not supported<br>"	;}else{s+="	FRANCE	 supported<br>";}
result = mTts.setLanguage(	Locale.	FRENCH	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	FRENCH	 not supported<br>"	;}else{s+="	FRENCH	 supported<br>";}
result = mTts.setLanguage(	Locale.	GERMAN	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	GERMAN	 not supported<br>"	;}else{s+="	GERMAN	 supported<br>";}
result = mTts.setLanguage(	Locale.	GERMANY	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	GERMANY	 not supported<br>"	;}else{s+="	GERMANY	 supported<br>";}
result = mTts.setLanguage(	Locale.	ITALIAN	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	ITALIAN	 not supported<br>"	;}else{s+="	ITALIAN	 supported<br>";}
result = mTts.setLanguage(	Locale.	ITALY	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	ITALY	 not supported<br>"	;}else{s+="	ITALY	 supported<br>";}
result = mTts.setLanguage(	Locale.	JAPAN	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	JAPAN	 not supported<br>"	;}else{s+="	JAPAN	 supported<br>";}
result = mTts.setLanguage(	Locale.	JAPANESE	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	JAPANESE	 not supported<br>"	;}else{s+="	JAPANESE	 supported<br>";}
result = mTts.setLanguage(	Locale.	KOREA	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	KOREA	 not supported<br>"	;}else{s+="	KOREA	 supported<br>";}
result = mTts.setLanguage(	Locale.	KOREAN	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	KOREAN	 not supported<br>"	;}else{s+="	KOREAN	 supported<br>";}
result = mTts.setLanguage(	Locale.	PRC	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	PRC	 not supported<br>"	;}else{s+="	PRC	 supported<br>";}
result = mTts.setLanguage(	Locale.	ROOT	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	ROOT	 not supported<br>"	;}else{s+="	ROOT	 supported<br>";}
result = mTts.setLanguage(	Locale.	SIMPLIFIED_CHINESE	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	SIMPLIFIED_CHINESE	 not supported<br>"	;}else{s+="	SIMPLIFIED_CHINESE	 supported<br>";}
result = mTts.setLanguage(	Locale.	TAIWAN	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	TAIWAN	 not supported<br>"	;}else{s+="	TAIWAN	 supported<br>";}
result = mTts.setLanguage(	Locale.	TRADITIONAL_CHINESE	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	TRADITIONAL_CHINESE	 not supported<br>"	;}else{s+="	TRADITIONAL_CHINESE	 supported<br>";}
result = mTts.setLanguage(	Locale.	UK	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	UK	 not supported<br>"	;}else{s+="	UK	 supported<br>";}
result = mTts.setLanguage(	Locale.	US	);	if (result == TextToSpeech.LANG_MISSING_DATA ||result == TextToSpeech.LANG_NOT_SUPPORTED) {s +=	 "	US	 not supported<br>"	;}else{s+="	US	 supported<br>";}



Editace Jana Žákovská : 2011-09-20 19:28:40
Počet článků v kategorii: 397
Url:no-title-bar-android-application-without-titlebar-style-theme-notitlebar-android-example
Share
Share
Tweet