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.

How to make a quick start the android emulator



Very very quick start of Android Emulator from Eclipse.

  1. Go to Eclipse s menu Window -> Android SDK and AVD Manager

  2. Select Virtual devices

  3. Select check box Snapshot: Enabled

  4. Press Edit AVD button.



If will closed Android Emulator all data will saved on disk.
If will reopen Android Emulator, configuration and data will read from disk.


[caption id="attachment_768" align="alignleft" width="300" caption="android-emulator-enable-quick-start"][/caption]

397LW NO topic_id



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


63

Date time difference determine which is earlier Android Java example | date-time-difference-between-two-dates


Date difference in millisecond between two date, GregorianCalendar, Calendar, after(), befor(), getTimeInMillis().



public class HoriziontalScrollActivity extends Activity {
TextView txtV;
	Context cntx;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        txtV = (TextView)findViewById(R.id.idLabel);
        cntx = this;
        StringBuilder strBuild = new StringBuilder();
        Calendar firstDate = new GregorianCalendar(2011, Calendar.DECEMBER, 31);
        Calendar secondDate = new GregorianCalendar(2012, Calendar.JANUARY, 1);

        
        Boolean bDetermine = firstDate.after(secondDate);            // false
        strBuild.append("Is firsDate after secondDate? " + bDetermine + "

"); bDetermine = firstDate.before(secondDate); // true strBuild.append("Is firsDate before secondDate? " + bDetermine + "
"); long differenceInMillisecond = 0L; differenceInMillisecond = secondDate.getTimeInMillis()-firstDate.getTimeInMillis(); // second == 1000 millisecond long second = differenceInMillisecond / 1000L; strBuild.append("Difference between two dates is: " + second + "
"); txtV.setText(strBuild); } }
256

Spinner Text Size Android Example | spinner-text-size-android-example



      Spinner  _spin1 = (Spinner) findViewById(R.id.spinLangFirst);
      ArrayAdapter<String> adapterJazyky = new ArrayAdapter<String>(this,
              R.layout.spinner_text_layout.xml, {"one","two","etc...."});
      adapterJazyky.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      _spin1.setAdapter(adapterJazyky);





spinner_text_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="//schemas.android.com/apk/res/android"
          android:id="@+id/spinnerText"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
         
         android:textSize="20sp"
/>
162

Horizontal marquee text in Button android example | horizontal-marquee-text-in-button-android-example


If a button have focus, marquee will run.
Important:
android:singleLine="true"
android:ellipsize="marquee"
Optional:
android:marqueeRepeatLimit="1"



// main.xml
    <Button
        android:layout_width="150dip" 
        android:layout_height="wrap_content"
        android:text="My button with a long text for marquee as a example source code"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:marqueeRepeatLimit="1"/>


156

Convert Drawable to Bitmap to Drawable | converts-drawable-to-bitmap



Context context = getApplicationContext();
Drawable drawable = context.getResources().getDrawable(R.drawable.my_image);
// convert drawable to bitmap
Bitmap bitmap = ((BitmapDrawable)drawable).getBitmap();
// convert bitmap to drawable
Drawable d = new BitmapDrawable(bitmap);

Android example source code.
309

Updating Android SDK failed: "A folder failed to be moved.” | updating-android-sdk-%e2%80%9ca-folder-failed-to-be-moved-%e2%80%9d


Try:
- close Eclipse and continue updating
or
- change permission of folder
or
- disable antivirus
or
- copy manually from zip packages from temp
c:\Program Files\android\sdk\temp\
c:\Program Files\android\sdk\temp\platform-tools_r19.0.1-windows.zip
c:\Program Files\android\sdk\temp\tools_r22.6.2-windows.zip
into propriety folders
or
- download all SDK package and replace old
https://developer.android.com/sdk/index.html?hl=sk


Editace Jana Žákovská : 2011-09-23 08:57:10
Počet článků v kategorii: 397
Url:how-to-make-a-quick-start-the-android-emulator
Share
Share
Tweet