I have a library project whose target in project.properties is android-11. I wanted to create an app which uses that library, but compatible with android 4.1.2, so i edited also the library target with android-16.
But when i've done this change, the application gave me some problems and didn't work as before: for example in devices with software menu buttons, the buttons did not appear.
Can you tell me why? Thanks
first of all pls goto the SDK manager and check if you have SDK for Android 16 or above installed. If not please install it, if you have already installed then don't change anything in then project.properties, goto AndroidManifest.xml and make sure that "maxSdkVersion" is equal to above 16, if not it means that the library is depreciated and you cannnot use it for latest version. But generally most of the old libraries would support new SDK builds, so I suggest you to leave it as android-11 as it makes no harm
<uses-sdk
android:minSdkVersion="3"
android:maxSdkVersion="16"/>
Related
I am trying to use the code template provided by android in eclipse and I set my min SDK to API 8. I tried to choose the "blank activity with scrollable tab" for using the swipe feature but it wouldn't let me continue and complaining that this code template support version 11 and more.
However, I thought that's why the support library of version 4 is! To support Api 4 and above.
Am I missing the point here or is there something I need to do?
Thank you
Use the android.support.v7 compatibility libraries (which work together with the v4 libraries).
When you create the project in eclipse set the minimum API version to 11 but once the project is created, edit AndroidManifest.xml to set minSDKVersion to 8.
From time to time when building the project, eclipse may complain about min SDK version being required for certain things - in this case just Clean the project and it will build without problems.
I have gotten it to work using ActionBarSherlock and ViewTabPager. Look into those
I am already having one small project in android that is build in API-10.
And i am using the latest version of the API-17 and having the same SDK manager.
Now when i import this project it shows error like Unable to resolve target 'android-10' and some more lines.
So, when i Googled about this problem i found that i think i need to download API-10 and the SDK.
So i wanted to know why its needed?
Because my existing code is built in API-10 then i think it should be compatible with API-17.
I am new to Android i just understood some concepts like Activity, Services and many more but when i came around this issue i really shocked?
I just wanted to understand why its needed while i am already having SDK for API-17?
try by adding targetSdkVersion to the manifest file
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
and clean your project, that might also help
What that means is you need to start your Android SDK Manager and download and install API Level 10. Why do you need API Level 10 ? Well, the project you are importing needs that API level.
Recently I updated SDK, and this new 'compile with' option appears.. what does it mean?
It means that despite targetSdk, "compile with SDK" version will be used. This is helpful to target higher SDK and avoid accidental use of newer API. Or, in other words, you want to target API17 but stay compatible with API8 without much effort. So you set target to API17 but compile with to API8. Now, if you code for any reason use anything that was introduced in API9 or up it will not compile. Previously app was build with API version set as target sdk
EDIT
After closer look I think this is broken. It is basically not saved neither in project.properties nor elsewhere, therefore it does not really serve described purpose, outside "New Project Wizard", which will generate code/layout stubs to match "compile with" API version.
Filled bug report: http://code.google.com/p/android/issues/detail?id=40286
Compile With is the platform version against which you will compile your app. By default, this is set to the latest version of Android available in your SDK. (It should be Android 4.1 or greater; if you don't have such a version available, you must install one using the SDK Manager). You can still build your app to support older versions, but setting the build target to the latest version allows you to enable new features and optimize your app for a great user experience on the latest devices.
source
I have been creating an app for Android SDK 8 and it works fine. Since most users are using SDK 7 and above I tried to switch to SDK 7, but then my custom ImageViews disappear from my RelativeLayout. The app does not chrash. Is this likely happening because I am using some of the framework from SDK 8? If so: is there an easy way to find out which part of my code that makes use of SDK 8 (i.e. not checking the API level of each and every method against the developer docs)?
There is really too much code to post it here. My manifest file includes
<uses-sdk android:minSdkVersion="7"
android:targetSdkVersion="7">
and my project.properties file has the line
target=android-7
Until now they used to be 8, but I changed them all to 7.
Not sure if that's your issue, but to answer the general question of finding which APIs you're using that are above the minimum API version:
Update to the newest version of the Android Developer tools, and from the command line, run lint from the root folder of your project. Among other things, it checks for "API accesses to APIs that are not supported in all targeted API".
Helpful resources:
Developer tools page for lint
Complete list of Lint checks
I downloaded the newest source code of Android form git,
and I managed to compile the source code and made a SDK and a emulator with the verison AOSP.
Then I tried to modified the source code of LatinIME the input-method and managed to compile and run on the emulator compiled along with the code of version AOSP.
Then I want to install the apk to my phone whose sdk-version is 2.2, and the error appeared to say my sdk-version is too low.
I'm sure I've add the <uses-sdk android:minSdkVersion="8" /> in the manifest node in AndroidManifest.xml , but it still needs the AOSP version to install.
Is that means I will have to repo the 2.2 version source code to compile the apk so it can fit my phone?
OK, I'm answering my own question again, I can't understand why my questions always rarely answered.
However I searched the whole Internet and can find a answer, but in luck I saw this:
version_defaults.mk of API Key 7
I simply replaced the android/build/core/version_defaults.mk in my downloaded code tree and re-compiled the module, and it worked!
Thought I don't know if it will work all modules in the source code, but however my IME works good.
Why have you added in the manifest the min sdk version? I don't think you have added features compatible only for froyo or newer.
The original manifest http://www.google.com/codesearch/p?hl=it#cZwlSNS7aEw/packages/inputmethods/LatinIME/java/AndroidManifest.xml&q=latinime&d=2
deos not have a min sdk version. Try to remove it.