I would like to make Shift+F1 (show external documentation) work.
I am aware of this question:
How can I make IntelliJ/Android Studio open Android docs when clicking F1 on function?
But my project structure is entierly different (ie. Libraries section is missing!)
How can I set up external documentation location in Android Studio 1.1.0?
Ie. for Android Support Library, Google Play Services, etc.
EDIT:
The external doc for the Android SDK is already working, but I can't for example change it to an online version, and I can't set it for Play Services and Support Library at all
Repeating the comment from above as an answer, as requested:
Unfortunately, Android Studio has manipulated the IntelliJ settings IDE, so you cannot provide an external link in the UI to documentation. Normally the module settings (or Project Structure) would have the ability to look at all libraries and configure where to find external docs. If you are feeling brave, you could try manually by going to ~/.idea/libraries and edit play_services_x_y_z.xml (x, y and z are the version numbers you are using.) Look for the <JAVADOC /> tag. Modify it to be <JAVADOC> and add a sub tag <root url="put_your_external_url_here" /> then close the javadoc tag.
You should be able to create a custom gradle task to inject the appropriate XML if the file ever changes so it prevents issues on gradle sync. But, it would be some work. It's really a function of how IntelliJ handles maven dependencies from within Gradle and the setup of its projects rather than it being gradle's fault, so I don't think there's any special gradle setting to make it work.
Go into your Android SDK (Tools -> Android -> SDK Manager) and make sure the "Documentation for Android SDK" is installed for the target version of Android you are building against (see the Android 5.1 (API 22) section):
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
I developed an Android app with Android Studio and I want now to create a SDK to enable other developer to use the technology I created. This SDK should use an activity and a couple of background service.
I've looked around on internet and on SO, but I did not manage to find the basic information I need :
How to set Android Studio to build a SDK , not an APK;
Is there any security to implement so that my code is not readable by others?
I created an app but I have no basic knowledge on building SDK, so any information or link where I can learn would be appreciated.
According to me what you require is a .aar file. Just like you give out Java sdk's as a jar, you can package your Android code as a .aar file. This can be imported in any other Android project and your exposed API's / screens can be used directly.
To create an aar select your module in Android studio project structure- then on the right pane select gradle and then select generate .aar file. This will be generated in your build/outputs folder.
Now this can be added in any project and compiled by putting a dependency in the gradle. You can Google "creating an aar" for more information.
I've downloaded the source code of android widget "TextView".
I included some other packages, but Eclipse can't find them.
I've checked android source again and they exist there.
import android.content.UndoManager;
import android.text.GraphicsOperations;
import android.content.res.CompatibilityInfo;
So why doesn't Eclipse them? In source code they are also public.
I'm using Android 4.4.2.
If you are trying to build something that is part of AOSP and import it into eclipse, then you need to let eclipse know what those other packages are. Based on android, eclipse only knows about packages that are part of the SDK. This does not include all packages that are part of android.
If you look through the AOSP files, you will find methods and variables that are hidden. Some classes are simply not included in the SDK. Other packages are considered to be "internal" and thus you can not access them easily (infact, if a package is internal eclipse has a line that will specifically block all packages from being imported).
Most likely, you have not updated your build path to include an updated framework.jar file. There are quite a few resources available for these tasks. This answer here: How do I build the Android SDK with hidden and internal APIs available? will give you a quick rundown on how to get a framework.jar file simply if you are building aosp.
If you aren't building AOSP, I suggest you check out this guide here on using hidden and internal parts of the API. From a quick glance, it doesn't look like any of those packages are internal, so you should be fine by just importing the framework jar which contains all the classes and hidden methods.
Good luck!
Just a little list of quick fixes:
try right click on your android-project -> Android Tools -> Fix Project Properties
right click on your android-project -> Android Tools -> Add Support Library...
is your SDK up-to-date? You can check this in your SDK Manager
last thing: go on Project -> make sure that Build Automatically is checked and then do Clean...
as the following picture shows, the source of ListView is not included by the sdk, so how to get the source for this class?
then i may debug into the code of Listview.
Edit1: i am using sdk 2.2, it don't have a module named source code, only android 4.x have such module:(
Type android into your console to open the Android SDK Manager. Expand the Android version you would like to use, mark the Sources for Android SDK checkbox and hit Install. That's everything, you need to do. You will find the sources afterwards in <SDK_PATH>/sources/android-XX. You IDE should now be able to debug into the code (at least NetBeans does).
Edit (for 2.2)
I guess if you really want the sources for 2.2, you will need to checkout the whole android project and switch to the required tag. (Get a list of all tags with git tag -l) You could copy that code to the above mentioned folder, and see if your IDE detects it there.
I have been trying to work with a Library Project, just like it's mentioned in the documentation :
http://developer.android.com/guide/developing/eclipse-adt.html
I have created my Library Project as a Android 1.6 Project and now I have been trying to reference to it out of my second project (also an Android 1.6 project) and I am getting the following error :
"Target 'Android 1.6' does not support building project with libraries."
"ERROR: Unknown option '--auto-add-overlay'"
The documentation states that supported platfroms are the 1.5 onwards (with exception for the 2.0 & 2.0.1) and that the second project should have the same platform or higher (in my case the same)...
So any idea what's ahppening here ? And most importantly : any idea how to solve this ?
Thx in advance !
How is the library project compiled as? is it a jar file? And in eclipse, did you add it in Eclipse as "Project Name" -> Right click -> Configure build path -> Libraries. Click on Add External jars and add your jar file.
First of all to reiterate what was said in the previous comment..
A "Library Project" in Android terms is not just a dependent project or an external jar. It is an Android concept introduced by the Android team see below...
http://developer.android.com/guide/developing/eclipse-adt.html
Tiger, have you found a workaround to this yet?
I'm having exactly the same issue and after battling with this for a while now I'm pretty sure it's a bug (but this particular bug is quite old and might just look very similar) Have a look at:
http://code.google.com/p/android/issues/detail?id=8498
Yes, it appears that certain SDK levels in Linux aren't supporting the "--auto-add-overlay" option required when using libraries in Eclipse. I've found that 1.6 works find, as does 2.1-update1, but 2.0 fails. I ended up changing my app to rely on 2.1 instead of 2.0 and it worked.