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.

WAV Sound Quality is Poor Android MediaPlayer



Try convert WAV file to MP3 format for example by Audacity sound editor and replay:
//audacity.sourceforge.net/help/faq_i18n?s=install&i=lame-mp3


MediaPlayer mp  = MediaPlayer.create(getApplicationContext(), R.raw.mymp3file);
mp.setLooping(true);
mp.start();


397LW NO topic_id



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


62

Date Calendar Java Android Example | date-calendar-java-android-example


Calendar cal = new GregorianCalendar(), int year = cal.get(Calendar.YEAR),
ERA, MONTH, DAY_OF_MONTH, DAY_OF_WEEK, Android example code.

public class MainActivity 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;
        Calendar cal = new GregorianCalendar();

     int era = cal.get(Calendar.ERA);  // 0 B.C. before Christ, 1 Anno Domini              
     txtV.setText(txtV.getText() +"

" + era); int year = cal.get(Calendar.YEAR); // 2011 txtV.setText(txtV.getText() +"
" + year); int month = cal.get(Calendar.MONTH); // 0 is Januar txtV.setText(txtV.getText() +"
" + month); int day = cal.get(Calendar.DAY_OF_MONTH); // 1 to 31 txtV.setText(txtV.getText() +"
" + day); int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 1=Sunday, 2=Monday ... txtV.setText(txtV.getText() +"
" + dayOfWeek); } }
5

Random number Java | random-number-java


Generate random number Android Java example source code.

		Random rand = new Random();
		int i = rand.nextInt() % 256; // range -255  +255
		System.out.print(i + "

"); // -184 i = Math.abs(rand.nextInt() % 12); // range 0 +11 System.out.print(i); // 7



// Math.random() start with 0.  e.g. 0.35981234 
int nRan = (int) (Math.random()*10); // 0 - 10

// nextDouble(), nextFloat(), nextInt(), nextLong() returns 0 - 10
import java.util.Random;´

Random r = new Random();
int nRan = r.nextInt(); // 0 - 10
double dRan = r.nextDouble() * 10; // e.g. 7.496285271597397

nextDouble – return 0 - 1
nextFloat – same as double
nextInt –  -2147483648  +2147483647
nextLong –  -922337203685775808  +9223372036854775807
nextGaussian –  0.0 aberation 1.0.
330

Screen size density independent pixel resolution | screen-size-density-independent-pixel-resolution


Terms Screen size, density, density independent pixel, resolution as a picture - pictogram.
mobile-phone-screen-resolution-terms

Test your knowledge
Q: How to find out the phone screen size?
A: (By length of display diagonale in inch -  Not to measure a diagonal of device!!!)

Q: What resolution has 720 x 1280 display?
A: (921600 pixels)

Q: What does it mean "240 dpi" screen density?
A: (Display have density 240 x 240  dots - "Tri-color LED etc." - per every physical (real) square inch. If you have icon 240x240 pixels, this will just occupy an area of one square inch on the display.)

Q: Phone have screen density 240 dpi. Image for 160 dpi screen density have size 128x 128 pixels. What will be the size of the image for 240 dpi screen density?
A: (Calculate the virtual pixels size.   128 * (240/160)  =  192.  You have to resize image to new size 192 x 192 physical pixels and put into folder drawable-hdpi (high) ~240dpi  for phone with screen density 240 dpi. ) or use density independend pixels 128dp x 128dp.

 

 
139

drawBitmap createBitmap by array of colours Android example | drawbitmap-createbitmap-draw-bitmap-by-array-of-colours-android-example


public static Bitmap createBitmap (int[] colors, int offset, int stride, int width, int height, Bitmap.Config config)
public void drawBitmap (Bitmap bitmap, float left, float top, Paint paint)

//  //www.apache.org/licenses/LICENSE-2.0
public class MainActivity extends Activity {
	    private static final int WIDTH = 50;
	    private static final int HEIGHT = 50;
	    private static final int STRIDE = 64;   // must be >= WIDTH
	    
	    private static int[] createColors() {
	        int[] colors = new int[STRIDE * HEIGHT];
	        for (int y = 0; y < HEIGHT; y++) {
	            for (int x = 0; x < WIDTH; x++) {
	                int r = x * 255 / (WIDTH - 1);
	                int g = y * 255 / (HEIGHT - 1);
	                int b = 255 - Math.min(r, g);
	                int a = Math.max(r, g);
	                colors[y * STRIDE + x] = (a << 24) | (r << 16) | (g << 8) | b;
	            }
	        }
	        return colors;
	    }
	
	@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.GREEN);

            int[] mColors = createColors();
            int[] colors = mColors;

           
            Bitmap bitmap = Bitmap.createBitmap(colors, 0, STRIDE, WIDTH, HEIGHT,
                    Bitmap.Config.RGB_565);
                      
			canvas.drawBitmap(bitmap, 50,20, paint); 
		}

	}
}


201

HTC One S | htc-one-s-nejlepsi-smartphone


Nejlepší Smartphone jaro 2012.
Best of Smartphone spring 2012.




























Brand HTC
Model (codename) One S
Price - (Cena, včetně DPH) 13000
Display size in Inch (v palcích) 4.3
Display-resolution (rozlišení) 960x540
Dotek-typ multi-touch capacitive
CPU typ MSM8260A
CPU MHz 1500
CPU core 2
L2 cache
ROM 16 GB
RAM 1 GB
GPU Adreno 225
NenaMark2 Benchmark
GPU-GLBenchmark
Battery mAh 1650 mAh, 10.5 hours of talk time and 13.2 days of stand-by time
Foto MPx 8
Autofocus AF
Video HD záznam videa, 1920×1080 (1080p HD) @ 30 frame/s - 3GP, .3G2, MP4, WMV, AVI
Official Android ICS Android 4.0 Ice Cream Sandwich, HTC Sense 4.0 overlay
CyanogenMod support
Dotek-prstů-max
Display-ppi
Display-retina
Network HSPA/WCDMA: • Europe/Asia: 850/900/2100 MHz GSM/GPRS/EDGE: • 850/900/1800/1900 MHz
Connectivity 3.5 mm stereo audio jack Bluetooth with aptX™ enabled (Bluetooth® 4.0) Wi-Fi®: IEEE 802.11b/g/n DLNA® for wirelessly streaming media from the phone to a compatible TV or computer micro-USB 2.0 (5-pin) port with mobile high-definition video link (MHL) for USB or HDMI connection (Special cable required for HDMI connection.)
Pozn.


Pdf file


htc one s smartphone

Video - záznam a kvalita videa HTC One S


Editace Jana Žákovská : 2013-12-09 10:07:04
Počet článků v kategorii: 397
Url:wav-sound-quality-is-poor-android-mediaplayer
Share
Share
Tweet