How to open android documentation and samples of code in android studio - android

I have downloaded all documentation with SDK manager help. But how can I open this documentation and the samples of code in Android Studio after downloading?

According to Android Studio Tips and Tricks, you can press Ctrl+Q to show docs for selected API under Windows or F1 under Mac.
For the samples , you can use eclipse to export to Android Studio.

First you need to make sure the documentation is added to Android Studio.
Go to File -> Project Structure. Under the Platform Settings heading, add or select an Android Platform. Go to the Documentation Paths tab and make sure the path to your SDK's documenation folder is added there - it should be [SDK]\docs\reference, where [SDK] is the full path to your SDK installation. If it is not there add it manually.
Once this is done, use Ctrl+F1 while your cursor is on the item you want to display help for.
The samples have not been ported to Android Studio yet, but I'm sure google will get around to it at some point. For now follow the instructions in the comments by androidika (you will need a copy of Eclipse installed).

In Android Studio you need to download javadoc dependency which is part of sdk.
If you enable documentation to appear while writing code in android studio by navigating to
File-> Settings-> Editor-> General-> Other
and
selecting(check box) Show Quick documentation on mouse move, you would get irritating after some time because it will come out automatically you when you would be writing code.
So, I think we should go to alternative ways by using Ctrl + Q(on Ubuntu at least I am not sure of other environments). This way when you would feel help you can simply use the simple command.

I was trying to find this setting in the latest build of android studio, and after wasting a lot of time I finally found out that now the ide automatically finds the documentation, which can be opened with shift+f1 on a method.

Now a days once you Import project in Android studio, it will automatically shows docs. But on mouse hover you want to expand it.
Docs hover page was simply resized very short like the above, it looks like docs is not avail. But when I Carefully moving the mouse down to the bottom of the hover page allowed me to resize it.

Related

Can I use Android Studio's 'Find Useage' for Android SDK Source Code?

One of the most useful functions in AS is right-click and 'Find Useage' or 'See Declaration'. For my code, the 'Find Useage' will show all instances of where a function/object is used.
I have the SDK source code in AS too, but I can't 'Find Useage' on that code. Is there a way to set up my projects so that I can use 'Find Useage' on Android SDK code? For example, I would like to go to android/platform /frameworks/.../Configuration.java, right click on Configuration, and see where that class is being used elsewhere.
Failing that, is there a way to find useages short of grepping around the massive SDK project?
Yes, that is possible. You can configure the scope of the search function.
Move the cursor on the symbol you want to analyse, press Ctrl+Shift+a (search for action) and search for Find Usage Setting or from the menu select Edit -> Find -> Find Usage Setting and select Project and Libraries in the scope section.
If the menu item is grayed out, it's because no symbol has been selected.
Furthermore, if you are looking for a particular feature in AS the search for action function is a huge time saver.
BTW: If Project and Libraries is not available it's because there is no usage of the selected symbol in any library.
May be you are looking for this:
Edit->Find->Find in path...
If you are using Android Platforms Codebase directly from the repo, then you can do it. In this case, you will have to update your dependencies by creating another gradle project in your studio where the platform codebase is and then import that in your project.

Trouble with Visual Studio 2015 and Xamarin (Android Development)

I need some help with the designer of the visual studio/xamarin on the android.
I'm kinda noob with development, but I was hoping to do some examples, but the designer isn't showing up...
The tutorial videos, from the Xamarin itself, only says it need to create a new project and play with the designer, but when I do that, the designer is empty and I can't do nothing...
Here some pictures from what I have and from what I see on videos:
There's a couple things I'm thinking here. It's quite possible that your installation of Xamarin didn't go according to plan. Check your detailed Visual Studio version information in "Help -> About -> Copy Detailed Info".
Additionally, you might also be running on an outdated version of the Android SDK or there might be an issue with your Java config. Ensure you've got the Android SDK installed and updated and that you're using a current version of the Java SDK.
I also see there's a white box showing up on your Designer screen. Does that ever populate with an error? Usually, that will show some info on what exactly is going wrong.
Lastly, you can also check your logs in the following directory for more hints as to what's going on:
%LOCALAPPDATA%\Xamarin\Log
I hope this helps!

