android-4.0-ice-cream-sandwich

Does Android's large heap option work for older phones upgraded to ICS?

风格不统一 提交于 2019-12-02 23:08:42
I've got a Galaxy Nexus myself, and I know that the android:largeHeap="true" manifest option works on this phone, but I was wondering if it's working on older phones that are being upgraded to Ice Cream Sandwich, i.e. the Samsung Nexus S. The reason why I'm asking is that I've built an application that makes heavy use of large bitmaps and the application was originally designed for tablets with 48 MB of heap size. The Galaxy Nexus also features 48 MB of available heap size for each application, so my application is working beautifully on this phone despite it not being a tablet. The problem is

Roboto font for Android 4+?

≡放荡痞女 提交于 2019-12-02 22:26:09
Do I need to use Roboto font and put it to asset folder if my app will support only Android 4+ devices? I would greatly appreciate for your help. Alex. P.S. Sorry for my English:) Ahmad You can use Roboto natively from Android 4.1+ like this: android:fontFamily="sans-serif" // roboto regular android:fontFamily="sans-serif-light" // roboto light android:fontFamily="sans-serif-condensed" // roboto condensed For any version below that, you have to load the font yourself. Look at this answer I gave a while back for more information. AlexMomotov Answer Ok. I think, I got it. Samsung phones are by

Is it possible to get the resolution of a video in Android?

有些话、适合烂在心里 提交于 2019-12-02 20:44:33
I'm looking for a way to get the resolution of any given video in Android. It doesn't have to work with other formats than the ones supported in Android, but it'd be great if it did. If you're unsure of the supported formats in Android, please refer to this page: http://developer.android.com/guide/appendix/media-formats.html I think it's possible to do what I want using the MediaPlayer class, but that seems incredibly stupid and inefficient. Also, I'd like a way that's relatively fast. I'm targeting Android 3.0+, if that makes any difference. Honeycomb also supports .mkv files, although it's

Getting selected text in a WebView via a contextual action bar

做~自己de王妃 提交于 2019-12-02 18:39:10
It's known to be difficult to get selected text in a WebView because WebView text selection is actually handled by a private class, WebTextView . However, with the recently released Android 4.0 Design guidelines , there seems to be a glimmer of hope of achieving this through contextual action bars (CABs). It says : Use CABs whenever you allow the user to select data via long press. You can control the action content of a CAB in order to insert the actions you would like the user to be able to perform. Am I misinterpreting this? Is there a way to retrieve selected text from a WebView via a CAB?

How to make full screen in Android 4.0

隐身守侯 提交于 2019-12-02 18:34:30
Android 4.0 phones only have virtual buttons, which actually go invisible when playing youtube/video at fullscreen (the video portion takes over where the buttons are). I want to do this, but haven't found a way. android:theme="@android:style/Theme.NoTitleBar.Fullscreen" or requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); do not cover the virtual buttons. Here is an example that shows the type of full screen I'm talking about: http://www.youtube.com/watch?v=Lw_O1JpmPns Okay, I added

How can I get the same undefined ProgressBar as ICS with 2 rotating circles?

余生颓废 提交于 2019-12-02 17:32:20
I am currently writing an open source project that aims to port the famous Holo theme to previous versions of Android (since 1,6!!!) Everything works fine and I am really proud of my work, but the problem I am facing now is to get the ProgressBar totally looking like the ICS one. I used the same xml code than Android source: (progress_medium_holo.xml) <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <rotate android:drawable="@drawable/spinner_48_outer_holo" android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0" android:toDegrees="1080" /> </item> <item>

Android loaders, the way to go?

白昼怎懂夜的黑 提交于 2019-12-02 15:51:52
I am used to building lists in android using adapters. If I need some long-to-get data, I use an asynctask, or a simple runnable, to update the data structure on which the adapter rely, and call notifyDataChanged on the adapter. Although it is not straightforward, I finally find this is a simple model and it allows a good separation of logic presentation (in the asynctask, update a data structure) and the view (an adapter acting as a view factory, mostly). Nevertheless, I read recently about loaders introduced in HoneyComb and included in the backward compatibility support-library, I tried

Bluetooth Smart (4.0) / GATT support in Android 4.0?

蹲街弑〆低调 提交于 2019-12-02 15:36:10
I'm trying to find way to work with Bluetooth 4.0 (AKA Bluetooth Smart) devices using modern Android smartphones, namely - HTC One V. As I understood, there is some issues using GATT profile even in Android 4.0 with Bluetooth 4.0 hardware because of API limitations. I saw Motorola released it's own API for BT LE, but not sure it will work for other vendors. My goal is to get universal support for all smartphones with appropriate hardware. Any suggestion for solution are highly appreciated. Alexey PS: Yes, I saw Android API for HDP, but it seems to be used only with 'classic' Bluetooth devices

Android Actionbar Search widget implementation In ListFragment

有些话、适合烂在心里 提交于 2019-12-02 14:03:39
I currently have my application set up with a ListFragment on the left and a DetailsFragment on the right (similar to the layout on the tablet below). On the action bar I have a search widget which when a search term is submitted should update the contents of the list (in the ListFragment). I have been following the search guide on android dev ( http://developer.android.com/guide/topics/search/search-dialog.html ) but I am having problems getting the search to update the list in the same activity. I have managed to get some form of implementation working by calling a new activity when the

Why this doesn't work for ICS [duplicate]

二次信任 提交于 2019-12-02 08:01:15
Possible Duplicate: Strange NetworkOnMainThreadException in Android app? Trying To Upload To Dropbox: NetworkOnMainThreadException? I have used the below code for reading HTML contents from a url. This works perfectly for 2.3.3 but when I try to run the same code it doesn't work for ICS. I am trying to append these html contents on to a edittext . But it always remains empty when I run the code on ICS. What may be the problem? public class Quiz1Activity extends Activity { private static BufferedReader reader = null; /** Called when the activity is first created. */ @Override public void