¡@

Home 

2014/10/16 ¤W¤È 08:19:08

android Programming Glossary: media

How to set ringtone in Android from my activity?

http://stackoverflow.com/questions/1271777/how-to-set-ringtone-in-android-from-my-activity

File k new File path mysong.mp3 path is a file to sdcard media ringtone ContentValues values new ContentValues values.put MediaStore.MediaColumns.DATA.. But this uri can not be directly to the sdcard like sdcard media ringtones mysong.mp3 . That does not work What you need is the.. of the file which could be something like external audio media 46 The 46 is the id of the column in the MediaStore database..

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

important things from an MMS such as the file path to the media attachment image audio video or the text in the MMS MMSReceiver.java..

Setting Ringtone in Android [duplicate]

http://stackoverflow.com/questions/1986756/setting-ringtone-in-android

resolver for insertion. File newSoundFile new File sdcard media ringtone myringtone.oog Uri mUri Uri.parse android.resource..

Get/pick an image from Android's built-in Gallery app programmatically

http://stackoverflow.com/questions/2169649/get-pick-an-image-from-androids-built-in-gallery-app-programmatically

feedback return null try to retrieve the image from the media store first this will only work for images selected from gallery..

Image, saved to sdcard, doesn't appear in Android's Gallery app

http://stackoverflow.com/questions/2170214/image-saved-to-sdcard-doesnt-appear-in-androids-gallery-app

How to programatically take a screenshot on Android?

http://stackoverflow.com/questions/2661536/how-to-programatically-take-a-screenshot-on-android

did something similar to use for sharing with social media. Here is the code that allowed my screen shot to be stored on..

Get filename and path from uri from mediastore

http://stackoverflow.com/questions/3401579/get-filename-and-path-from-uri-from-mediastore

filename and path from uri from mediastore I have an onActivityResult returning from an mediastore.. mediastore I have an onActivityResult returning from an mediastore image selection which I can get a URI for an image using.. Converting this to a string gives this content media external images media 47 Or to a path gives external images..

Detecting touch screen devices with Javascript

http://stackoverflow.com/questions/3974827/detecting-touch-screen-devices-with-javascript

hover and click both. One other way could be using CSS media queries and using some styles only for smaller screens mobile..

Find an external SD card location

http://stackoverflow.com/questions/5694933/find-an-external-sd-card-location

to be external storage . On some devices this is removable media like an SD card. On some devices this is a portion of on device..

Images taken with ACTION_IMAGE_CAPTURE always returns 1 for ExifInterface.TAG_ORIENTATION on some newer devices

http://stackoverflow.com/questions/8450539/images-taken-with-action-image-capture-always-returns-1-for-exifinterface-tag-or

in the default folder and of course put a entry in the media store and we can use the rotation information from this row... rotation 1 long fileSize new File filePath .length Cursor mediaCursor content.query MediaStore.Images.Media.EXTERNAL_CONTENT_URI.. 1000 1 MediaStore.MediaColumns.DATE_ADDED desc if mediaCursor null captureTime 0 mediaCursor.getCount 0 while mediaCursor.moveToNext..

Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions

http://stackoverflow.com/questions/8671479/android-mediaplayer-works-fine-in-custom-audio-streaming-application-up-to-andro

piece of code private MediaPlayer createMediaPlayer File mediaFile throws IOException MediaPlayer mPlayer new MediaPlayer example.. IOException MediaPlayer mPlayer new MediaPlayer example of mediaFile data data package cache playingMedia0.dat FileInputStream.. playingMedia0.dat FileInputStream fis new FileInputStream mediaFile mPlayer.setDataSource fis.getFD mPlayer.prepare return mPlayer..

Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the other one

http://stackoverflow.com/questions/8681550/android-2-2-mediaplayer-is-working-fine-with-one-shoutcast-url-but-not-with-the

import android.app.Activity import android.media.AudioManager import android.media.MediaPlayer import android.net.Uri.. import android.media.AudioManager import android.media.MediaPlayer import android.net.Uri import android.os.Bundle.. but not works with Android 2.2 or higher . Thanks android media player uri audio streaming shoutcast share improve this question..

Nexus 7 not visible over usb via “adb devices” from Windows 7 x64

http://stackoverflow.com/questions/11974700/nexus-7-not-visible-over-usb-via-adb-devices-from-windows-7-x64

is a persistent notification that indicates CONNECT AS Media Device MTP . In this state adb devices will not show the Nexus..

Nexus 4 not showing files via MTP

http://stackoverflow.com/questions/13737261/nexus-4-not-showing-files-via-mtp

