android-4.0-ice-cream-sandwich

Android: Youtube API using API Level 11 (or higher)

故事扮演 提交于 2019-12-08 04:57:07
问题 I'm developing an Android app and I want to search for the first result in youtube to a given query. Firstly, I started to use the following URL: "http://gdata.youtube.com/feeds/api/videos?q="+ query + "&max-results=1" It works good for Android API level 10 (or less) but it doesn't work for API level 11 (or higher). Then, I tried to use the Youtube API . I initially had errors with the SAXParser, but then it works fine. Once again, it works fine to API level 10 (or lower), but didn't work for

App Crashes on Android 4.0, but not 2.3 — Strange Exception

南笙酒味 提交于 2019-12-08 04:43:11
问题 I'm developing an android game on 2.3 and have started testing on more devices so that I can release it. On some, not all 4.0 devices my game crashes when minimized. You can lock the phone and unlock it, and the game resumes and pauses just fine. The crash occurs when you try to return to the home screen. The error logs are shown below: 07-18 14:33:44.839 E/AndroidRuntime(15542)FATAL EXCEPTION: Thread-662 07-18 14:33:44.839 E/AndroidRuntime(15542)java.lang.NullPointerException 07-18 14:33:44

Building for Froyo, Styling for ICS

℡╲_俬逩灬. 提交于 2019-12-08 04:07:22
问题 I'm planning on writing an app and building against 2.2 Froyo (API Level 8). However, I want app users of 4.0 ICS to experience the app with the ICS user interface. Currently my approach is to have the default activity of my app sense the version of the Android device. If it is less than 4.0, use XML views written for Gingerbread and Froyo and, if it's 4.0 or higher to use ICS XML views. This however seems a bit haphazard and I'm not sure I can manage the separation of version views

UDP sending on Android4.0 and before versions

南楼画角 提交于 2019-12-07 21:09:44
问题 In my code public void vodKeyCtrl(byte[] sendDataByte, int send_length) { try { Log.i(TAG, addr.toString()); InetAddress ia = InetAddress.getByName(addr.getKeyIp()); DatagramSocket socket = new DatagramSocket(0); socket.connect(ia, addr.getKeyPort()); DatagramPacket dp = new DatagramPacket(sendDataByte, sendDataByte.length); socket.send(dp); socket.setSendBufferSize(sendDataByte.length); socket.close(); } catch (Exception e) { Log.e(TAG, e.toString()); } } There seems no errors and exceptions

Arabic font gets cut in Android 4.0

孤街浪徒 提交于 2019-12-07 20:40:23
问题 It's look like wired behaviour of Android 4.0. In my project there is some Arabic text. While I am running that project in the emulator with Android 4.0 or any version then it looks fine. But when I run it on a real Android 4.0 device then it looks like the text is getting cut from the right side. See the below Screen. Screen 1: In Emulator Screen 2: In Real Android 4.0 device I can't understand why it is happen like this. How can I fix this? code or row item: <?xml version="1.0" encoding=

Android backward compatibility techniques

和自甴很熟 提交于 2019-12-07 17:25:11
问题 I am now advanced in developing my 15-activities android app which is based on the latest API (15 ICS). Now I discovered that main functionalists of the app is NOT backward compatible even with the android v4 support such as: 1-fragmentTransaction animation 2-the ability to putStringSet in sharedPref 3-having mapActivity using fragments I thought about making a second version for the older OS's of EACH class that has incompatibility issues (which are around 10) so I use them if I detect that

Android TextView NullPointerException with onTouchListener and onClickListener on 4.0

本小妞迷上赌 提交于 2019-12-07 11:25:47
问题 I have a TextView which I've assigned both an onTouchListener and an onClickListener: myTextView.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { _gestureDetector.onTouchEvent(event); return false; } }); myTextView.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Show Toast Notification } }); The onTouchListener will detect an onFling() for the gesture detector. This code works without any problems EXCEPT for Android 4.0

aapt.exe is throwing unhandled exception while building *.apk file for Android project in Eclipse

耗尽温柔 提交于 2019-12-07 09:13:49
问题 i just upgraded my system to Ice Cream Sandwich (Android 4.0) and now everytime I attempt to run my application in the debugger, I get a crash in aapt.exe . If I just build, it builds fine, but when I go to run it in the debugger, aapt.exe crashes (which pops up a dialog and asks me if I want to send data to Microsoft) and my project icon in Project_Explorer shows that it has error(s). 回答1: There is a known issue in AAPT for r15, try to change the build output to normal http://tools.android

Removing heighlight from image map area in Android 4.x app via PhoneGap Build

无人久伴 提交于 2019-12-07 08:28:37
问题 I have tried every which way to try to remove the heighlight when pushing on an image map area of an image. I have search google time and time again and have added all the CSS code i could find in hopes it would help.. but it does not seem to. An example of what i am talking about: I have added: -webkit-user-modify: read-write-plaintext-only; border:none; outline: 0; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); -khtml-user-select: none; -o-user-select: none; -moz-user-select: none;

Possible to make setSystemUiVisibility() affect the entire system, rather than just your app?

南笙酒味 提交于 2019-12-07 08:22:13
问题 I was hoping to make an app which dimmed the soft buttons to dots on the Galaxy Nexus, using the code from this answer. For completeness, this is the code: getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); Here's the question, is it possible for the app to make this setting system-wide rather than just while the app has focus? So ideally the app would run in the background and would keep View.SYSTEM_UI_FLAG_LOW_PROFILE as the default as long as it's running,