how to choose android system platform on android studio? - android

I just installed Android Studio and when I was downloading Android 4.4.2 (API 19).
I noticed Android 4.4W (API 20) has already been installed by default.
How do I make sure Android Studio uses 4.4.2 and not 4.4W?
Is there a way to check which SDK Android Studio is currently selecting?
I'm using Mac o/s if it matters.

You can choose what version of API to use during a new project creation.
For existing project: File > Project Structure. Select the appropriate module on the left pane, then open Properties tab. Compile Sdk Version will be there.
Another option is to edit <project_folder>\app\build.gradle file manually.

1- Right click on the project's folder >> under Resources - Android.
2- you will find the current platform "checked".

Related

Unity requires Android SDK to be minimum API level 21

So I've been trying to build a Unity 4.6.1 project in Android, but the problem is that my Android SDK is outdated. However, I believe Google discontinued support of the traditional ADT to switch to Android Studio. Android Studio doesn't have an easy to find SDK folder in version 1.0.1. This is the error I get: "Error building Player: UnityException: Minimum platform required is Android 5.0 (API level 21)" How do I build my Unity project for Android, if the ADT doesn't have support for API level 21?
Click on the SDK manager button (on the top) and in a grayed out text on top of the window (which looks like it did in ADT) it should show you the location of your SDK(e.g. C:\users\admin\appdata...) . And you can change that location in the settings. Just remember to move the files.
1) Download SDK Tools (v25.2.5) from http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
2) Extract in a folder and navigate inside.
3) run android.bat which would open SDK Manager.exe. Update the packages from this tool (must done step). You can also install any specific API if required in your unity project.
4) In Unity, Go to Edit -> Preferences -> External tools and update path for JDK and the path of the folder where you extracted SDK Tools.
Now Unity would build for android without any issues.

How to add jar in Eclipse to update the version ?

I made my app for Android 4.3 and I'm almost done with that but now I want to upgrade it for Android 4.4.
Will it work by adding android.jar ?
Steps to perform it.
Download latest version of android i.e Andriod 4.4 (API 19) using Android SDK manager.
Right Click your Project -> Properties -> Android -> Select desired API level
Update your Android Manifest file with min, max and target SDK support
You can not change android.jar file directly. You need to perform step 2 to do so.
No, it will not work ... you need to update the SDK with Android SDK manager first. Then update the Eclipse ADT plugin and then go to your Android project, set the Android project build path to 19 and change the targetSDK to 19 as well in the Manifest.
The android.jar JAR file does not contain the Android framework code, but only stubs for the type signatures, methods, types, etc. The android.jar JAR file is only used for the Java compiler before deployment on an Android device. It is not bundled with your application. Once your application is deployed on the device / emulator, it will use the android.jar JAR file on the Android device. Calling methods from the android.jar JAR file throw a new RuntimeException("Stub!").

Cannot compile with API 18

I have installed Android Studio 0.2.4 and the SDK for API 18 from http://dl.google.com/android/installer_r18-windows.exe.
Now, when I start a new project, I can choose target SDK : API 18, but I can only compile with API 17. What to I have to do in order to compile with API 18?
In my case I was previously using intelliJ 13 EAP and switched to Android Studio for better Gradle support. Android Studio was pointing to a different Android SDK than I was updating. Android Studio bundles an Android SDK and places it in "\(relevant Program Files)\Android\android-studio\sdk" for all users or "\Users\(username)\AppData\Local\Android\android-studio\sdk" for just me user. So in your case I don't think you needed to download the SDK separately and it would have defaulted to the bundled SDK. To check or switch Android SDKs in Android Studio:
From the initial start screen choose "Configure/Project Defaults/Project Structure".
Click on "Project Settings/SDKs" on the left.
Check "Android SDK home path" points to the Android SDK you are using
and update if necessary using "Apply" or "OK".
Restart Android Studio and try create a new project.
After updating, make sure you have android-18 in your android-stuidio/sdk/platforms folder. I had to copy mine from my Android folder where sdk manager downloads them on my pc. After I did that, it made the dropdown with api-18 available.

How do you add an SDK to Android Studio?

