[Q] Wanting to tinker with Android - Droid Eris Q&A, Help & Troubleshooting

I've been following threads on here for a few months, and now I think I want to try to learn more about how Android actually works. I'm familiar with IDEs and coding in general(not my strong point), so I think I could pick up some things pretty quickly. Where would you guys recommend I look for learning to code/tweak Android code*?
I kind of want to be able to say I'm running my own cooked up version of Android.
*please ignore this redundant word choice, please.

rougegoat,
There is a fork in the road right at your starting point, strangely enough. You could choose to study Android application development, or you could choose to look at ROM "development". They are almost worlds apart in both nomenclature, toolsets, and skills; and because of the breadth of skills that are needed in both domains, I have no doubt that there are people that are simultaneously geniuses in one of those areas of expertise, and a numb-skull in the other: that's how far apart they are.
The former is all about Java, Android API's, the "SDK", and an IDE such as Eclipse, and emulators and the device bridge; the latter has a distinct "Unix jock" nature to it: Android "NDK", (or CodeSourcery) toolchains, gcc, make, command-line and shell scripting, understanding dynamic linking and execution environments, and use of configuration management tools (git and repo).
When "code" comes up in the former, it's Java; in the latter, ANSI C (or any other native-compiler language, but C is most typical). In the latter case, if you are building source trees from public repositories, (say Cyanogen or AOSP) initially you won't spend any time at all with C - you'll be spending 95% of your time struggling with with the build environment(s) and trying to wrap your head around the mysteries of "git" and "repo" - and also deciphering Unix shell scripts (typically written in the "Bourne" or "Bash" shell dialect) when things go wrong or are poorly documented. And yes, they will go wrong; effectively diagnosing what happened when things go wrong requires solid Unix/Linux skills.
Your question as posed suggests that you are more interested in the OS/ROM side of things than App development; if that is the case I would suggest you:
-brush up or learn from scratch basic Unix/Linux skill sets (they map over to Android almost 1-to-1).
-If you are a Windows user, download VirtualBox, and create a VM with Ubuntu (8.0.4 or 10x); use developer.android.com as a reference for dependencies and setup. Make sure the virtual disk is plenty big: at least 30-40 Gb. Don't attempt to set up a native development enviroment in Windows/cygwin. ( Windows is a great place for the Android SDK and Android App development, but decidedly not for native code development for Android "ROMs"** ).
-Install both the CodeSourcery and the Android "NDK" (Native Development Kit) in your Linux VM, and try and build a smallish, but multi-file C source-code project that uses Makefiles using both of those toolchains. (Sounds easy, right? Wait till you try anything involving the standard I/O library with the NDK).
-Get your simple project code to run correctly on a real phone device.
- Then, download and build an HTC kernel from their (standalone) source tree - try and do it with both toolchains (CodeSourcery and Android NDK) - simply for the experience of setting up the environments correctly.
- Then, learn the basics of dealing with repo, download an Android source tree and compile it - using both toolchains (CodeSourcery and Android NDK)
- After succeeding with the above, try pulling code from someone else's "git" repository and merging it into an Android build tree - and getting it to build correctly.
The above looks like a pretty short list - but it represents many, many hours of effort. Good luck.
bftb0
** There might be folks that take issue with that statement about ROM-building and Windows. They might tell you, "just download so-and-so's kitchen, and start building ROMs", it works fine under Windows." There's nothing wrong with that, especially because it can be satisfying seeing something of your creation actually running on a phone in a short period of time - but you probably won't learn very much, and when things go wrong, you'll be stumped about how to go about fixing things. The difference between a "chef" and a "developer" is that the former merely assembles together pre-built executable programs and libraries - whereas the latter understands not only how to go about building those things when the sources are available, but also has the opportunity to change them.

Lucky for me that I'm a Slackware guy. I'd much rather learn the system then just have a pretty GUI that does it all for me. That's half the fun of it.
Thanks for the advice, I'll have to try that whole bit out and see where it gets me. A weekend project awaits!

