I'm trying to compile the ZxING BarCode scanner, that comes from default for SDK 7. The problem here, is that I want to compile and test it on a SDK 4 device, so when I change in properties the android version and the target SDK on the ManifestFile a lot of errors appears. Is there a minimum SDK requirement for ZXING? Is there a version of the zxing library for older SDK's?
"Is there a minimum SDK requirement for ZXING?"
Yes apparently so, SDK 7 =). Yet another reason to integrate with intents rather than including your own copy of the library.
The All Downloads page on zxing site contains links to old versions of the project zip. Perhaps one of the deprecated versions will work for you? (although at the cost of losing anything that got fixed with newer versions)
Related
I am building an application for Android and iOS using Titanium SDK 3.2.2GA which is free. I am using Titanium.Media.AudioPlayer for the development of the stuff related to audio in my application but this audio player provided by titanium is kind of incomplete for example, duration is not available in iOS and Android but the property exists.
So in order to add the functionality which is not currently present in this library, I edited the Titanium SDK for iOS from the path (Library/Application\ Support/Titanium /mobilesdk/osx/3.2.2.GA /iphone/Classes) but I am stuck when it comes to Android because the Android folder contains the precompiled classes in the form of .class files.
So, I was just wondering if anyone has a solution for it. All I want is to implement the fix mentioned in the following commit, to my existing Titanium SDK but when I goto (Library/Application\ Support/Titanium /mobilesdk/osx/3.2.2.GA /android/modules/..) all the files inside it are pre-compiled .class files.
TIA.
The 3.2.2.GA version of Titanium SDK is very old. As Shoaib mentioned above you should use a more recent version, for instance: 5.2.2.GA or the current stable 5.3.1.GA. However, if you need to use the 3.2.2.GA version for some special requirement, you must download the source code of SDK version, make the changes (apply the commit) and compile it, instructions available in: https://wiki.appcelerator.org/display/guides2/Building+the+Titanium+SDK+From+Source
Sir
I have a project having only src and res folder
And I know that it is targets api 22
And it need library Google play service and v7 compat .
How do I create a project in eclipse or Android studio having above things please help?
Refer to this for everything you need to know: http://developer.android.com/develop/index.html
EDIT:
In Android Studio, look in the toolbar for File->New->New Project. Android Studio will guide you through the process and you can specify your target API and things from there on.
Google does not develop the ADT plugin(the required plugin so you can develop android in eclipse) and they recomend you transfer to Android studio. I have had that same problem with appcompat crap and it is solvable in two ways(as far as I have seen):
1: Use Android Studio instead, as it really truly supports all android related dev requirements, including app compat.
2: In your project, set minimum API level to Android 4.0.3 or above. This way you prevent the requirement for appcompat.
I recently transfered from Eclipse to Android Studio, and the transition was easy, and once I found out how I could use the Eclipse keybindings, it was just the GUI that was different. It is really easy geting used to Android Studio, and I recomend you start using it as soon as you can. It will solve most of your problems related to appcompat and other libraries that needs to be added to support earlier versions of Android
As you see on the image, there is a "Minumum required SDK". The minimum SDK and target SDK are two different options, and target should be the newest SDK, while minimum should be(in my opinion) Android 4.0.3 or higher. According to Google, this allows you to reach about 90% of all Android users
EDIT
Using Android Studio, as long as the SDK has everything installed and Android Studio is as new as possible, it will add appcompat v7 automatically without issues. Eclipse's ADT plugin is outdated and probably doesn't support appcompat anymore. I personally preffer eclipse, but due to android issues, I had to move over to Android Studio
I am not fully certain that I am not making any mistakes when setting API level when developing under Eclipse so here are some examples which I am not 100% certain about.
When developing Android app in Eclipse I always set BuildProjectTarget under Eclipse and android:targetSdkVersion in the manifest to the latest available Android version. Is this practice correct? NOTE:I do set android:minSdkVersion according to the project (usually value is 10)
I know that doing the above will trigger Eclipse warning about unsupported API when using something not available in version under android:minSdkVersion (for example using fragments without support library) are there any examples when these shouldn't be trusted and what will happen if you build the project using Gradle/Ant script or manually?
What would happen if I set BuildProjectTarget and android:targetSdkVersion to for example 16 and then use some deprecated API like WebView setCertificate() (which was deprecated in API level 17). Will this method work on all devices or just those up to Android 4.1, will it crash the app or just be ignored?
I know that Eclipse uses Java library android.jar from SDK/platforms folder and that when on the device app links to that library stored on device but what I don't get is are there multiple versions of this library on android phones or just one (the latest for that android version) ? Also does a version of framework.jar play a role in this?
What happens with the libraries when you use something like google_play_services? Are these packed into the apk or reference the library that is already on the device? I know that when you use Facebook sdk the jar gets packed into apk but don't know are these google libraries different?
Yes this practice is correct and is done to ensure support for the latest android versions.
When you set a minSdkVersion, then that's thr lowest version of Android your app will support and compiling with ant/gradle will show errors ehen you will use methods introduced in newer api levels for an older one.
Deprecated means that another method has replaced this one and that this one will spon be removed from the Android source code, so developers are encouraged not to use them. But yes they will work until they remain in the source.
The android.jar is a dependency of the methods and stuff included in the android OS, stuff that you'd be able to call and no I don't think framework.jar plays a role in this.
All external libraries are referenced and added to the apk. BUT only some of the google ones, those that are not primary. (Take a look at the gapps packages, that'll give you some specifics. Link: http://goo.im/gapps)
I hope I got this right and helped you to understand.
When developing Android app in Eclipse I always set BuildProjectTarget under Eclipse and android:targetSdkVersion in the manifest to the latest available Android version. Is this practice correct? NOTE:I do set android:minSdkVersion according to the project (usually value is 10)
Yes. That way you ensure you're always using the latest build sdk.
I know that doing the above will trigger Eclipse warning about unsupported API when using something not available in version under android:minSdkVersion (for example using fragments without support library) are there any examples when these shouldn't be trusted and what will happen if you build the project using Gradle/Ant script or manually?
Just make sure that older devices will not get to that part of the code, using Build.Version.SDK_INT. This will give you the current SDK of the device.
What would happen if I set BuildProjectTarget and android:targetSdkVersion to for example 16 and then use some deprecated API like WebView setCertificate() (which was deprecated in API level 17). Will this method work on all devices or just those up to Android 4.1, will it crash the app or just be ignored?
Deprecated methods will continue to work, but better alternatives are available. When you have the option to use that better alternative, use it. When you're supporting devices that don't have this alternative yet due to older versions, continue using the deprecated method. You might have to do some if else branching based upon the Build.Version.SDK_INT value.
I know that Eclipse uses Java library android.jar from SDK/platforms folder and that when on the device app links to that library stored on device but what I don't get is are there multiple versions of this library on android phones or just one (the latest for that android version) ? Also does a version of framework.jar play a role in this?
The newer devices contain the code of the older devices. Therefore it is not necessary to keep references to other versions.
What happens with the libraries when you use something like google_play_services? Are these packed into the apk or reference the library that is already on the device? I know that when you use Facebook sdk the jar gets packed into apk but don't know are these google libraries different?
The class files in the jar will be packaged in the .apk. The Google Play Services on the device communicates with your app using those classes.
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 am trying to implement SherlockActionbar. I downloaded the project from GitHub and imported the library as a Project and using Android 2.2 as the base SDK.
But the Project seems to have a lot of errors.
Guess i need to import some other library.
You need to compile with Android 3.2. The library needs access to classes from the Honeycomb SDK in order to support it when run on 3.0+
Despite compiling with the newer SDK, you can still support back to Android 2.2 by setting the minSdkVersion to '8'.
Each of the samples in the repository (for version 3) support back to Android 1.6. Take a look at their sources for more information and examples.