until a reboot of the phone. A workaround is Clear the Media Storage app's data Use the SDrescan app to force an update Or..

Using the Android RecognizerIntent with a bluetooth headset

http://stackoverflow.com/questions/14991158/using-the-android-recognizerintent-with-a-bluetooth-headset

audio profile. I can use an app called SoundAbout to force Media Audio to Bluetooth mono SCO . With this app set my voice recognition..

MediaPlayer error (1, -1004) aka MEDIA_ERROR_IO trying to stream music on Samsung S3

http://stackoverflow.com/questions/16672568/mediaplayer-error-1-1004-aka-media-error-io-trying-to-stream-music-on-samsun

error 1 1004 aka MEDIA_ERROR_IO trying to stream music.. streaming on the S3 I've been able to figure out that the Media Player object goes into the Error state due to MEDIA_ERROR_UNKOWN.. this in onError with an OnErrorListener I reset the Media Player object and then call startPlaying which does the rest..

How to use media Queries for android devices with android version 2.2.1 and 2.3.5 and their screen size of 240 * 320 and screen size of 480 * 800?

http://stackoverflow.com/questions/17102161/how-to-use-media-queries-for-android-devices-with-android-version-2-2-1-and-2-3

screen size of 240 320 and screen size of 480 800 using Media Query I referred from here and I tried implementing it But I.. 10px 10px 5px #888888 padding 10px min height 250px My Media Query CSS @media only screen and max device width 240px .container..

How can I capture a video recording on Android?

http://stackoverflow.com/questions/1817742/how-can-i-capture-a-video-recording-on-android

Here is a simple video recording example using the MediaRecorder public class VideoCapture extends Activity implements.. Activity implements OnClickListener SurfaceHolder.Callback MediaRecorder recorder SurfaceHolder holder boolean recording false.. ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE recorder new MediaRecorder initRecorder setContentView R.layout.main SurfaceView..

Volume Control in android application

http://stackoverflow.com/questions/2539264/volume-control-in-android-application

it uses for your application. As for controlling the Media volume no matter what app is visible I'm not sure that can be..

Video streaming using RTSP : Android

http://stackoverflow.com/questions/3186950/video-streaming-using-rtsp-android

Darwin Streaming Server linux package is available Windows Media Services can be installed on Windows Server Trial VLC standalone..

WebView and HTML5 <video>

http://stackoverflow.com/questions/3815090/webview-and-html5-video

to get back to the web view. public void onCompletion MediaPlayer mp Log.d TAG Video completo a.setContentView R.layout.main.. to play inside the WebView frame instead of opening the Media Player window but this is for me a secondary issue. I hope it..

Images taken with ACTION_IMAGE_CAPTURE always returns 1 for ExifInterface.TAG_ORIENTATION on some newer devices

http://stackoverflow.com/questions/8450539/images-taken-with-action-image-capture-always-returns-1-for-exifinterface-tag-or

app from my app. THen on activity result I query the Media Provider to see if any pictures were saved after this timestamp.. new File filePath .length Cursor mediaCursor content.query MediaStore.Images.Media.EXTERNAL_CONTENT_URI new String MediaStore.Images.ImageColumns.ORIENTATION.. .length Cursor mediaCursor content.query MediaStore.Images.Media.EXTERNAL_CONTENT_URI new String MediaStore.Images.ImageColumns.ORIENTATION..

Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions

http://stackoverflow.com/questions/8671479/android-mediaplayer-works-fine-in-custom-audio-streaming-application-up-to-andro

MediaPlayer works fine in Custom audio Streaming application up to.. Android 2.1 but not in higher versions EDIT Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the.. in phone local temporary storage. i am using the StreamingMediaPlayer class . Check this piece of code private MediaPlayer createMediaPlayer..

Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the other one

http://stackoverflow.com/questions/8681550/android-2-2-mediaplayer-is-working-fine-with-one-shoutcast-url-but-not-with-the

2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the.. import android.media.AudioManager import android.media.MediaPlayer import android.net.Uri import android.os.Bundle import.. public class SimpleMusicStream extends Activity implements MediaPlayer.OnCompletionListener MediaPlayer.OnPreparedListener MediaPlayer.OnErrorListener..

Media Player called in state 0, error (-38,0)

http://stackoverflow.com/questions/9008770/media-player-called-in-state-0-error-38-0

