I have been asked to look at getting an existing app working on an Android phone running Andrdoid 2.3.6 ( API 10? ).
The app currently used the ICS ActionBar, is there any way of doing this with API 10?
I dont think even ActionBar Sherlock goes down to that API level.
I dont think even ActionBar Sherlock goes down to that API level.
No, ABS supports everything from Android 2.0 (API 5) upwards.
ActionSherlockBar, supports almost all version.
I actually used it extensively on 2.x devices!
Related
I'm building an app but I would love to upgrade it to the Android Lollipop design. I use Android Studio to develop my application and I set my minimum SKD to API 21 (Lollipop) and I want it to run on Kitkat and Lollipop, so now I got the Lollipop interface and want to run it on Kitkat but ofcourse this isn't possible because the minimum is Lollipop. And as I expected it didn't ran on Kitkat. So I changed the minimum SKD to 19 in build.gradle and the target SKD I let as it was (SKD 21) so now Kitkat could run the app but the full layout is Kitkat style , not Lollipop. Even tho I made the app as Lollipop design and Android Studio previewed it as Lollipop interface. I hope somebody could help me get the Lollipop interface on Kitkat.
Thanks in advance.
It is not strictly possible to get "the Lollipop interface on Kitkat". You are welcome to use the appcompat-v7 backport, which will give you:
an action bar styled according to Material Design and therefore reminiscent, though not identical, to the native Android 5.0+ action bar
tints applied to certain widgets
a Switch backport that looks like the Android 5.0 version of Switch
a Toolbar backport
You can implement Material Design, on Pre Lollipop devices by using android support library appcompat_v7 rev21and then setting the theme in AndroidManifest.xml as #android:style/Theme.Material (dark version) OR #android:style/Theme.Material.Light (light version) OR #android:style/Theme.Material.Light.DarkActionBar
Below are the official links for doing the same :
https://developer.android.com/training/material/theme.html
https://developer.android.com/tools/support-library/features.html#v7
Hope this Helps!
My problem is that I have an app with action bar menu. The app works fine on the emulator, everything is shown, but when I'm debugging it on physical device, I can't see action bar with buttons. I have added action bar with support library. MinSdkVer of app is 8. My phone has android version 2.3.6, so version shouldn't make any problems. I don't know what can be done to make it work.
Set up your project with the appcompat v7 support library by following the instructions in the Support Library Setup.
Once your project is set up with the support library, here's how to add the action bar:
Create your activity by extending ActionBarActivity.
Use (or extend) one of the Theme.AppCompat themes for your activity. For example:
Now your activity includes the action bar when running on Android 2.1 (API level 7) or higher.
check your emulator version it might be above 3.0 and if you run app in emulator with version below 3.0 you will get the same buttons you have watched in your device....
the solution is you have to use support library concept shown in following links,
http://developer.android.com/tools/support-library/index.html
http://tekeye.biz/2012/android-support-library-samples
http://www.grokkingandroid.com/adding-actionbarsherlock-to-your-project/
I am new in android development. And I have confusion about android layout compatibility.
I am creating one app in android 4.0.3 but it's UI look like android 2.2 related UI.
I used all default controls in app but it not look like 4.0.3 related UI.
So any one can help me in below problems.
If I am creating app in android 4.0.3 then how it's look in android 2.2 and vice versa?
How can I create app which is run in all android version with standard UI?
Please help me.
Thanks in advance.
Your app will use the system theme that you specify, or the custom styles that you specify. If you do not create custom themes or styles your app will use the default styles on each platform. So on 4.0.3 it will use the ICS theme, and on 2.2 it will use the older theme.
To create an app that will run on all versions, you should probably set your target API to 1.5, but there are few devices with 1.5 left, so you'll probably set your API target to 2.2, and this will make your application run on all the devices with Android 2.2+.
I'm trying to figure out if an Android phone has hardware menu button, I've searched and found this method:
ViewConfiguration.get(getApplicationContext()).hasPermanentMenuKey();
But this doesn't seem to work in Android 2.1, and I'm trying to create an app that works on Android 2.1 and higher. Is it possible to detect if there is an hardware button on a phone with Android version less than 3.0?
Every compatible 2.1 android device had a menu key as it was part of the CDD:
http://source.android.com/compatibility/2.1/android-2.1-cdd.pdf
See section 8.7:
"The Home, Menu and Back functions are essential to the Android navigation paradigm. Device implementations MUST make these functions available to the user at all times, regardless of application state."
Therefore, if the device is running android 2.1 it's safe to assume it has a menu key. If it's running a later version you can use the API you found.
hasPermanentMenuKey() was introduced since API Level 14 because from Android 3.0 the devices were allowed not to have a menu key. so I assume that you can safely assume that a 2.1 device will have a menu key. Check the android documentatin on this for more. Android view Configuration hasPermanantMenuKey
hasPermanentMenuKey() became available at API level 14 (3.0). I would believe it is safe to assume there is a key on devices running below 3.0. Above 3.0 you can call this method to determine if you need to provide an alternative method.
We are building an app that is (still) targeted at API Level 8, but we make use of the compatibility package. Because of the specs we cannot target level 14. On a new device (HTC One X) the menu button of the ActionBar is visible below the app. Is there a way to disable or hide that button?
try reading about the ActionBarSherlock, it's a compatibility library for implementing action bar in lower SDK version.
You can try ActionBarCompat. It's pure Android :-)