This is just a general question for my information. I know how to create standard Android apps, but I was wondering: How is it possible/how do people enhance Android core functions and dig deeper into the system?
For example:
Let's assume I want to adapt the DownloadManager class, which is used by many apps. So, for example, one can adapt the class so that the download-text, which is displayed in the Notification bar under the download progress, is somehow changed.
Excuse me the following stupid questions, but I have no idea of these advanced topics, that's why I'm asking here ;-)
It is possible to change (for example) the DownloadManager class, so that it has extended functionality which will then be used by 3rd party apps, right?
Can the patched class then be put in the Play Store for other people to download/extend their DownloadManager functionality?
Will people need Root to be able to install such a change?
At most important: How can someone alter an Android API class? I'm really a noob here: I don't know where to get the source-code from, how to replace the standard with the enhanced class, what's needed for that, etc. Is there even a tutorial on advanced topics like this?
Please enlighten me a little bit :-)
is possible to change (for example) the DownloadManager class, so that
it has extended functionality which will then be used by 3rd party
apps.
Yes, of course, Android source code is opened under Apache license, you can modify this source code, and public into the world. For some detail about DownloadManager class and many other class, in Android OS Structure, those class is programmed on upper layer, often totally in Java.
Can the patched class then be put in the Play Store for other people
to download/extend their DownloadManager functionality?
I don't understand your question so much. In Play Store (and another android app store), people upload their application (in funny sentence, upload the source code has been compiled), so how can you upload a source code for user extends their apps ?
You can public your source code to github, or another place that programmers often meet, so they can view your source code, and often give you valuable ideas and comments :)
Will people need Root to be able to install such a change?
if advanced user, they can install new Android OS for their device. But I think, this answer is further than you really need.
Where to get the source-code from, how to replace the standard with the
enhanced class, what's needed for that, etc. Is there even a tutorial
on advanced topics like this?
In Android SDK folder, there is a folder named "Source", you can go there and see many Android source code. You can take that, read, and modify what you want. some part of Android is not here, you should google for this, it easy to find on internet.
But you should remember, when you modified this class or that class, it not belong to Android OS again, you must import this class file to your project as normal class.
So, if you want to modify base Android APIs : those APIs often write all in Java, and you read them and understand carefully, modified some part if you want, and import this class into your project.
And last word, why you should do that :) Because you can extends the class you want, and put some additional features for this class. It's easier and nicer.
Hope this help :)
I'm developing some Android application, and I need to look at source code of some Android class. I have tried to use Android Source tool (installed as Eclipse extension), but I can't still use "Open Declaration" for Android class, therefore I need to use alternative ways . Please, suggest me, can I open code for some class on-line or download sources? Thank you in advance.
Here is the link, which provides the class code with respect to their versions :
http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/
I am using android in eclipse . I wanted to see inbuilt classes in android such as 'BaseAdapter' class. Please suggest a method for seeing the content of those classes.
you can download the android source code and link it in eclipse. or the easier way is to use http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/
I am a new developer for android programming. I understand android SDK does not contain all classes from android source code. For example, AtCommandResult.class is missing (hiding) from android.bluetooth package in the SDK.
Sometimes, however, I want to use the hidden code in my app and I wonder what would be the best way to do that. One approach I can think of would be to include its corresponding source code in my project with different package name to avoid conflict with existing core. But problem with this approach would be I have to maintain the code by myself from that point. One or two classes are OK but you know where I am going.
Is there any better way other than bothering google to include the code in the SDK? Thanks in advance.
You may want to use a .AIDL file:
http://developer.android.com/guide/developing/tools/aidl.html
Those can already be used to access for example in Telephony functions.
Code example here:
http://code.google.com/p/auto-answer/source/browse/trunk/src/com/android/internal/telephony/ITelephony.aidl?r=13
I was wondering if there a class diagram available for Android API on the internet? I think it help you to learn and visualize the system in your head.
Here is a great categorized list of classes in the Android API in both PDF and Visio formats, from Troodon Software: http://gyurigrell.com/2011/1/17/great-android-class-diagram-poster
While it's not a class diagram, it is still quite useful. Maybe I'll get around to creating a proper hierarchical class diagram at some point...
This diagram helped me: http://www.adakoda.com/adakoda/2010/01/20/ASPH_AW_REV1.pdf
It may be kinda old, but you could find a Android classes poster here:
http://gyurigrell.com/2011/01/great-android-class-diagram-poster/
Could you not check out the source code ? Any decent IDE can create a class diagram from the source code. That way you will have both the code and the underlying design.
Of course android is available in Git
https://android.googlesource.com