Whatever happened to Google Android samples linked in their tutorials?

I seem not to be able to find any of the Google Android samples. For example, I'm reading this: https://developer.android.com/guide/topics/graphics/prop-animation.html#keyframes, and there is a link to a MultiPropertyAnimation sample which should show how to use keyframes. When I click there, it get redirected to a samples main page, and the sample I'm looking for is not there, or at least I can't find it. The same for quit a few other samples. I also tried importing the samples in Android Studio, which provides a search/filtering interface, and can't find anything there.
Has Google moved the samples, and forgotten to update the rest of the docs? Did the 'old' samples get deprecated and moved elsewhere? Can they still be accessed?
The latest (and most convenient way) to do it is:
open android studio
if a project is currently opened, close it (file -> close project)
on the following screen choose "Import an Android code sample".
Also see http://developer.android.com/samples/index.html

How to display the documentation for the support libraries inside Android Studio?

When I use the command 'Quick Documentation' in Android Studio in a class that comes from one of the support libraries (e.g. ActionBarActivity), the IDE does not show the documentation for the class. If I use it on one of the classes from, say, the Android API 19 (e.g. Activity), the IDE displays the complete documentation as is shown in the reference page on https://developer.android.com/reference/packages.html.
Is there any way to add the documentation for the support libraries to Android Studio so that they can be accessed through 'Quick Documentation' as well?
When Android Studio has opened the decompiled jar class, click on "Download..." blue link at top right, this will download jar with javadoc and save it in :
/.ideaLibSources
rebuild project if necessary, now doc is available.
Tested on android studio 2.0 preview 4.
If you are not using Gradle, this will be easier for you.
Go to File -> Project Structure. From there, on the left-hand side, select Libraries. Select the library you want to add source/java-docs to, then click the plus at the bottom and add the source and/or java-doc jars. There's a chance AS will automatically know what's what.
If you're using Gradle, more than likely in Project Structure, you won't see the Libraries tab, and I'm sorry but I don't know how to help from that point. If you use Gradle, AS detects that and takes away "unnecessary" options. Sorry to send you searching again, but I know there's something called a .properties file for jars that tell the source and java-docs, but I haven't implemented it. If I can find the page that told me that information, I'll update this.
EDIT: The answer is here. This should help you out.

Android: Graphical Layout not working - doesn't show anything

My situation is: I once made an android project(2.2 version) but soon needed to format my computer. After formatting, I downloaded eclipse again but when I imported my project, I wasn't able to use the 'graphical layout' menu for xml. It doesn't show me anything like the picture below.
http://img525.imageshack.us/img525/3586/19978552.png
I cleaned the project and updated the Android SDK, however, none of these seemed to work well. What could be causing this?
Try restarting Eclipse. Usually that solves the problem for me when that happens.
Right click on your layout xml file and select Open With -> Android Layout Editor. It will force eclipse to open file in android's layout editor mode
None of above worked for me. what worked for me is:
1- Select a Google APIs Project Build Target rather than one of the Android X.X ones. This setting is in right click on project -> Properties->Android.
2- Make a change in XML and save it. Now switch back to "Graphical Layout" and it will show the layout.
For some, only 2nd step works.
This Question was asked 3 year ago, I am sure that you have get your solution, however i was also facing the same problem but got the solution in eclipse, here it is:-
1)Goto help->AboutEclipse->Installation details.
2)check the version of Android DDMS, Android development tool, Android hierarchy viewer, Android native development tool, Android trace view and tracer for openGl ES in installed software tab.
3)If they have different version than you have to update all of them.
4)Goto help->check for update in eclipse and follow the instruction.
5)Then restart eclipse.
This solve my problem.
The topic seems a little bit cold, but I wanted to add it nonetheless.
I had a similar problem with my layouts recently. When i create a project it automatically creates the layouts in the latest version of Android (eclipse shows it as version 22 of android as of today). But i can't see anything. So i just change the version to, say 18, and it shows ok. Furthermore if i want to change it back to version 22 it throws and exception, saying that a class can't be instantiated. (I am probably missing a class or a library on my system.)
Therefore if you cant see the layout it might be a good idea to switch back to earlier versions for development. cheers.

Categories

Resources