android-compatibility

ObjectAnimator in API Level < 11

陌路散爱 提交于 2019-12-03 01:11:06
So I'm getting really frustrated with android and the fact half the stuff doesn't work when you roll back the API Level past 11. Why isn't it easy and well done like iOS?! The Problem I am using ObjectAnimators to animate the transitioning between Fragments . They work fine in anything with API Level 11 and above. As soon as I change the build target to less than 11 I get problems with it saying it can't found the resource identifiers for attributes such as propertyName and valueType in the xml file. The Question What should I use instead to animate my Fragment transitions that will work on

Turn on hardware acceleration if available (such Android 3+) with Android APK 2.2

随声附和 提交于 2019-12-02 21:51:15
I developed a application for Android 3.0, and it's runs perfectly well, but the client insist on compatibility with 2.2 devices. Disabling hardware acceleration, using Android Compatibility Package, a NIO-backport support (For tasks and executors) and some reimplementation of View methods I was able to port my app for Android 2.2 and works really good, but if I run this apk into a newer device the performance is extremely slowly, so I want to know how to turn on hardware acceleration if available but still uses my 2.2 APK. Add android:hardwareAccelerated="true" to your manifest, either for

What is LinearLayoutCompat in appCompat v7?

五迷三道 提交于 2019-12-02 21:43:34
In the support library appCompat v7 of the Android platform, there is a android.support.v7.widget.LinearLayoutCompat class. Does someone know why this class exist? The original LinearLayout class exist since API level 1 so I don't understand why there is a compat version. The class LinearLayout exists since API level 1, but some APIs were added after that, for example, setShowDividers introduced on API level 11. So in this case setShowDividers (and it's parameters) should be invoked using LinearLayoutCompat instead LinearLayout if you are targeting a platform with API level below 11. 来源: https

How to make my website mobile and tablet compatible? [closed]

喜你入骨 提交于 2019-12-02 17:21:10
I want to make my existing website automatically adjust itself when viewed either on mobiles, tablets, or even when you adjust your screen on a desktop. Failing that, if it's too difficult, what suggestions do you have?? I basically want an ipad and iphone (android) version that uses the same url, with an auto direct when mobile browsers are detected. Many thanks You are looking for Responsive web design! Start with MediaQueries http://mediaqueri.es/ Also check this out for better understanding http://www.slideshare.net/zomigi/building-responsive-layouts-15508821 David Taiaroa Adding to what

“You need to use a Theme.AppCompat theme (or descendant) with this activity” when using AppCompat theme

纵然是瞬间 提交于 2019-12-02 07:36:43
I have a very strange problem with my app. After updating to the newest versions of Support libraries I get this error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. This is where the exception is thrown: public class MainActivity extends AppCompatActivity { … @Override protected void onCreate(Bundle savedInstanceState) { getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); super.onCreate(savedInstanceState);/

Android solving compatibility with SDK_INT hack; is this ok?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 15:01:28
Running the following (note: target > 3.0) ActionBar actionBar = getActionBar(); on Android with version < 3.0 (SDK 11) results in a NoSuchMethodError . There are several ways to get around this, including reflection and class lazy loading. However, the following seems to work across all the devices I've tested (2.3.6, 3.0, 3.1, 4.0): boolean hasActionBar = android.os.Build.VERSION.SDK_INT >= 11; if (hasActionBar) { ActionBar actionBar = getActionBar(); } else { // create custom actionbar } Note the SDK_INT parameter is static final , which appears to be why this works. Is this a valid way to

Can I use a actionLayout on the overflow menu of android.support.v7.widget.Toolbar?

佐手、 提交于 2019-12-01 03:14:20
I'm trying to use a SwitchCompat widget on the overflow menu of android.support.v7.widget.Toolbar but I just can't get it to work, it always appears blank. Here is my menu definition: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="com.oveflowtest.ScrollingActivity"> <item android:id="@+id/action_settings" android:orderInCategory="100" android:title="@string/action_settings" app:showAsAction="never"/> <item android:id="@+id/test" app:actionLayout="@layout

AndroidHttpClient and HttpGet API deprecated in Android 6.0 Marshmallow (API 23)

半城伤御伤魂 提交于 2019-11-30 23:56:00
Today I have updated android SDK API 23. As soon as I have changed my project to target Android SDK API 23, I started to get an error regarding Apache's client and AndroidHttpClient API in eclipse. Apache library API can no longer be found in API 23, nonetheless to continues to be working fine with API 22 and below. Can someone kindly suggest what the problem is behind these errors? One more error in project Thanks. The entire Apache API was removed from SDK 23 since from SDK 22 it was already deprecated. You can see it here: http://developer.android.com/sdk/api_diff/23/changes.html You can

Can I use a actionLayout on the overflow menu of android.support.v7.widget.Toolbar?

别说谁变了你拦得住时间么 提交于 2019-11-30 23:25:11
问题 I'm trying to use a SwitchCompat widget on the overflow menu of android.support.v7.widget.Toolbar but I just can't get it to work, it always appears blank. Here is my menu definition: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="com.oveflowtest.ScrollingActivity"> <item android:id="@+id/action_settings" android:orderInCategory="100" android:title="@string

onCreateContextMenu() for EditText doesn't work on real device

本小妞迷上赌 提交于 2019-11-30 07:24:34
Just tried to test my app on real device (HTC Desire Z with Android 2.2). And found that my context menus doesn't work at all on EditText s. Otherwise context menus works: in ListView , ImageView and so on. On emulator everything works fine... When I tap on EditText it shows something like zoom frame and then shows unusual (not standard Android alike) context menu which reads: "select text", "select all". It doesn't show my menus. Here are screenshots: Before tap During tap After tap (just ordinary select text, select all, paste) but no my menu like in emulator - look here Here's source code