galaxy

Cannot play RTSP video in VideoView in Samsung Galaxy S2

╄→尐↘猪︶ㄣ 提交于 2020-01-03 12:05:46
问题 I'm trying to play a live RTSP video (from rtsp://media2.tripsmarter.com/LiveTV/BTV/ ) using VideoView , and here's my code: public class ViewTheVideo extends Activity { VideoView vv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); vv = (VideoView) this.findViewById(R.id.VideoView); Uri videoUri = Uri.parse("rtsp://media2.tripsmarter.com/LiveTV/BTV/"); vv.setMediaController(new MediaController(this)); vv

How to determine the target device programmatically in Android?

拈花ヽ惹草 提交于 2020-01-03 04:51:09
问题 I would like to programmatically determine (on the Android platform), if the target device is a phone or a tablet. Is there a way to do this? I tried using Density Metrics to determine the resolution and used resources (images and layouts) accordingly but, it did not turn out well. There are differences when I launch the app on a phone (Droid X) and a tablet (Samsung Galaxy 10.1). Please advise. 回答1: You can use this code private boolean isTabletDevice() { if (android.os.Build.VERSION.SDK_INT

Android activity recreate itself

走远了吗. 提交于 2019-12-31 18:57:14
问题 My app normally works just fine, until I face a strange problem on specific device. There are 2 activities in App. After I start ActivityB inside of ActivityA, ActivityA starts with no issue. However, after I go back to the ActivityA with pushing back hardware button or calling finish(); inside of closeButton in ActivityB, ActivityA reloads itself. It triggers onCreate() again and reloads all its contents. And I'm not changing orientation of phone. This strange behavior only appears in 15

Open ServiceMode menu programmatically in Android

爱⌒轻易说出口 提交于 2019-12-30 04:39:07
问题 How to open the Android ServiceMode menu programmatically on Samsung Phones ? Manually, I can do it by dialing the ussd code *#0011#. 回答1: This was a challenge and I've been a few hours looking for a solution. But i am afraid i don't have good news. 1. First attemp, Intent.ACTION_DIAL Is true that in the beginning, it was possible to directly call USSD codes from an app (using the intent Intent.ACTION_DIAL), and even from a website, just using the "tel:" schema. That opens the dialer, an puts

Android Printing API on Galaxy Tab

自古美人都是妖i 提交于 2019-12-28 05:54:53
问题 I would like to add wireless printing to my android 2.2 application which is targeted for the Galaxy tablet. I see that the internet browser has a print option so I am assuming that an activity hook must exist, and I was hoping that someone has figured this out. I have found a possibility using the PrinterShare application from Mobile Dynamix, but my preference would be to no require a 3rd party. Here is the code example that they provide, just for reference. Intent i = new Intent(Intent

Turn ON/OFF Camera LED/flash light in Samsung Galaxy Ace 2.2.1 & Galaxy Tab

孤者浪人 提交于 2019-12-28 02:44:14
问题 I am turning ON Camera LED light using FLASH_MODE_ON . Samsung Galaxy Ace have only three flash modes : on, off and auto. FLASH_MODE_TORCH not working in Samsung Galaxy Tab & Samsung Galaxy Ace 2.2.1 Here is my code how i am turning ON my Camera LED Camera cam; cam = Camera.open(); Parameters params = cam.getParameters(); params.setFlashMode(Parameters.FLASH_MODE_ON); cam.setParameters(params); cam.startPreview(); cam.autoFocus(new AutoFocusCallback() { public void onAutoFocus(boolean success

Samsung Galaxy S7 show device photos rotated

旧城冷巷雨未停 提交于 2019-12-25 08:16:07
问题 I've developed an android app that shows in an adaptor all photos the user has in its device. This is the code I'm using to read the photos: Cursor photos; String pictureCols[] = { MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA, MediaStore.Images.Media.BUCKET_DISPLAY_NAME }; String order = Media.DATE_ADDED + " DESC"; photos = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, pictureCols, null, null, order); photos.moveToFirst(); photosAdapter.addItems(photos)

Access file on my android phone from C#

拥有回忆 提交于 2019-12-25 04:12:24
问题 I connect my galaxy s4 to my computer in USB cable. I can see drive "Galaxy S4" in "My computer"--> "Portable Devices". My question is how can I access a file on the device from C# application? (I can't find full path to file, for example to jpeg file in folder 'Galaxy S4\My Pictures\Picture.jpeg') 回答1: Perform the following steps (on your Galaxy S4): Settings Developer Options Enable Developer Options Enable USB-debugging With Developer Options enabled it is possible to access all the files.

It's a kind of magic… VideoView and displaying videos on Android 3.1 vs. 4.1

心已入冬 提交于 2019-12-24 05:29:10
问题 Hi android programmers, I've been struggling all day long on a problem that seems strange and with no solution. What I seek is some guidance and some previous experiences. For testing purposes I have a Motorola Xoom , Galaxy Nexus Tab , Galaxy Nexus phone , and a Galaxy Tab 10.1 . The main testing application is developed for/in the Galaxy Tab 10.1 . The application is very simple. Pressing a button -> starting a video. The application runs fine on the Jelly Beans devices. But on the 3.1

Android logcat error “getExternalStorageState/mnt/sdcard” when checking for external storage state

被刻印的时光 ゝ 提交于 2019-12-23 09:57:52
问题 On my Galaxy Tab 10.1 I get strange logcat errors when checking the external storage state with: Environment.getExternalStorageState(); Logcat says: 03-10 14:13:22.700: E/Environment(32754): getExternalStorageState/mnt/sdcard Did not really find something helpful when searching on Google. The only information I found that this maybe has something to do with the filesystem. Can this error be fixed? I used API Level 11 in this small Test Project. Edit: Just to clarify... getExternalStorageState