Player called in state 0 error 38 0 I am currently trying to.. I have the URL for the station and am setting up the Media Player like MediaPlayer mediaPlayer new MediaPlayer try mediaPlayer.setDataSource.. for the station and am setting up the Media Player like MediaPlayer mediaPlayer new MediaPlayer try mediaPlayer.setDataSource..

How to set ringtone in Android from my activity?

http://stackoverflow.com/questions/1271777/how-to-set-ringtone-in-android-from-my-activity

below only what was needed to set it as default ringtone. File k new File path mysong.mp3 path is a file to sdcard media ringtone ContentValues values new ContentValues values.put MediaStore.MediaColumns.DATA k.getAbsolutePath values.put MediaStore.MediaColumns.TITLE.. needs a uri to the file that is to be set as new ringtone. But this uri can not be directly to the sdcard like sdcard media ringtones mysong.mp3 . That does not work What you need is the external file uri of the file which could be something like.. . That does not work What you need is the external file uri of the file which could be something like external audio media 46 The 46 is the id of the column in the MediaStore database so thats why you need to add the sdcard file into the database..

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

that the message was sent from. How do you grab other important things from an MMS such as the file path to the media attachment image audio video or the text in the MMS MMSReceiver.java public class MMSReceiver extends BroadcastReceiver..

Setting Ringtone in Android [duplicate]

http://stackoverflow.com/questions/1986756/setting-ringtone-in-android

write it to the sdcard 1st before you give it to the content resolver for insertion. File newSoundFile new File sdcard media ringtone myringtone.oog Uri mUri Uri.parse android.resource com.your.package R.raw.your_resource_id ContentResolver mCr..

Get/pick an image from Android's built-in Gallery app programmatically

http://stackoverflow.com/questions/2169649/get-pick-an-image-from-androids-built-in-gallery-app-programmatically

in if uri null TODO perform some logging or show user feedback return null try to retrieve the image from the media store first this will only work for images selected from gallery String projection MediaStore.Images.Media.DATA Cursor..

Image, saved to sdcard, doesn't appear in Android's Gallery app

http://stackoverflow.com/questions/2170214/image-saved-to-sdcard-doesnt-appear-in-androids-gallery-app

How to programatically take a screenshot on Android?

http://stackoverflow.com/questions/2661536/how-to-programatically-take-a-screenshot-on-android

android screenshot share improve this question I just recently did something similar to use for sharing with social media. Here is the code that allowed my screen shot to be stored on sd card and used later for whatever your needs are image naming..

Get filename and path from uri from mediastore

http://stackoverflow.com/questions/3401579/get-filename-and-path-from-uri-from-mediastore

filename and path from uri from mediastore I have an onActivityResult returning from an mediastore image selection which I can get a URI for an image using the.. filename and path from uri from mediastore I have an onActivityResult returning from an mediastore image selection which I can get a URI for an image using the following Uri selectedImage data.getData Converting this.. a URI for an image using the following Uri selectedImage data.getData Converting this to a string gives this content media external images media 47 Or to a path gives external images media 47 However I can't seem to find a way to convert this..

Detecting touch screen devices with Javascript

http://stackoverflow.com/questions/3974827/detecting-touch-screen-devices-with-javascript

iphone android share improve this question 1 for doing hover and click both. One other way could be using CSS media queries and using some styles only for smaller screens mobile devices which are the ones most likely to have touch tap functionality...

Find an external SD card location

http://stackoverflow.com/questions/5694933/find-an-external-sd-card-location

refers to whatever the device manufacturer considered to be external storage . On some devices this is removable media like an SD card. On some devices this is a portion of on device flash. Here external storage means the stuff accessible..

Images taken with ACTION_IMAGE_CAPTURE always returns 1 for ExifInterface.TAG_ORIENTATION on some newer devices

http://stackoverflow.com/questions/8450539/images-taken-with-action-image-capture-always-returns-1-for-exifinterface-tag-or

means that most likely OS saved the properly rotated picture in the default folder and of course put a entry in the media store and we can use the rotation information from this row. Now to make sure we are looking at the right image i compare.. to the one I have access to saved in my own app folder int rotation 1 long fileSize new File filePath .length Cursor mediaCursor content.query MediaStore.Images.Media.EXTERNAL_CONTENT_URI new String MediaStore.Images.ImageColumns.ORIENTATION MediaStore.MediaColumns.SIZE.. new String String.valueOf captureTime 1000 1 MediaStore.MediaColumns.DATE_ADDED desc if mediaCursor null captureTime 0 mediaCursor.getCount 0 while mediaCursor.moveToNext long size mediaCursor.getLong 1 Extra check..

Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions

