How to use circular progress button library on android 4.0 lower? - android

I want to use circular-progress-button on android 2.2 or above. But there is a error on Property class that say minimum sdk must be 14.
I don't want to check sdk version and then use or not.
Or even is there any alternative library like this?

If you want to remove that error maybe you need to increase android:minSdkVersion to 14, which means you cant support bellow Android 4.0.
But there is another library with android:minSdkVersion=11. You can use that library too. Here is the link:
FABProgressCircle

Related

How to add textDirection support to API 8?

I want to create an Android app using API 8
<uses-sdk android:minSdkVersion="8"/>
I have a EditText control in which I want to type in right-to-left mode.
There is a new property called textDirection which is support in API 17 and higher. But I want to know if there is anyway to make my app supports this property. I heard about some appcompat things but I couldn't figure out if android-support-v7-appcompat has something to do with it.
Will android-support-v7-appcompat solve my problem? cause I tried that and also Adding android.support.v4 to your Android application in IntelliJ IDEA. but none solved my problem.
Is there any other way to do it?

error in styles in API8 in Eclipse

could anyone please help me with this?
I opened an existing project and I get this error in the screenshot.
The problem is that you are using a style which require API 21. You are referencing a style called Widget.Material.ActionButton. So you need to put this reference in a v21 directory to use the CompatLibrary which I would recommend.
The real cause seems to be that you have a very low target SDK (like you wrote in the comments API 8). You should set it to the most newest one, it cannot break anything. So set the target SDK to API 21 or newer and it should work fine.

Classes could not be instantiated: Android Studio Rendering Problems API 22

Whenever I create a blank activity layout file assigned to be rendered at API level 22, following error message is generated
The solution to this is to change the API level by changing it to API 21 or less.
What is the reason behind this?.
This was very common for me when a new API SDK version was released and yes like you mention we have to change the Android version to use when rendering layout in the IDE.
But this time i have installed all the elements described in the Android SDK Manager for this API 22 and I have no problems with the rendering.
You can just change "AppTheme" to another theme and keep the API level as you desire.
Many users are reporting this problem and it happens only in the Layout files that uses support libraries and not the normal ones.

Monodroid: Access setLayerType of View-Class

I want to call the Method setLayerType of the View Class in a Mono for Android application. Unfortunatley I cannot access (or even see) the method. According to Mono Documentation everything should be there.
Can somebody help me with this?
Thanks,
faiko
I had the same problem. You can fix this under your project settings choose "Minimum Framework Version to Target" of Android 3.1 or higher. This has nothing to do with your minimum/target API level in your manifest.
After changing that, you will have to restart Visual Studio (or reload the project in question) and you'll notice it now references the v3.1 assembly of Mono which has some new APIs exposed.
You'll still want to wrap the call to this API around a version check like:
if (Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb) if your minApiLevel is less than 11.

Explain targetSdkLevel and how I should determine its correct value

Can you explain to me how I should determine the correct value for targetSdkLevel?
Let's say I want to build an app that works on all the versions from android 2.3.7 to 4.0.3, how should I set minSdkLevel and targetSdkLevel?
The former should match the API level of android 2.3.7 and the latter should match the API level of 4.0.3?
Then, when I develop my app, should I use only Methods/classes available in the oldest supported sdk level?
When I compile the app does it compile for 2.3.7 or 4.0.3?
I can not understand the purpose of targetSdkLevel, since the apk can not be compiled for the newer version specified in this tag, otherwise it could not work on versions down to the one specified by minSdkLevel... Why should I not set targetSdkLevel to the latest available level?
I've read also the official info about uses-sdk Manifest tag, but I still do not understand.. Can you help me clarifying this topic?
EDIT: thanks to all of you and excuse me for the duplicate question. I've read this Blog post and it really helped me. Great answers from all of you.
You should only use methods/classes available in the SDK specified by minSdkLevel, or otherwise wrap them with a proper check for the runtime API version.
Your application will be compiled with the SDK specified in the project itself, not by the one specified by either minSdkLevel nor targetSdkLevel.
You should set targetSdkLevel to the highest level API that you have tested the application with. This is because compatilibity behavior will be enabled/disabled for your application based on this value.
It clearly is explained here: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
minSdkVersion:
An integer designating the minimum API Level required for the
application to run. The Android system will prevent the user from
installing the application if the system's API Level is lower than the
value specified in this attribute. You should always declare this
attribute.
And for targetSdkVersion
An integer designating the API Level that the application targets. If
not set, the default value equals that given to minSdkVersion. This
attribute informs the system that you have tested against the target
version and the system should not enable any compatibility behaviors
to maintain your app's forward-compatibility with the target version.
The application is still able to run on older versions (down to
minSdkVersion).
What is that you don't understand here?
This is how you would set it:
<uses-sdk android:minSdkVersion="10"
android:targetSdkVersion="15"/>
You can read about the changes here, for API Level 14: http://developer.android.com/sdk/api_diff/14/changes.html
and here for API Level 4: http://developer.android.com/sdk/api_diff/4/changes.html
Build using the target, and then you can check and gracefully downgrade if the user is below the target. For example, if you are creating a location aware app, you might want to use PASSIVE_PROVIDER which is available starting with version 8. You could set the min version lower than 8 and check the android version. From there you could decide to use or not use PASSIVE_PROVIDER based on the version.
google suggests that you always use the latest version of the targetSdk , and also gives the lint tool to check for you that your classes and methods aren't too new for the minSdkVersion .
in case of a warning , you will need to think of how to handle it.
do note that as people has mentioned here , setting the targetSdk also means that it will change some aspects of the app .
one aspect is how the app treats the menu button : if you set the targetSdk to 11 or above , it means that you can't assume that there is a menu button , so you will have to deal with the action bar and put the options there in some way (or any other way, depending on your app design) .
if you set it to 10 or below , android will add this button (shown as 3 dots) on the screen for devices that don't have the menu button , like the htc one x or the galaxy nexus . do note that for some devices it looks ugly (takes a whole row for the htc one x , for example) .
so , in short , i would suggest setting the minSdk to the minimum that you can , in order to support as many people as possible , and the targetSdk to the maximum that you can , in order to enjoy all of the benefits that it can give you .

Categories

Resources