How to View Android API Code - android

I would like to see the source code for the API in the android platform. For example see what is under android.widget.ImageView.Class. However I get source code not found in eclipse.

You can find ImageView source code here:
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/android/widget/ImageView.java
The project source code is not going to visible in eclipse unless you've got your self a copy of the source. It is not included in the SDK by default.

Here is link for Android source and another link for repository. You need to attach source code for your project to see the source in eclipse.

Source code for all API packages(including their classes and methods) can be found at Android API packages Source code
Main domain/website is: android.googlesource.com
In the first hyperlink, among all the packages mentioned at developer.android.com/reference/packages.html, you will only find source code for those packages that start with name android.

Related

How can I view the source code of BaseDexClassLoader.class in Android studio?

I have downloaded the source code in sdk manager. It's seems like that the source code didn't contains this class.
Here is BaseDexClassLoader.class which I cant see the source code:
and here is normal classes:
So how can I view the source code of classes like BaseDexClassLoader.class in Android Studio? I'm now watching it at androidxref.com but it's not so convenient.
You can browse AOSP source code in https://cs.android.com ("official" AOSP code browser made by google ).
Here's the source code of BaseDexClassLoader.java ( from AOSP master branch ): https://cs.android.com/android/platform/superproject/+/master:libcore/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java;l=1?q=BaseDexClassLoader.java&sq=&ss=android%2Fplatform%2Fsuperproject
If Google decided not to bundle that class in sources of SDK,you can always copy that class manually, and put in in the sources folder, so Android Studio can refer to it

com.android.internal.telephony error

I have been learning "Sim Toolkit" in android. I had imported the sample project from this link.
But this file needs another import of "com.android.internal.telephony.cat". i couldn't find any jar files or libraries. When i tried to import code of packages from this link
Im not able to done it. Help me to fix this friends.
Thanks in advance.
You can't.
It's a hidden library and not part of Android public SDK.
In future, go to this link and search for Android Java packages, method names, etc. If the result returned is not what you searched for, then it's not part of the Android public SDK available to developers.
Or, you can just download the Android source codes via the Android SDK Manager and manually search for what you want.

Where's apjsua?

I'm'trying to use the pjsip lib for android, after reading some sites talking about the topic I still wondering how to use it.
Many examples suggest to start it building the apjsua folder in the downloaded package but I cannot find it in /pjproject-2.1.0/pjsip-apps/src/
I have all the other sources put not apjsua, does this folder have another name since the new version?
Thanks for your reply.
PJSIP has not yet released there Android version, it is only for testing purposes.
You can find the PJSIP projest for android in branches. Here is the link : ​http://svn.pjsip.org/repos/pjproject/branches/projects/android/
So I would suggest you to download the whole pjproject.
You can find the apjsua in pjproject/branches/projects/android/pjsip-apps/src/apjsua
In some versions its name is apjsua and in other versions its pjsua.
Checkout code from below link:
​
http://svn.pjsip.org/repos/pjproject/trunk
After checkout and building it with given commands on PJSIP getting started page, you will find it in following path:
PJSIP_DIR/pjsip_apps/src/pjsua/android/
For confirmation, you can check it by browsing code on following link:
http://trac.pjsip.org/repos/browser

StackView Widget Sample source code

Please provide StackView Widget example source code . http://developer.android.com/resources/samples/StackWidget/index.html redirects to samples link http://developer.android.com/tools/samples/index.html.
The Sample link suggests that the example can be found under "/samples/android-/" folder. But i didn't found any sample under these folders from api level 11 to 16 in my windows 7 PC.
In the App widget section there are frequent references to this sample project but sadly i couldn't find the source. Please help me out.
I found a compressed tgz of the whole branch here:
https://android.googlesource.com/platform/development/+/master/samples/StackWidget
7-zip should be able to unpack tgz
I was missing a few developer demos too, but I finally found them in the SDK (updated to API17) docs subfolder:
\android-sdk\docs\resources\samples\StackWidget
So, actually, you had it all along!!
Update (08/22/13):
On Januari 27tht 2013 The folder mentioned above DID exist, however, after updating to Android 4.2 and 4.3 with ADT 22.05 the folder ...\samples\... has been removed from the SDK and is no longer available.
Fortunately I still have both an untouched version and an eclipse project available. Get in touch if you would like a copy...
its over here if you are still looking for it
http://docs.huihoo.com/android/3.0/resources/samples/StackWidget/
Check Vogella's Github here:
https://github.com/vogellacompany/android-examples/tree/master/com.vogella.android.stackview.activity
You can clone or download from here:
https://github.com/vogellacompany/android-examples.git
You can find stack widget demo under "com.example.android.stackwidget" directory

GETTING LAUNCHER2 SOURCE CODE?

I am trying to get the launcher2 source code, but it says use repo and git.
Does anyone know what to do to do this?
i have tried multiple times!
--
Or if any one has the actual source code i can download from that would also be very helpful!
Try this .
https://android.googlesource.com/platform/packages/apps/Launcher2/+archive/88cf19181afeb76c5c1444703ee402bf827238d9.tar.gz
Its recent updated source code of 4.3 and you can find out all open source project of android from https://android.googlesource.com
You can find the source code here: https://android.googlesource.com/platform/packages/apps/Launcher3
And instructions on how to download it are at http://source.android.com

Categories

Resources