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.

Call requires API level xx current min is xx android


AD MOB

Call requires API level 16 (current min is 4): android
Change The SDK version in AndroidManifest.xml to higher


<uses-sdk android:minSdkVersion="4" />
// 
<uses-sdk android:minSdkVersion="8" />

397LW NO topic_id




AD

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


55

How update View TextView with timer Android runnable example | how-update-view-textview-with-timer-android-runnable-example


Update TextView by runnable. Handler, runnable, timer Android example.


public class TimerActivity extends Activity {
TextView hTextView;
Button hButton, hButtonStop;
private Handler mHandler = new Handler();
private int nCounter = 0;
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        hTextView = (TextView)findViewById(R.id.idTextView);
        hButton = (Button)findViewById(R.id.idButton);
        hButton.setOnClickListener(mButtonStartListener);
        hButtonStop = (Button)findViewById(R.id.idButtonStop);
        hButtonStop.setOnClickListener(mButtonStopListener);
    } // end onCreate

View.OnClickListener mButtonStartListener = new OnClickListener() {
	public void onClick(View v) {
		try {
			mHandler.removeCallbacks(hMyTimeTask);
         //        Parameters
         //        r  The Runnable that will be executed. 
         //        delayMillis  The delay (in milliseconds) until the Runnable will be executed. 
                       mHandler.postDelayed(hMyTimeTask, 1000); // delay 1 second
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
};


private Runnable hMyTimeTask = new Runnable() {
	   public void run() {
		   nCounter++;
	    	   hTextView.setText("Hallo from thread counter: " + nCounter);
	   }
	}; 
/**
 * 
 */
    View.OnClickListener mButtonStopListener = new OnClickListener() {
    	public void onClick(View v) {
    		 mHandler.removeCallbacks(hMyTimeTask);
    		
    	}
    };
}





main.xml



<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
	android:id="@+id/idTextView"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
<Button android:text="Button" 
android:id="@+id/idButton" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"></Button>
 
 <Button android:layout_width="wrap_content" 
 android:layout_height="wrap_content" 
 android:id="@+id/idButtonStop" 
 android:text="Stop"></Button> 
    
    
</LinearLayout>




146

Rotate a image bitmap picture Android example | rotate-a-image-bitmap-android-example


Rotate a bitmap Android source code.

public class MainActivity extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new SampleView(this));
	}


	private static class SampleView extends View {

		// CONSTRUCTOR
		public SampleView(Context context) {
			super(context);
			setFocusable(true);

		}
		@Override
		protected void onDraw(Canvas canvas) {
			Paint paint = new Paint();
			
			canvas.drawColor(Color.YELLOW);
            
          // Bitmap b = Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888);
			
		    //  you need to insert a image flower_blue into res/drawable folder 
			Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.flower_blue);
			 Matrix mat = new Matrix();
			                mat.postRotate(90);
			                Bitmap bmpRotate = Bitmap.createBitmap(bmp, 0, 0,
			  bmp.getWidth(), bmp.getHeight(),
			  mat, true);
		   int h = bmp.getHeight();
           
           canvas.drawBitmap(bmp, 10,10, paint);
           canvas.drawBitmap(bmpRotate, 10,10 + h + 10, paint);
           
		}

	}
}




rotate bitmap android
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" />
200

Samsung i9250 Galaxy Nexus | samsung-i9250-galaxy-nexus






























Brand Samsung
Model (codename) i9250 Galaxy Nexus
Cena, včetně DPH 9000
Veikost Displaye v palcích 4.65
Display-resolution 1280x720
Dotek-typ kapacitní
CPU typ
CPU MHz 1200
CPU core 2
L2 cache
RAM 1 GB
ROM 16 - 32 GB
GPU TI OMAP 4460 1,2 GHz dual-core
NenaMark2 Benchmark
GPU-GLBenchmark
Baterie mAh 1750
Foto MPx 5
Autofocus yes
Video 480p - 30 frames/s
Official Android ICS Android 4.0 Ice Cream Sandwich
CyanogenMod support
Dotek-prstů-max
Display-ppi
Display-retina
Network GSM&EDGE: 850 / 900 / 1.800 / 1.900
Connectivity
Pozn.


samsung-i9250-galaxy-nexus image
samsung-i9250-galaxy-nexus
249

How to Scroll large image in ImageView Android Example | how-to-scroll-large-image-in-imageview-android-example


main.xml

    <LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
		android:orientation="vertical"
			android:gravity="top"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <ScrollView
            android:id="@+id/scrollView1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <HorizontalScrollView
                android:id="@+id/horizontalScrollView1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" >

 
            <LinearLayout
			    android:gravity="top"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" >

                <ImageView
                    android:id="@+id/imageViewObrazekGeometrie"
                    android:layout_width="360dp"
                    android:layout_height="777dp"
                    android:src="@drawable/geometrie_vzorecky" />

            </LinearLayout>
            </HorizontalScrollView>
        </ScrollView>

    </LinearLayout>



Editace: 2013-09-17 20:32:51
Počet článků v kategorii: 397
Url:call-requires-api-level-xx-current-min-is-xx-android

AD
11 Share
Share
Tweet