I'm using Google's Android Studio 0.1 based on IntelliJ, and I cannot figure out how to add additional SDKs to my project.
I exported my existing project from Eclipse to a Gradle project, which I imported into Android Studio, as recommended by Google.
My project's SDK is Google APIs 2.3.3. However, I use a library called PullToRefresh which appears to need SDK 4.1, so I'm trying to add the SDK 16 to my project.
I've already made sure to download the SDK using the SDK manager. These SDKs are added to the Android Studio.app's sdk folder automatically.
I opened the Project Structure window, clicked "SDKs" under Platform Settings, and I currently see JDK 1.7 and Google APIs 2.3.3 shown. I click the + sign above that list to add a new SDK. I then navigate to the sdk directory that has android-16, as shown in the screenshot below. I am not quite sure what this wants me to add, but I've highlighted the android-16 folder (about the only thing I can select), and when I click "Choose," the window disappears, but no new SDK appears in the SDK list.
And here is a screenshot of my SDK Manager view, showing the installed SDKs:
I had opened a ticket also with Google's support, and received the solution. Instead of choosing the sdk/platform/android-16 folder, if you select the top-level "sdk" folder instead, you'll then be asked to choose which SDK you want to add. This worked!
You have to put your SDK's in a given directory or .app directory. You have to do it in finder while you are out of the application i'm assuming, but personally I'd use terminal in Mac instead of doing it in the App itself or finder. According to Google:
On Windows and Mac, the individual tools and other SDK packages are saved within the Android Studio application directory. To access the tools directly, use a terminal to navigate into the application and locate the sdk/ directory. For example:
Windows: \Users\<user>\AppData\Local\Android\android-studio\sdk\
Mac: /Applications/Android\ Studio.app/sdk/
You can change from the "build.gradle" file the line:
compileSdkVersion 18
to the sdk that you want to be used.
I had to restart Android Studio for changing the sdk after installing a new one. Then Android Studio asked me for configuring my SDK and let me do it.
And For linux(ubuntu)
/usr/share/android-studio/data/sdk
Download your sdk file, go to Android studio: File->New->Import Module
I followed almost the same instructions by #Mason G. Zhwiti , but had to instead navigate to this folder to find the SDK:
/Users/{my-username}/Library/Android/sdk
I'm using Android Studio v1.2.2 on Mac OS
For those starting with an existing IDEA installation (IDEA 15 in my case) to which they're adding the Android SDK (and not starting formally speaking with Android Studio), ...
Download (just) the SDK to your filesystem (somewhere convenient to you; it doesn't matter where).
When creating your first project and you get to the Project SDK: bit (or adding the Android SDK ahead of time as you wish), navigate (New) to the root of what you exploded into the filesystem as suggested by some of the other answers here.
At that point you'll get a tiny dialog to confirm with:
Java SDK: 1.7 (e.g.)
Build target: Android 6.0 (e.g.)
You can click OK whereupon you'll see what you did as an option in the Project SDK: drop-down, e.g.:
Android API 23 Platform (java version "1.7.0_67")

Android Studio using existing android sdk

I already have the latest android sdk with all platforms/sources/etc downloaded.
How can i tell Android Studio to use an existing android sdk without moving it to android-studio\sdk\?
Follow this:
Open up your project in Android Studio.
Go to Settings for the Project via F4. Or selecting the Project Root -> Right-Click and then Module Settings.
You will find Project Settings and Module Settings under which you have the option of selecting both your JDK and Android SDKs if you want.
For e.g. under Platform Settings, you will find SDKs and you can simply tap on the green + sign to add your own path to a locally present SDK.
Hope this helps.
Go to Configure > Project Defaults > Project Structure. There is a setting: SDK Location.
Changing that will make AS use the specified SDK (instead of the one it comes with) for all your projects.
How you do it without having to download another 1GB android sdk:
While installing Android Studio, you have an option to install Custom or Standard.
Choose Custom, and then set the location of your android SDK to where your SDK currently resides.
A red message will appear saying that an existing SDK installation was detected and that only outdated and missing plugins will be installed.
:)
In Android Studio
Go to
File -> project Structure into Project Structure
Left -> SDK Location
SDK location select Android SDK location (old version use Press +, add another sdk)

Categories

Resources