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.

Resize ImageView Image in View Android Example

How to resize an image in ImageView Android source code.
Resize imageview layout and image will resize too:

	public void resizeImageView(int width, int height) {
		final ImageView picture1 = (ImageView)findViewById(R.id.imageView1);
		LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(width, height);
		picture1.setLayoutParams(layoutParams);
	}


396LW NO topic_id




AD

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


237

AdMob in Android 4 version | admob-in-android-4-version


AdMob in Android emulator not visible?
You have to using some from this libraries:
GoogleAdMobAdsSdk-4.3.1.jar
GoogleAdMobAdsSdk-6.0.1.jar
GoogleAdMobAdsSdk-6.2.1.jar

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="//schemas.android.com/apk/res/android"
    package="cz.okhelp.admob"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="13"
        android:targetSdkVersion="16"/>

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    
   

    <application android:icon="@drawable/ic_launcher" android:label="@string/app_name">
       <meta-data 
        android:value="a14d932xxxxxxxx" 
        android:name="ADMOB_PUBLISHER_ID" />
        <activity android:name=".AdmobActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

<activity android:name="com.google.ads.AdActivity"
 android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
</manifest>


onCreate in your Activity.java

		@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
     			AdViw adView = new AdView(this, AdSize.BANNER, "a14d932xxxxxxxxx");//MY_AD_UNIT_ID
    			LinearLayout layout = (LinearLayout)findViewById(R.id.idReklamaLayout);
				// Add the adView to it
    			layout.addView(adView);
				// Initiate a generic request to load it with an ad
				AdRequest adRequest = new AdRequest();
    			//adRequest.setTesting(true);
    			adRequest.setGender(AdRequest.Gender.MALE);
    			adView.loadAd(adRequest);
    }



main.xml (res/layout)

<?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:orientation="vertical" >
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />
<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
android:id="@+id/idReklamaLayout"
android:orientation="vertical"
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="3" />

</LinearLayout>
72

While cycle loop in Java example | while-cycle-loop-in-java-example


While cycle Java basic example with array of strings.

MainClass.java

public class MainClass {
	public static void main(String[] arg) {
		String[] arrayOfString = { "Hello", "people", "hello", "world!" };
                int i = 0;
		while ( i < arrayOfString.length ){
			System.out.println(arrayOfString[i]);
			i++;
		}
	}
}
246

Snow Text Effects Paint.NET | snow-text-effects-paint-net


For some graphics you can use Paint.NET editor.
//www.getpaint.net/
How create Snow Effects on Text by 1 minute show this video: