Is it possible to get source code of my Android device? [closed] - android

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have background about android application development and now I want to explore deeper side of the Android.
Because of Android is open source, I want to find my phone's source code, then change some values in code, and after all I can compile and flash the code into the phone and see the changes.
I know there is an android documentation here but it is not clear for me.
So, my question is how can I download the source code of my phone?

You haven't specified your device type so here are some more general ideas:
Basically it is not that simple and depends on your device. Parts of Android are open source, other parts are not. Furthermore, your Android device can have a locked bootloader which won't allow you to install your custom build firmware.
Your link shows you how to download the current Android source code using the repo tool. Usually, Android is not in a single git repo. The repo tool reads from a configuration file the different git repositories, current branches, etc. and clones them for you.
I did Android development for OMAP devices (in the past). OMAP itself is outdated but you can learn alot from the documentation: http://omapedia.org/wiki/Main_Page Furthermore, you can still buy OMAP dev boards and play around with them, build a custom image, patch things, etc.
Building a custom Android for OMAP devices works like this:
Clone Android source code
Clone Linux Kernel
Clone U-Boot bootloader
Build all three and create image files
Flash them on the device
A few words about open source: Many things ar eopen source, but not everything. E.g. GPU driver are closed source. In case of OMAP devices, you can get them precompiled. So if you want to touch something which is not open source, you run into problems.
I hope that helps you and points you a little bit into the right direction.

Related

Tips, tricks, and requirements for editing open source Android apps [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm getting back into Java programming, and I've decided that giving back by working on open source Android apps is a great way to start. I've been running Cyanogenmod nightlies for about a year now, and would like to start with some of the core apps I work with on a daily basis (Camera, gallery, GitHub, StackExchange, the list goes on)
I can find packages on GitHub easily, and I can bring them into Eclipse (Kepler) but I find myself going down a rabbit hole of endless required packages and such, and never actually getting anything to build!
Is there anywhere I can find documentation on starting to edit these things? Tutorials, tips/tricks, required reading for this sort of thing? Is there a master repo somewhere where I can grab all of the code for Cyanogen (I know, this is probably ridiculous) to make sure I have all the imports?
Is there anywhere I can find documentation on starting the edit these things?
Ask the developers of your project(s) of interest. Usually, if they really want contributions, they will have build instructions. The GitHub app does as part of its project README. The newly-released StackExchange app is not open source.
Is there a master repo somewhere where I can grab all of the code for Cyanogen (I know, this is probably ridiculous) to make sure I have all the imports?
CyanogenMod has a wiki which contains lots of project documentation, including a set of pages for how to build CM and so forth. They even have dedicated build guides for how to build from source for various device models. There is also a page describing their GitHub hosting model.
Please bear in mind that many of the apps that came to CyanogenMod from the Android Open Source Project (AOSP) are not Android SDK apps that you can build with an IDE and the SDK alone. Most have many hooks into the rest of the OS and as such need to be built as part of a larger OS build. As such, this is not what I would recommend somebody "getting back into Java programming" to get involved with as their first order of business. The being said, for further assistance in developing for CyanogenMod, contact their community through their various channels.

What tools and guide a beginner need to build a custom ROM for any device? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I've searched it over on Google but not get any satisfied thread over XDA or anywhere else.
I'm a beginner and want to build my own custom ROM's at least for my device which I have own. I have little knowledge in C# so I think I can get understand the JAVA but not quite sure
So here is my question What tools and guide I need to follow for make own custom ROM's. Also If its possible I want to get them all for offline use as my bandwidth is very slow and I'm much depend on my friend to download the big contents. Any guide with detail would be appreciated.
It varies. The easiest way to get started is download someone elses ROM and start by UNzipping it and extracting resources and playing with them. By doing this, you can start to modify resources. Then, as you want to modify certain aspects I would encourage you to look at particular tools.
The XDA university is a great place to get started. Here's a list of common things ROMs add and what you might consider (many of these items have open source variants you can port and modify to get familiar)
Custom kernels
Developer starter guide
Thememing APKs
As you're wishing to modify an existing ROM, I'd recommend you grab a toolset like dsixda's Android Kitchen, which simplifies everyday-tasks like deodexing, extracting stuff from existing roms, etc. Also, if you have it you have most of the tools needed downloaded already, just look into the tools folder.
The only other Tool I'd recommend for getting started is apktool, which is capable of giving you low-level access on deodexed apk files. Note: If you have the source code of everything, you don't need this. However most stock roms are not completely open-sourced, so you need such tools to (manually) apply patches.
Both tools are no IDEs, and you can use any IDE to edit the stuff. However I doubt you can get a solid base without using some command-line tools ;) - if you only wish to change some ressources I guess there are easier ways.

Haskell interpreter on Android? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Is there a Haskell interpreter (with standard libraries) that can be installed on Android?
So that someone with an Android device can do some Haskell exercises on an Android device: write and run some example code in Haskell.
Hugs is written in C and quite portable. It should be possible to port it to Android.
Taking a note from imz, all you need is
ConnectBot or similar
A remote machine with
Vim, Emacs, or similar
runghc / ghci / hugs / yourfavoritehaskellinterpreterorcompiler
It's not as solid as a dedicated app or scripting layer would be, but honestly, for your use cases, it would provide almost exactly the same functionality as those options (if not more). And it would be just as "mobile" as a website (depends only on the uptime of the host and the connectivity of the client).
You can use tryhaskell.org from your mobile browser. It will accept any valid expression, but keep in mind that defining your own data types won't be possible.
For some negative information, all the work I've seen for GHC on Android (such as http://ipwnstudios.com/) is based on cross-compilation, rather than building GHC for android or ARM.
I just found IDEone in the Android Market, which sends your code to an online service. It works, but programming on Android isn't much fun. Btw: In case you don't want to register see BugMeNot
Surprisingly, I couldn't uncover any existing Haskell interpreter for Android.
But here are some instructions for writing your own interpreter for the Scripting Layer on Android. That's assuming you're willing to try mapping the haskell functions on top of the Java android ones (which is not a perfect solution, I know). You'll also want to refer to their scripting layer written for Scala, because that's the one that comes closest to Haskell (which is not very close I admit).
Otherwise, there shouldn't be any reason why any of those Haskell implementations couldn't be directly compiled for Android using the NDK. As long as they're written in C, they should work on Android. For C++, that's a little bit more tricky since Android doesn't have all the C++ headers.

why is Linux a base for Android devices [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have 2 questions:
Why did the Android founders choose Linux?
Is Linux the so called middleware in Android?
This seems to hold the answer:
http://android-dls.com/wiki/index.php?title=Android_FAQ#Q:_Why_does_Android_use_the_a_GPL_Linux_kernel.2C_but_libraries_and_user_space_apps_that_are_licensed_more_liberal_open_source.2Ffree_software_licenses.3F
Q: Why does Android use the a GPL Linux kernel, but libraries and user space apps that are licensed more liberal open source/free software licenses?
A: To put it simply - the Linux kernel has wide hardware and industry support, and keeping GPL code in the kernel as much as possible makes a pretty clear line between GPLed stuff and unencumbered stuff, but vendors are somewhat scared of the GPL, so it is avoided as much as possible outside the kernel. It seems that currently bluez is about the only userspace code in android which is GPLed. Official reasons for why to use a Linux kernel from a Google IO preso:
Great memory and process management
Permissions-based security model
Proven driver model
Support for shared libraries
Itʼs already open source!
For an unofficial explanation of why Google prefers the Apache2 license over the GPL license, please see this ArsTechnica article: http://arstechnica.com/news.ars/post/20071106-why-google-chose-the-apache-software-license-over-gplv2.html
I'm not sure it's possible to give an absolute answer, but the main reason for choosing Linux is probably that it's free and widely supported. Also, there's a very strong Linux community (thus a lot of know-how).
Linux is an operating system kernel, not middleware.
Linux is open source. Android needed to be.
Android uses a Linux kernel. Check out this video and the two others in the series describing Android in more detail: http://developer.android.com/videos/index.html#v=QBGfUs9mQYY
Linux was chosen because it's open and customizable enough to suit Android's needs.
Writing an entire OS is time-intensive and expensive.

Where can I find Android source code online? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Where can I browse the source code for any Android Open Source Project (AOSP) application (for example the Contacts application)? Is the only way to clone the entire source repository for all of AOSP?
Everything is mirrored on omapzoom.org. Some of the code is also mirrored on github.
Contacts is here for example.
Since December 2019, you can use the new official public code search tool for AOSP: cs.android.com. There's also the
Android official source browser (based on Gitiles) has a web view of many of the different parts that make up android. Some of the projects (such as Kernel) have been removed and it now only points you to clonable git repositories.
To get all the code locally, you can use the repo helper program, or you can just clone individual repositories.
And others:
Downloading the Source Tree
2020: The official AOSP code search https://cs.android.com/
You can view the source code through http://developer.android.com, when you're reading the API there will be a link to the matching source code on GitHub, you just need to add the Android SDK Reference Search Plugin on Chrome.
I blogged about it here:
http://blog.blundellapps.com/add-source-code-links-to-android-apis/
I stumbled across Android XRef the other day and found it useful, especially since it is backed by OpenGrok which offers insanely awesome and blindingly fast search.
I've found a way to get only the Contacts application:
git clone https://android.googlesource.com/platform/packages/apps/Contacts
which is good enough for me for now, but doesn't answer the question of browsing the code on the web.
You can browse Android SDK samples from your smartphone using "Code Search":
https://market.android.com/details?id=sqwady.codesearch
This eclipse plugin allows for inline source viewing and even stepping inside the Android source code:
http://code.google.com/p/adt-addons/
(edit: specifically the "Android Sources" plugin: http://adt-addons.googlecode.com/svn/trunk/source/com.android.ide.eclipse.source.update/)
gitweb will allow you to browse through the code (and changes) via a browser.
http://git.or.cz/gitwiki/Gitweb
(Don't know if someone has already setup a public gitweb for Android, but it's probably not too hard.)

Categories

Resources