Related

[Q] Wine-like iOS emulation?

Hello All,
My question is whether the reverse-engineering of iOS's API is being looked at as an option any time soon. I would be interested in something similar to Wine (Wine Is Not an Emulator), which is a reverse engineering of the Win32API and allows you to run Windows .exe files natively in Linux or Mac OS. I am aware of iEmu (and it's unfortunate suspension).
However, my interest is not in getting iOS itself running on my phone, but instead I would like to run the apps themselves. I'm pretty sure there isn't currently a project on this. If there is, can you inform me of it?
If there is not, I would like to discuss the difficulty of implementing this. I could definitely be an aid in starting a project of ths nature.
Here are some things about iOS's apps I am unfamiliar with (I am aware that this specific section of the post may be more fit for the iOS forum):
Does the Obj-C code compiled for iOS resemble native ARM code (the iPhone chips are ARM to the best of my knowledge), like how C++ would be compiled, or does it resemble something more like C# or Java, compiled into bytecode that is executed by a library?
Compared to the size of the .NET framework or Win32API, how big is the iOS library?
Has a successful program been created that can run Obj-C code?
Would this have to be worked from the ground up (figuring out how Obj-C compiles in the first place), or has there been some effort already mounted similar to this?
I am aware of the extreme difficulty in implementing this. However, I'm sure this was thought while planning Wine or Mono. I'm not even suggesting this be made, but I'm simply asking on your opinion on the general difficulty (can it be done).
Thank you,
- κυριακος
kupiakos42 said:
Hello All,
My question is whether the reverse-engineering of iOS's API is being looked at as an option any time soon. I would be interested in something similar to Wine (Wine Is Not an Emulator), which is a reverse engineering of the Win32API and allows you to run Windows .exe files natively in Linux or Mac OS. I am aware of iEmu (and it's unfortunate suspension).
However, my interest is not in getting iOS itself running on my phone, but instead I would like to run the apps themselves. I'm pretty sure there isn't currently a project on this. If there is, can you inform me of it?
If there is not, I would like to discuss the difficulty of implementing this. I could definitely be an aid in starting a project of ths nature.
Here are some things about iOS's apps I am unfamiliar with (I am aware that this specific section of the post may be more fit for the iOS forum):
Does the Obj-C code compiled for iOS resemble native ARM code (the iPhone chips are ARM to the best of my knowledge), like how C++ would be compiled, or does it resemble something more like C# or Java, compiled into bytecode that is executed by a library?
Compared to the size of the .NET framework or Win32API, how big is the iOS library?
Has a successful program been created that can run Obj-C code?
Would this have to be worked from the ground up (figuring out how Obj-C compiles in the first place), or has there been some effort already mounted similar to this?
I am aware of the extreme difficulty in implementing this. However, I'm sure this was thought while planning Wine or Mono. I'm not even suggesting this be made, but I'm simply asking on your opinion on the general difficulty (can it be done).
Thank you,
- κυριακος
Click to expand...
Click to collapse
Hey and welcome to the forum's I would like to know this as well but I do not know any project and any that gets started and gains popularity gets chased down by Apple's legal team quite quickly. I have my doubts that this could happen (I would be glad if someone could prove me wrong) because iOS and its apps work on 12 devices and Android has hundreds of devices, most with different hardware. Windows apps are built for variable hardware, likewise with Linux and now Mac OS X. Sorry but as much of a pessimist as I seem I do not think it's possible but I'd love to be proven wrong. (Can someone at least make a frigging Windows Mobile runtime)

[Q] Android technical introduction

