How to access Android references within Android Studio - android

My question relates to viewing documentation directly in Android Studio.
For those familiar with Eclipse, I can view all the methods and constructors of a class by clicking on that class and pressing shift and f2. This then takes me to a neat browser within Eclipse that lays out all method signatures and what they do, almost like google docs.
This saves me from having to go to google and search for that classes API each time. For example if I want to view the classes in the "Android.util.log" package, and in turn, the methods in each class, this can easily be done with Eclipse by adding external documentation. For Android Studio, the only way is to go to google and type "Android reference log package" or something, to be taken to https://developer.android.com/reference/android/util/Log.html.
Does something like this exist for Android Studio/InteillJ? If so, could someone please be kind enough to give me steps on how to set it up? I've tried the Ctrl+Q trick but this just gives me a very small overview of a class and not the actual methods within the class.
I also have 2 other questions - and I may get negged for this because I shouldn't ask more than one question in a post - but I feel that these questions are brief and shouldn't need it's own topic. If this poses too much of a problem, feel free to edit this post and I will accept the edit.
I want to create an Android app that makes use of the camera. I know
theres 2 libraries that exist; android.hardware.camera and .camera2,
the latter for API 21 and above. My project is intended to support
API 15 to 24 (and anything newer that is released during
development). Because .camera2 isn't supported by API 15-20, should I
just use .camera throughout my project, or should I target specific API's with different code?
Thirdly, I'm not 100% sure about the concept of targetting various
API levels. If I support API's 15 to 21 and import a library that
say, only supports API 19 and up, and use it in my code, will
Android Studio warn me that this code won't work on any devices
running API 15-18, or will I only find out by testing my code? This saves me from constantly having to look at Android references to see which libraries are supported by which API's.

You can go to the class documentation from Android Studio by Holding down Ctrl key & click on the class name.
For this to work you should have downloaded the Sources for Android SDK in Android SDK Manager. For API levels starting from 15, Sources for Android SDK is available in SDK manager & downloading that will give you the option to view a class documentation.
If you need documentation like in web doc, focus the mouse cursor on the class & press Ctrl+Q which will open a popup & then press Shift+F1 or select View External Documentation icon from popup. You should download Documentation for Android SDK in SDK manager for this to work

Related

android SDK differences

My doubt is about the differences between different SDK's and how they affect our app development?
Let say i created an app with sdk api 22(lollipop) now can it be deployed to Android api 23(Marshmellow)?
And if possible what about the deprecated classes like Http from apache which is present in api 22 but deprecated in api 23?
Do i have to use different build tools to be able to deploy to different Versions?
And also what exactly does it mean to have a class deprecated?
I know this is a huge list of questions (more like whining) but these are a few doubts thats been nagging me for a while.
Thanking for your response!
You can deploy the app you developed with target api 22 to 23 by doing the following,
a. Change the target API to 23 or the latest and then recompile it again and build a new .APK
b. In case of changes like the one happened in M - they added run time permissions, we need to handle those, else there is no purpose you see.
Deprecated - What does "This method is deprecated" mean for application developers this one gives you good insights on deprecated
No, you need not use different builds, you can find out the BUILD on run time and handle. More on that here - How to deal with deprecated classes in Android to keep compatibility
All the best.

Does android 4.2.2 have CacheManager?

My old android project(with sdk 2.2.3) cannot be compiled with sdk 4.2.2, because it seems that 4.2.2 does not have "android.webkit.CacheManager".
So how would I solve it? What can be its replacement?
It seems that CacheManager was deprecated in API level 11, and the following commit in Android 4.2.1_r1 shows that many of its APIs were removed.
A basic implementation of a replacement would be to save the file locally, along with a tag specifying the last used time. Then, after a (certain) period of time, check if the asset is too old and delete it, if true.
This article and this article seem to provide with example implementations. There are also plenty of libraries, as this one.

Is there any tutorial to get feature wise comparision between releases in android

I have developed some application in android 2.2. I have read http://developer.android.com/sdk/android-4.0-highlights.html. But I need to know what are the new features in android 4.0 against 3.0 and 2.2. If there will be any such tutorial which will give details about android features by comparing two old version and latest version, then that will be more easy to remember the feature wise difference between any two releases. Is there any such tutorial which gives version wise comparison between android features.
I don't know of a pre-made API-level comparison (although a change history would include it).
You could always run any of several JAR diff tools, like the one in depfind (details in the user manual section) if you're looking for a summary view. There are a few others, but I'm not as familiar with them.
why don't you just download the code tree, including tags and mount this locally with git/svn/other and use the graphical tools of those csm to explore the code, docs, etc?
I know that it's a bit buggy, but i use eclipse EGIT for that.

How to Build a multi-panel User Interface in Android?

For My Android Application I need to design multi-panel User Interface, Like with android sdk
3.o newest version they provide a new Concept of FRAGMENT but our Android Board is running with sdk 2.3 version, I am Continuously searching to get this fragment thing by any other way , we need to design same fragment like design for Activity with sdk 2.3 API level-8,
I didnt get any way to do this,Like I am using TAB layout but it is from my side ,not much more comfortable.
Please give me some solution to get it
Depending on how soon you need this done, you might want to wait for the fragment SDK to be released by Google. They've said that fragments are fairly easy to package up for inclusion in older versions of Android. They said "soon". Unfortunately, there's really no way to know when "soon" is.

Summary of changes for each API level?

As the title says, are there any sources (web pages etc) of summarised changes at each API level?
I have an app which I've put out to a small group of beta testers and I already fell foul of Context.getExternalFilesDir(), which I hadn't noticed was introduced in API Level 8, when a couple of the guys tried it on Android v2.1 devices.
The majority of my code should be pretty generic but it would be useful if I could find a condensed/summarised list/table or similar that I can quickly glance over.
The Android docs provide a diff between each major API revision. For example, here is the diff between API 10 and 11. Unfortunately, it looks like it's only sequentially available between revisions (not from 8 to 11). I can't find the landing page for the diffs, but you can change the API revision in the URL to see other reports.
You should be running the app yourself on the lowest version of the platform you are supporting. Always. Run it in the emulator. There is no replacement for doing this.
At a glance quick overview: https://developer.android.com/reference/android/os/Build.VERSION_CODES.html (quite well hidden, Google!). Clicking on a particular version will show a more detailed, but still quick overview on what's changed.
Not sure if this is exactly what you're looking for, but I have a look at the the API Overviews when a new version is out. It's a good start to see whats important and new. For example:
Android 2.3:
API Overview
Android 2.2:
API Overview
I also like to take a glance on the Platform Highlights when available.
Here is the analysis of changes performed with the help of the JAPI-CC tool: http://abi-laboratory.pro/java/tracker/timeline/android/

Categories

Resources