[android-developers] MediaPlayer and IllegalStateException

2011-06-30 Thread John-Z80
I've try to copy a very small and easy sample of using MediaPlayer (for example in http://developer.android.com/guide/topics/media/index.html) but I dont know the reason I get an IllegalStateException. Code can be sumarized as: MediaPlayer mp = MediaPlayer.create(myclass_name_here.this, R.raw.clip

[android-developers] Re: LocationListener and getLastKnownLocation

2010-11-15 Thread John-Z80
Yes the onCreate is called always when the application starts (I've even tried to uninstall application and install again), but the getLastKnownLocation does not return the previous positions taken by my application (positions captured by the activity listener), one workaround could be to store las

[android-developers] Re: Read Barcode

2010-11-15 Thread John-Z80
The best way is to install the BarcodeScanner application from google (it's free on the market), then you can call it with an Intent, and get the results back in a String. Something like: Call the QRCOde: Intent intent = new Intent("com.google.zxing.client.android.SCAN"); i

[android-developers] Re: setScaleType for an ImageButton

2010-11-12 Thread John-Z80
Sorry the first line should be "scale" not "sacle" :-) -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers

[android-developers] Re: setScaleType for an ImageButton

2010-11-12 Thread John-Z80
Perhaps you want to "sacle" the image to fit the button, something like: The image is in Bitmap bm int width = bm.getWidth(); int height = bm.getHeight(); int newWidth = 32; int newHeight = 32; float scaleWidth = ((float) newWidth) / width

[android-developers] LocationListener and getLastKnownLocation

2010-11-12 Thread John-Z80
In one application, when an activity start I use the getLastKnownLocation to get the last know position, using something like: Location position=mlocManager.getLastKnownLocation(mlocManager.getBestProvider(new Criteria(), true)); (in the onCreate) After this, my application register a listener in

[android-developers] Re: Read from sdcard problem (version 1.6)

2010-08-13 Thread John-Z80
One interesting detail, the code (and some variants tryint to use Bitmap and BitmapFactory...) did not work in a 1.6 android Tattoo mobile, BUT I've just tried in a magic (1.6 version too) and another Android mobile (2.1 version) and the above code WORKED. Tried in another Tattoo from another frine

[android-developers] Read from sdcard problem (version 1.6)

2010-08-13 Thread John-Z80
Hello I'm trying to make a photo calling the CAMERA Intent an after returning to my application read the file, but altough I get a File like /sdcard/DCIM/camera/.jpg if I try to open the file, it exist and can be read (check with File.exist or File.canread BUT the length of the file is always 0

[android-developers] Textview with graphic (dynamically changing) inside.

2010-02-04 Thread John-Z80
Hello, I've a TextView that in the onCreate is build with an image to the left from the static drawables, and with a text in the right. I want to dynamically change the text and the image, (and maintain the same image size), I have the image stored in a Bitmap named bm, (yes I know I could change