Hi. I'm about to get my first Android phone, and would naturally like to know more about the OS. I would describe myself as intimately familiar with ordinary GNU/Linux systems, but let's face it, Android is hardly your ordinary such creature. Moreover, there seems to be very few technical introductions to Android around; those I've found tend to be idiotic user's guides (not technical at all) or focused on software development (interesting, but not what I'm looking for right now).
Things I wonder about with Android include:
There's an unusual libc, right? Is the GNU userland around, though?
The file system directory structure. It's hardly LSB-compliant, eh?
The package system. Everything I've come across is centered around the SDK, and hides many of the details of what goes on here. Sub-questions: Is it only "apps" (gah, I hate the word, I'm sorry) that use the package manager, or is everything covered by it, as in a normal Linux system?
The boot loader. Experience with other ARM/non-x86-systems indicate this is a world very different from GRUB, and also a highly varied one.
How do shared libraries fit into the Android ecosystem? Some places I get the impression everything is static. Is that really true?
What's this non-X display system? How do you configure it, etc.?
What's the init system like?
As far as I've understood, the actual phone software (is "baseband" the right terminology?) tends to be proprietary and separate from the OS. How does it fit into all of this? Does the OS execute code at some mysterious memory location? Is some special-purpose hardware run? Is it just a standard process? Is it in kernel-space?
I'm not looking to get these questions answered here. Rather, I'm asking: Are there any documents or books around that try to fill the role of bringing an experienced Linux user with decent development background and technical knowledge into Android?

[Q] Tablet ubuntu able to run edubuntu (kde etc)?