http://stackoverflow.com/questions/8671479/android-mediaplayer-works-fine-in-custom-audio-streaming-application-up-to-andro

i am using the StreamingMediaPlayer class . Check this piece of code private MediaPlayer createMediaPlayer File mediaFile throws IOException MediaPlayer mPlayer new MediaPlayer example of mediaFile data data package cache playingMedia0.dat.. private MediaPlayer createMediaPlayer File mediaFile throws IOException MediaPlayer mPlayer new MediaPlayer example of mediaFile data data package cache playingMedia0.dat FileInputStream fis new FileInputStream mediaFile mPlayer.setDataSource fis.getFD.. new MediaPlayer example of mediaFile data data package cache playingMedia0.dat FileInputStream fis new FileInputStream mediaFile mPlayer.setDataSource fis.getFD mPlayer.prepare return mPlayer Current status 1 It works fine from Android 1.6 to 2.1..

Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the other one

http://stackoverflow.com/questions/8681550/android-2-2-mediaplayer-is-working-fine-with-one-shoutcast-url-but-not-with-the

with this one Uri myUri Uri.parse http someOtherURL SimpleMusicStream.java import android.app.Activity import android.media.AudioManager import android.media.MediaPlayer import android.net.Uri import android.os.Bundle import android.util.Log import.. http someOtherURL SimpleMusicStream.java import android.app.Activity import android.media.AudioManager import android.media.MediaPlayer import android.net.Uri import android.os.Bundle import android.util.Log import android.view.View import android.widget.Button.. that our current code works with Android 2.1 minor versions but not works with Android 2.2 or higher . Thanks android media player uri audio streaming shoutcast share improve this question Shoutcast mp3 streaming from Android 2.2 onwards is..

Nexus 7 not visible over usb via “adb devices” from Windows 7 x64

http://stackoverflow.com/questions/11974700/nexus-7-not-visible-over-usb-via-adb-devices-from-windows-7-x64

improve this question When the Nexus 7 is plugged in there is a persistent notification that indicates CONNECT AS Media Device MTP . In this state adb devices will not show the Nexus or undoubtedly any other device. Not exactly obvious but..

Nexus 4 not showing files via MTP

http://stackoverflow.com/questions/13737261/nexus-4-not-showing-files-via-mtp

USB file access over MTP . The MTP cache gets out of date until a reboot of the phone. A workaround is Clear the Media Storage app's data Use the SDrescan app to force an update Or just avoid using USB at all. The issue does not affect other..

Using the Android RecognizerIntent with a bluetooth headset

http://stackoverflow.com/questions/14991158/using-the-android-recognizerintent-with-a-bluetooth-headset

headset that is paired and connected using the Phone audio profile. I can use an app called SoundAbout to force Media Audio to Bluetooth mono SCO . With this app set my voice recognition now works taking my speech input from my headset. How..

MediaPlayer error (1, -1004) aka MEDIA_ERROR_IO trying to stream music on Samsung S3

http://stackoverflow.com/questions/16672568/mediaplayer-error-1-1004-aka-media-error-io-trying-to-stream-music-on-samsun

error 1 1004 aka MEDIA_ERROR_IO trying to stream music on Samsung S3 Our application has to stream music from from.. that source . Why does it take over 2 minutes to start streaming on the S3 I've been able to figure out that the Media Player object goes into the Error state due to MEDIA_ERROR_UNKOWN great. Doesn't help me much. So upon handling this in.. MEDIA_ERROR_UNKOWN great. Doesn't help me much. So upon handling this in onError with an OnErrorListener I reset the Media Player object and then call startPlaying which does the rest setting the data source etc. Members private ProgressBar playSeekBar..

How to use media Queries for android devices with android version 2.2.1 and 2.3.5 and their screen size of 240 * 320 and screen size of 480 * 800?

http://stackoverflow.com/questions/17102161/how-to-use-media-queries-for-android-devices-with-android-version-2-2-1-and-2-3

320 480.It was perfect. I thought of testing the same in the screen size of 240 320 and screen size of 480 800 using Media Query I referred from here and I tried implementing it But I was not successful. My normal css .container width 80 height.. color #CCCCCC text align justify border radius 20px box shadow 10px 10px 5px #888888 padding 10px min height 250px My Media Query CSS @media only screen and max device width 240px .container width 180px height 150px margin left 10px margin right..

How can I capture a video recording on Android?

http://stackoverflow.com/questions/1817742/how-can-i-capture-a-video-recording-on-android

