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);

396LW NO topic_id


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


Draw Oval Android basic example | draw-oval-android-basic-example

drawOval(), setStrokeWidth(), setStyle()

public class MainActivity extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		setContentView(new SampleView(this));

	private static class SampleView extends View {

		public SampleView(Context context) {


		protected void onDraw(Canvas canvas) {

			Paint p = new Paint();
			// smooths
			// opacity
			//p.setAlpha(0x80); //
			canvas.drawOval(new RectF(50, 50, 20, 40), p);;


How quickly restart adb.exe ADB server Android emulator example | how-quickly-restart-adb-exe-adb-server-android-emulator-example

Create file restartADB.bat in folder
c:\Program Files\Android\android-sdk-windows\platform-tools\
Write into restartADB.bat this code:

adb kill-server && adb start-server

Save restartADB.bat file.
If you want restart adb.exe server, run restartADB.bat by double click on icon.

Next example:

  1. Open Total Commander

  2. Open folder with adb.exe usually in
    c:\Program Files\Android\android-sdk-windows\platform-tools\

  3. Put into command line command: adb kill-server && adb start-server and press Enter

[caption id="attachment_778" align="alignleft" width="300" caption="ADB server restart by command line"]android/adb-restart-server-android-emulator-300x188.png[/caption]

Try restart ADB if this or similar errors:
Emulator] emulator: emulator window was out of view and was recentred


Android SDK Samples as a Photo Gallery | android-sdk-samples-as-photo-serial

Photo Gallery of Android SDK Samples.
For better understanding of what the source knows there is a gallery of images.
After clicking on the preview displays the actual size and Titlebar
You can read the path to the source file as: Graphics/AnimateDrawables see the project folder


How to install mount SD card for Eclipse Android Emulator | how-install-sd-card-on-android-eclipse-emulator

If you want download some *.apk file from internet and try on your emulator you get error than you have to install SD card. You have to closing Android emulator.
Mount Android emulator SD card instruction

  1. In Eclipse go in menu Window - Android SDK and Avg Manager

  2. Select Virtual devices

  3. Select AVD Name where you need install SD card

  4. Click on Edit button

  5. In open dialog go to SD card - Size: and write 500

  6. Press button Edit AVD

  7. Run AVD emulator

Image how install SD card on Android emulator in Eclipse.