Hi all
Does anyone know if I can run kde-based software on the developer alpha of Ubuntu for tablets yet please? Not expecting reliability, just want to do some child user testing of the edubuntu suite on tablets.
Thanks
Chris
Currently you can't and probably neither in the near futur 'cause you need an X Server for that.
And there is no X server on ubuntu touch.
Huge thanks, that is really useful
Hempe said:
Currently you can't and probably neither in the near futur 'cause you need an X Server for that.
And there is no X server on ubuntu touch.
Click to expand...
Click to collapse
After some research on your reply I've a couple questions. Does it mean the Unity interface doesn't need X-server? Or are they just using a temporary workaround until X-server is implemented?
And does this apply to both Ubuntu for Android, and Ubuntu for tablets?
Huge thanks
Having done some further research I've made my decision - thanks hugely for providing the missing link in my knowledge. What follows is my best interpretation of the rumours.
Currently in place of X-server is SurfaceFlinger, ("because X-server uses 30 yr old code" - Canonical). Canonical publicly dabbled with using Wayland until mid-Feb, then decided to create their own revamped display server from scratch, called Mir, which they seem to have been working on since mid last year, and are trying to get GPU vendors to support, written to run across all devices and to meet the needs of the Unity interface, and written in Qt/QML which is what they want native apps written in.
Bottom line for me, is that the technology is still right up there in the clouds and nowhere near decided enough to base my business strategy on. Also, Ubuntu for tablets seems a pretty thin version of Ubuntu anyway, so Edubuntu was never an option and I'm unlikely to be able to leverage much from Ubuntu's Open Source libraries anyway.
Like others, (see the comment on jonobacon.org below), I find it frustrating that the wealth of code written for Ubuntu is no longer usable, but I reckon this is probably necessary to squeeze the most out of every single CPU cycle and milliamp. Ubuntu for tablet is dead in the water if it kills the battery and performs worse than the established competitors.
Therefore all indications are I need to write for Android, keeping my options as open as possible to migrate. So it is now Titanium/UnityIDE versus HTML5, particularly assessing relative performance.
http://www.omgubuntu.co.uk/2013/03/canonical-announce-custom-display-server-mir-not-wayland-not-x
http://www.jonobacon.org/2013/02/21/five-ubuntu-touch-facts/ -- not the article but the comment starting "In that case, wouldn't it be better to port existing apps instead of...."
http://www.omgubuntu.co.uk/2013/02/canonical-working-on-new-display-server
http://www.phoronix.com/scan.php?page=news_item&px=MTMwOTM
Just to clarify.
1. There are plans to make a X-Mir compatibility layer that will allow you to run programs that require an X-Server to work with mir.
2. Not all is lost at the moment it just looks that way.
Only Graphical Userinterfaces are affected. Your commandline tools and libraries don't need to be changed.
3. If you are looking for platform to write apps for, well there is worke being done to let you run your QML apps (intended for ubuntu touch) on android.
So if you choose to make QML apps they can be or will be able to run on linux, mac, windows and android
Wow, huge thanks, I missed that.
Does this mean EVERYTHING Ubuntu without a GUI will work? I want to run a NodeJS server. How likely is it that it will work perfectly now? How likely is it that it will work perfectly in the (nominally October 2013) release? (Sorry, just give me a keyword and I'll go off and do my research.)
Is Canonical planning to get X-Mir into the next ~Oct release?
My other query was whether QML on Android would perform as well. For others interested, it looks like it works directly with the Android SurfaceFlinger, bypassing the Dalvik VM, so performance should compare with native Java code.
Huge thanks once again
Chris
Sources:
http://www.youtube.com/watch?v=TEkubKZaUt8
http://victorpalau.net/2013/01/25/ubuntu-qml-todo-android-vs-ubuntu/

Coding languages

Hi guys, can anyone explain to me why you can have different coding languages? I am going to try and explain it the best way possible. Pretty much I want to know why some people use other coding languages instead of others? Are some better for particular activities? Like I know cross compatibility like you can't use html to code a game online you need to use Flash or Javascript etc.
tl;d why use one language over another?
Every programming language has advantages and disadvantages. For example Java is portable but slower then, let's say, C++. C++ is less portable and needs to be compiled seperately for every OS but it's faster. Python is very easy and very portable but it's slower then Java. Html, Javascript and Go are for websites. PHP is designed for the use with databases. Prolog uses a completely different approach and is good for logical stuff.
You see, (almost) every language has its own field of application. Additionally, everyone has a favorite language for whatever reasons (e.g. because he thinks the code is pretty). So it's a matter of taste as well.
nikwen said:
Every programming language has advantages and disadvantages. For example Java is portable but slower then, let's say, C++. C++ is less portable and needs to be compiled seperately for every OS but it's faster. Python is very easy and very portable but it's slower then Java. Html, Javascript and Go are for websites. PHP is designed for the use with databases. Prolog uses a completely different approach and is good for logical stuff.
You see, (almost) every language has its own field of application. Additionally, everyone has a favorite language for whatever reasons (e.g. because he thinks the code is pretty). So it's a matter of taste as well.
Click to expand...
Click to collapse
Thanks for the high quality response.
As a beginner, someone who wants to start developing android applications..What coding language do you think I should start with? I understand android is basically Java?
Blakebn2012 said:
Thanks for the high quality response.
As a beginner, someone who wants to start developing android applications..What coding language do you think I should start with? I understand android is basically Java?
Click to expand...
Click to collapse
Well, it's Java with some extra stuff. That's why I would recommend starting with Java. It's portable, object oriented and you'll need it for Android later anyway.
When I learned Java, I used the Head First Java book which I can highly recommend.
Ok thank you very much you have been a great help.
Blakebn2012 said:
Ok thank you very much you have been a great help.
Click to expand...
Click to collapse
You're welcome.
There's different languages for different things, like Java vs. C++ (Java is portable/cross-platform, pure object-oriented, has automatic garbage collection, etc; C++ is platform dependent and needs to be compiled on each environment, wasn't built from the ground up as OO, you need to allocate and manage memory yourself, etc. Java isn't quite as fast/efficient as C++ but it's come a long way from it's beginnings and is pretty close now, for desktop apps IMO anyway.
Then, for web development, there's Python and PHP. Both accomplish the same thing (doing back-end logic for websites, like querying databases so the data can be displayed on the page) but have different syntax. People like either one for different reasons and it's mainly just personal preference when it comes down to those.
So to answer your question, the difference between some languages is pretty great (like assembly and C#) and they're used for different purposes. And the difference between others, like PHP and Python, is for the most part superficial and it's just personal preference between the two.
The main reason we do have programming languages is that working directly on the bare hardware is pretty difficult. Working directly with machine code is difficult in many ways: it is hard to be kept bugfree, even harder to be read and understood, and there is also the problem that it's only working on a specific machine. Programming languages cope with those problems by introducing programming paradigms, which make several things easier, but it turned out that there is no paradigm which covers all needs. C/C++ for instance makes it possible to work pretty close to the machine while producing quite readable code, which can be ported easily from one plattform to another (compared to using assembly language). In contrast Java introduces a Virtual Machine on top of the actual system such that it's even a lot easier run code across several systems (compile it on one machine, run it everywhere ... as long as a JVM is available), and it brings the object oriented paradigm with it. Furthermore there are declarative languages for database programming, functional programming languages or logical programming languages for mathematical problems around, and so on ... . Sometimes you might not be interested in writing understandable portable code, such that assembly language is your best pet, but that's most probably not true in most situations.
123123132
Really good compact responses. I also want to recommend learning some shell programming, i.e. linux terminal programming for file/process management and low-level hardware manipulation in the kernel. Shells are usually mksh, zsh, bash, busybox ash, or symbolically linked to sh. This is known as a scripting language because you can run your programs/scripts on-the-fly without any compiling. Adding some shell scripts to your java app can make it very powerful such as with apps like trickster, synapse, performance control, etc., .. basically any kernel/hardware control apps.
Also you can try Ruby language. Its great for some everyday tasks, very simple and powerful(especially string processing). Also Ruby On Rails is very simple framework for web-developing. A week and you can try to code your own github. And the IRB console is good enough. But i duuno, is there any mobile-app-dev modifications of Ruby. Anyway, its still great enough.
Blakebn2012 said:
Hi guys, can anyone explain to me why you can have different coding languages? I am going to try and explain it the best way possible. Pretty much I want to know why some people use other coding languages instead of others? Are some better for particular activities? Like I know cross compatibility like you can't use html to code a game online you need to use Flash or Javascript etc.
tl;d why use one language over another?
Click to expand...
Click to collapse
That would be perfect, if we lived in a place where only one language is enough for all works XD
However, the really life isn't perfect.
Some works need complicated language to achieve and some don't.

[Q] Developing for the Android, where to begin?

I am toying with the idea of developing for the Android. It's mostly for fun and to see where it goes. I am a programmer, but do not know Java specifically. If i was to learn Java, i would need to learn it from scratch, but for a programmer, not for a newcomer to the programming field.
I downloaded Android Studio and can follow the guides, but i wonder: Is it better to learn Java first and then Android? Or is it better to learn Android first? And regardless of which, is there a level of basic learning that is "enough" to foray into the other. I ask this because it seems that guides for Android expect one to know Java already. Then again, someone told me he learnt how to do Android, and found Java snippets on the web as he went along.
If there is no specific answer, please lend your advice or personal experience. I am very interested in hearing what other have to say about this.
Do both together
Hey there,
I was a bit worse off than you because the only "programming" experience I had was MS Excel formulas but with some effort now feel pretty good about getting even relatively complicated things working in Android. Basically, I would recommend you learn both Java and Android at the same time.
Here's why:
- you need to get the Android Studio tool set up anyway, and it will do a great job showing you syntax issues and recommending changes as you go. In this way you can rely on Android's developer tools to help you learn basic Java.
- the Internet is chock full of sample code for Android. You can use that as a base, deploy it to a device, change it around, deploy it to a device (or emulator) again, and so on. It will give you both hope and eventual confidence when you're able to see the changes you make in Java actually reflected in an app. It makes it more fun too.
- in the end the majority of your time will be learning the Android SDK frameworks, and I was often able to use the Android documentation examples themselves to teach myself both Java and the Android platform's ins and outs.
Dive in and enjoy!

Categories

Resources