android video recording recorder share improve this question Here is a simple video recording example using the MediaRecorder public class VideoCapture extends Activity implements OnClickListener SurfaceHolder.Callback MediaRecorder recorder.. using the MediaRecorder public class VideoCapture extends Activity implements OnClickListener SurfaceHolder.Callback MediaRecorder recorder SurfaceHolder holder boolean recording false @Override public void onCreate Bundle savedInstanceState super.onCreate.. setRequestedOrientation ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE recorder new MediaRecorder initRecorder setContentView R.layout.main SurfaceView cameraView SurfaceView findViewById R.id.CameraView holder..

Volume Control in android application

http://stackoverflow.com/questions/2539264/volume-control-in-android-application

volume when your application is visible and that's the volume it uses for your application. As for controlling the Media volume no matter what app is visible I'm not sure that can be done or if it could whether that would be a good thing. share..

Video streaming using RTSP : Android

http://stackoverflow.com/questions/3186950/video-streaming-using-rtsp-android

For rtsp streaming you can also try following servers Darwin Streaming Server linux package is available Windows Media Services can be installed on Windows Server Trial VLC standalone application For testing purposes of your application i..

WebView and HTML5 <video>

http://stackoverflow.com/questions/3815090/webview-and-html5-video

the onCompletion and the onError events for the video in order to get back to the web view. public void onCompletion MediaPlayer mp Log.d TAG Video completo a.setContentView R.layout.main WebView wb WebView a.findViewById R.id.webview a.initWebView.. some play button it does nothing. I would also like the video to play inside the WebView frame instead of opening the Media Player window but this is for me a secondary issue. I hope it helps somebody and I would also thank any comment or suggestion...

Images taken with ACTION_IMAGE_CAPTURE always returns 1 for ExifInterface.TAG_ORIENTATION on some newer devices

http://stackoverflow.com/questions/8450539/images-taken-with-action-image-capture-always-returns-1-for-exifinterface-tag-or

Now what I do is i record the time when I'm starting the camera app from my app. THen on activity result I query the Media Provider to see if any pictures were saved after this timestamp I saved. That means that most likely OS saved the properly.. to saved in my own app folder int rotation 1 long fileSize new File filePath .length Cursor mediaCursor content.query MediaStore.Images.Media.EXTERNAL_CONTENT_URI new String MediaStore.Images.ImageColumns.ORIENTATION MediaStore.MediaColumns.SIZE.. app folder int rotation 1 long fileSize new File filePath .length Cursor mediaCursor content.query MediaStore.Images.Media.EXTERNAL_CONTENT_URI new String MediaStore.Images.ImageColumns.ORIENTATION MediaStore.MediaColumns.SIZE MediaStore.MediaColumns.DATE_ADDED..

Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions

http://stackoverflow.com/questions/8671479/android-mediaplayer-works-fine-in-custom-audio-streaming-application-up-to-andro

MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions EDIT Android 2.2 MediaPlayer.. works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions EDIT Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the other one I need to play audio files from external URLs shoutcast.. incrementally are played as soon as we get enough audio in phone local temporary storage. i am using the StreamingMediaPlayer class . Check this piece of code private MediaPlayer createMediaPlayer File mediaFile throws IOException MediaPlayer..

Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the other one

http://stackoverflow.com/questions/8681550/android-2-2-mediaplayer-is-working-fine-with-one-shoutcast-url-but-not-with-the

2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the other one Please see the code i am using for streaming shoutcast.. someOtherURL SimpleMusicStream.java import android.app.Activity import android.media.AudioManager import android.media.MediaPlayer import android.net.Uri import android.os.Bundle import android.util.Log import android.view.View import android.widget.Button.. import android.view.View import android.widget.Button public class SimpleMusicStream extends Activity implements MediaPlayer.OnCompletionListener MediaPlayer.OnPreparedListener MediaPlayer.OnErrorListener MediaPlayer.OnBufferingUpdateListener..

Media Player called in state 0, error (-38,0)

http://stackoverflow.com/questions/9008770/media-player-called-in-state-0-error-38-0

Player called in state 0 error 38 0 I am currently trying to design a simple app that streams an internet radio station... to design a simple app that streams an internet radio station. I have the URL for the station and am setting up the Media Player like MediaPlayer mediaPlayer new MediaPlayer try mediaPlayer.setDataSource URL catch IllegalArgumentException e e.printStackTrace.. app that streams an internet radio station. I have the URL for the station and am setting up the Media Player like MediaPlayer mediaPlayer new MediaPlayer try mediaPlayer.setDataSource URL catch IllegalArgumentException e e.printStackTrace catch..