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 install mount SD card for Eclipse Android Emulator


AD MOB

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.




397LW NO topic_id




AD

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


345

Pixel to density independent pixel to pixel conversion | pixel-to-density-independent-pixel-to-pixel-conversion


Physical pixel (px)
Density independent pixel (dp)
Dots per inch (dpi) .. physical pixels per inch
px = dp * (dpi / 160)

public static int dpToPx(int dp)
{
    return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
}

public static int pxToDp(int px)
{
    return (int) (px / Resources.getSystem().getDisplayMetrics().density);
}
223

Disable enable internet connection in Android Emulator | disable-enable-internet-connection-in-android-emulator


If you try function for checking internet connection you can disable internet on the emulator:
Settings - Wireless and networks - Mobile networks - Data enabled (checked - unchecked )


 public boolean isNetworkAvailable() {
        ConnectivityManager cm = (ConnectivityManager) 
          getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo networkInfo = cm.getActiveNetworkInfo();
        if (networkInfo != null && networkInfo.isConnected()) {
            return true;
        }
        return false;
    }     





94

Is NaN isNaN isInfinite number value Java Android example | is-nan-isnan-java-example


float, double is NaN isNaN() isInfinite() Java Android example.

float f = 0.f;
boolean bIsNaN = Float.isNaN(f);
boolean bIsInfinite = Float.isInfinite(f);

 double d = Math.sqrt(-10);
 boolean b = Double.isNaN(d);

131

Draw color line set stroke width Android basic example | draw-line-android-basic-example


Canvas, drawLine(), setStrokeWidth(), Paint, setAntiAlias(boolean), onDraw()

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

			canvas.drawColor(Color.YELLOW);
			Paint p = new Paint();
			// smooths
			p.setAntiAlias(true);
			p.setColor(Color.RED);
			p.setStrokeWidth(4.5f);
			// opacity
			p.setAlpha(0x80); //
			// drawLine (float startX, float startY, float stopX, float stopY,
			// Paint paint)
			canvas.drawLine(0, 0, 40, 40, p);
			canvas.drawLine(40, 0, 0, 40, p);

		}

	}
}
213

Round number float - double to int - long Java example | round-number-float-to-int-java-example



int nf = Math.round(5.789f);
System.out.print(nf); // 6

float f = 28.611f; 
int n3 = Math.round(f);
System.out.println(n3); // 29

double d = 1234.56;
long lon = Math.round(d);
System.out.println(lon); // 1235

int diff = 90 - 40;
// float fDeleni = diff / 10; // error code
float fDeleni = (float)diff / 10.f; // ok
int nRound = Math.round(fDeleni);


// Caution:
int n2 = (int) 8.999f;
System.out.println(n2); // 8




Editace: 2014-02-15 20:48:42
Počet článků v kategorii: 397
Url:how-install-sd-card-on-android-eclipse-emulator

AD
11 Share
Share
Tweet