A Question About Android Development... - Android Q&A, Help & Troubleshooting

Hello Everyone,
Just had a simple question, do you all develop/code for Android for on Linux? Is it something of a must? This is just a precursor to my next question. Just wanted to get the general feel of things.

hell_storm2004 said:
Hello Everyone,
Just had a simple question, do you all develop/code for Android for on Linux? Is it something of a must? This is just a precursor to my next question. Just wanted to get the general feel of things.
Click to expand...
Click to collapse
either works. linux is easier but also a matter of opinion.

calisro said:
either works. linux is easier but also a matter of opinion.
Click to expand...
Click to collapse
Ok... I was trying to download the android source code, and when i run the repo command I get this:
fatal: unable to start c:\Users\sm187t\JellyBean\.repo\repo/main.py
fatal: [Errno 8] Exec format error
Till now haven't found anything to solve this. Googled since evening. I have Windows 7, Python 2.7 and running the commands on Git Bash.

I don't think compiling android source or any android Rom source is possible in Windows. You can use a vm and run Linux through that to compile but if possible it is best to do it through Linux itself.
You can develop android apps in Windows using the sdk and an ide such as eclipse.
Sent from my PACman GT-I9100 using xda premium

Hmmm.... interesting! I wonder why the ROM is so rigid that only Linux users can be free to use it. There goes my hope! I have an office laptop cant install Linux and VM. Not allowed. :crying:

Related

Cross compiling for the Nexus One on Linux

Hey All,
I'm curious about compiling a native Linux app for the Nexus One, and wondering what the best way is to go about it in Ubuntu. I found this link for the G1:
http://android-dls.com/wiki/index.php?title=Compiling_for_Android
Since the Snapdragon is also ARM I'm assuming this will work, but is there a decent way to do this on Ubuntu or is my best bet to install Debian in Virtualbox and compile it there?
Thanks,
-Dan
overridex said:
Hey All,
I'm curious about compiling a native Linux app for the Nexus One, and wondering what the best way is to go about it in Ubuntu. I found this link for the G1:
http://android-dls.com/wiki/index.php?title=Compiling_for_Android
Since the Snapdragon is also ARM I'm assuming this will work, but is there a decent way to do this on Ubuntu or is my best bet to install Debian in Virtualbox and compile it there?
Thanks,
-Dan
Click to expand...
Click to collapse
There's a certain amount of vagueness associated with your generalized request.
That said ... ubuntu is sooo very very closely related to debian in the linux fam!
Almost all things described in the link your reference will carry-over/hold-true in ubuntu as they are stated in debian.
But ... the real kicker is the specific app you're trying to compile.
Depending on what the app you want to build depends on ... will determine your overall success. While the reference posted link is insightful, you must understand the need to link against libraries being used. Many of these libraries (at least the basic 'c' ones) you'll find in the AOSP code in android's git repo.
I would suggest taking a look at the "external" projects found in the AOSP code to see how they utilize the makefile setup and build-environment and how they leverage bionic and others to build against.
The way those projects build out, would be essentially what you're looking for .. (I assume) again, I state this without knowing the specific app you have in mind.
Hope that helps.
~enom~
How well would a linux disto made for desktop PCs work with touch screen mouse inputs and no keboard support? (im assuming the Android VK doesnt work when you press on a textbox in a Linux Emulator)
enomther said:
There's a certain amount of vagueness associated with your generalized request.
Click to expand...
Click to collapse
Sorry, I should have been more specific - by Linux native I didn't mean any app in particular, I just meant not a java Android app. I'm really just looking to compile a HelloWorld in C and run it at the shell on the Nexus at this point.
My main concern with the link I posted is that although Ubuntu is based on Debian, Ubuntu does not maintain an ARM version, and the package mentioned in that tutorial is not included in Ubuntu because of this.
So I'm just wondering if anyone has come up with a good solution for compiling for the Nexus in Ubuntu, or if I'm better off installing Debian in a virtual machine.
Thanks,
-Dan
http://android-tricks.blogspot.com/2009/02/hello-world-c-program-on-using-android.html
I think this is more of what I was looking for, I'll build AOSP and try out the agcc script.
-Dan
Another idea: find the Android source wherever Google hides it, I have forgotten, sorry! But they give instructions for setting up a whole ARM cross-compiling environment on x86/x64 Ubuntu, and as I recall, it was really easy, quick and automatic! (so easy, I did it just so I could compile some ARM apps myself, I really didn't need to compile Android, I don't build phones! )
After that, you too should be able to compile your own apps into native ARM binaries.
overridex said:
Sorry, I should have been more specific - by Linux native I didn't mean any app in particular, I just meant not a java Android app. I'm really just looking to compile a HelloWorld in C and run it at the shell on the Nexus at this point.
Click to expand...
Click to collapse
To do this, you need a version of the ARM tools appropriate for your platform and then use them for building a static binary for Linux. You can find such tools at CodeSourcery (http://www.codesourcery.com/sgpp/lite/arm). Given that you sound like you have Ubuntu, then the Linux version from this page, http://www.codesourcery.com/sgpp/lite/arm/portal/[email protected]=lite, would be what you want. The key is to use the --static parm when you build the binary.
From there, just get your binary over onto the target and run it from the command shell.
Remember that static binaries are HUGE. They have to include all library functions linked in.
If you are looking for tiny binaries, look into the NDK and use the BUILD_EXECUTABLE rule for Android.mk.
A few more useful links, but not much that hasn't already been stated in previously referenced links:
http://benno.id.au/blog/2007/11/13/android-native-apps
http://honeypod.blogspot.com/2007/12/dynamically-linked-hello-world-for.html
http://honeypod.blogspot.com/2007/12/initialize-libc-for-android.html

[Q] How to begin developing android ROM

I am new in XDA developer forum. I knew java and android at the immediate level. Now I'm interested in creating my own Android smartphone ROM. After searching in google, I see that there are a thing which is called "Default ROM" released by google. Base on this ROM, different companies created different ROM in their own style such as Sense, Motoblur, TouchWiz, etc.
So where could I download such a default ROM, and how could I begin with ROM developer. It is kind from my if anybody could give me a tutorial.
(Sorry if the question is exist in the forum, because I could not find it)
Thanks a lot.
Best regards,
me too, i have the same question, can someone help? thx
Your best bet is to have a look at compiling the aosp from source which you will need a Linux os for. The android sdk is a good place to start.
zelendel said:
Your best bet is to have a look at compiling the aosp from source which you will need a Linux os for. The android sdk is a good place to start.
Click to expand...
Click to collapse
Also are there no different way but Linux OS?
I still have the Android SDK, but do not know how to begin to custom a ROM via code.
Regards,
detno29 said:
Also are there no different way but Linux OS?
I still have the Android SDK, but do not know how to begin to custom a ROM via code.
Regards,
Click to expand...
Click to collapse
Yes to build android from Google's source you will have to have a Linux os. Either stand alone Linux or a version like ubuntu
zelendel said:
Yes to build android from Google's source you will have to have a Linux os. Either stand alone Linux or a version like ubuntu
Click to expand...
Click to collapse
In your experience, which linux os should i used. I m also a bit confuse because i did not have to much experience with linux...
detno29 said:
In your experience, which linux os should i used. I m also a bit confuse because i did not have to much experience with linux...
Click to expand...
Click to collapse
Me too, trying to learn. Just installed dual boot Ubuntu 10.1 to my comp and trying to figure it out. Big change coming from win7. Ubuntu 11 I couldn't figure out
Sent from my Desire HD using xda premium
One place you can start by checking and has a lot of good info is http://freeyourandroid.com/
I learned how to port from them although I still need to ask questions but it can get you started.
If you just want to get Ubunto going in a virtual machine for now and have NO IDEA take a look at this: http://theunlockr.com/2010/03/26/ho...om-for-android-part-1-setting-up-the-kitchen/
Old release links but Ubunto will update itself

[Q] running OS Ubuntu on Samsung Galaxy S Wifi 4.0 a.k.a Samsung YP-G1CW/XSE

Hello guys, before the question, i am sorry if i am little english. i look some website that running Ubuntu on Android Device.
I am sorry i am new user in this site, so i can't using outside links in this posting, but you will find if you search on google about this.
i have some question about this case:
1. i am using Samsung Galaxy S Wifi 4.0 a.k.a Samsung YP-G1CW/XSE what ubuntu can running on my device?
2. How with OS Windows? what windows can running on my Device? Windows XP may be, or Windows 7..
Please Help me, i need to running other OS on my Android Device.. Thank's Before for your answer
There are two ways to run another OS on your device: chroot and qemu. You can run Ubuntu (or any Linux distribution that supports ARM processors) with little effort using the chroot method. Look up "Ubuntu installer free" in the store and it will walk you through. It may not work on the stock kernel, so make sure you have the kernel from these forums that fits your device.
The only way to run an OS like Windows is by virtualization through qemu, because it doesn't natively support the chip in your Galaxy S Wifi. This method requires a version of qemu compiled for ARM and additional libraries, which I have not gotten to work successfully on this device. (Anyone else?)
So I'd suggest just trying to get Ubuntu running. It won't be very fast or easy to use on a device that small, but it will work.
Sent from my YP-G70
Mevordel said:
There are two ways to run another OS on your device: chroot and qemu. You can run Ubuntu (or any Linux distribution that supports ARM processors) with little effort using the chroot method. Look up "Ubuntu installer free" in the store and it will walk you through. It may not work on the stock kernel, so make sure you have the kernel from these forums that fits your device.
The only way to run an OS like Windows is by virtualization through qemu, because it doesn't natively support the chip in your Galaxy S Wifi. This method requires a version of qemu compiled for ARM and additional libraries, which I have not gotten to work successfully on this device. (Anyone else?)
So I'd suggest just trying to get Ubuntu running. It won't be very fast or easy to use on a device that small, but it will work.
Sent from my YP-G70
Click to expand...
Click to collapse
Thanks Very much for your solution, i will try search, qemu method or chroot methode.. hope i will can do it, because i am new for it. i am not a developer, or programmer. i just want to know more about gad-get
so thanks a lot.

[Q] Is it possible to install Linux Hardware drivers on Android?

Hi guys!
I hope I finally get a decend answere here... seems like german forums are of no use for such kind of questions
Here is my issue:
I got a wacom graphic tablett wich I want to use on my Android Tablet PC. Of course Android hasn't got a working driver for it, so thats why I want to install an opensource linux driver. So my first question is, if this might be possible. The linux driver is made for a 2.6 Kernel which of course is not complete the same as my 2.6 android Kernel, but are they similar enough to at least give it a try?
And I got an other question: A grafic tablett is you know... nothing else as a weird mouse so am I might be able to tell Android that it shoud use a simple mouse driver for the graphic tablett? Because my mouse is running well on it.
So thats it. Any help is appreciated!
Got any news on that? I'm facing a similar issue, but still haven't found an answer.
Doesn't work like that. Android won't know what to do with the driver or the device.
mc.escher said:
Got any news on that? I'm facing a similar issue, but still haven't found an answer.
Click to expand...
Click to collapse
You can't use the same PC drivers, because they are developed for a different platform (i386 or amd64 on PC, ARM on mobile devices).
RoberGalarga said:
You can't use the same PC drivers, because they are developed for a different platform (i386 or amd64 on PC, ARM on mobile devices).
Click to expand...
Click to collapse
063_XOBX said:
Doesn't work like that. Android won't know what to do with the driver or the device.
Click to expand...
Click to collapse
I have the linux drivers for the chipset of my usb-ethernet converter (MCS 7830).
I was thinking about cross compiling them as a module, with the arm compiler that comes with Android NDK, and then give an "insmod" on adb shell. Is it possible? Have you guys ever heard about something like that?
Thank you!
mc.escher said:
I have the linux drivers for the chipset of my usb-ethernet converter (MCS 7830).
I was thinking about cross compiling them as a module, with the arm compiler that comes with Android NDK, and then give an "insmod" on adb shell. Is it possible? Have you guys ever heard about something like that?
Thank you!
Click to expand...
Click to collapse
Try it, but I think it's not easy as that (problems with libs, memory locations or stuff like that).
RoberGalarga said:
Try it, but I think it's not easy as that (problems with libs, memory locations or stuff like that).
Click to expand...
Click to collapse
I actually did it today! Dude, that thing was tough for me, I'm such a noob on compiling custom kernels and stuff like that.
But it's not exactly using a linux driver on an android. I found a custom kernel that had the needed drivers (I'm not sure if those were the same linux drivers, or if they were adapted to android), but they weren't added to the kernel image as default. So, I compiled them as modules. I had to set a few variables on the .config file as "m", some of them weren't even there, and I had to figure out what were missing and paste them out.
Finally, after several hours struggling with compilers, makefiles and .configs, I did an "insmod mii.ko", "insmod usbnet.ko" and "insmod mcs7830.ko" and everything went fine, and now I have my usb-ethernet dongle working on my samsung galaxy s2 i9100.
I'll try to write a tutorial with all the steps I took until I reached success.
mc.escher said:
I actually did it today! Dude, that thing was tough for me, I'm such a noob on compiling custom kernels and stuff like that.
But it's not exactly using a linux driver on an android. I found a custom kernel that had the needed drivers (I'm not sure if those were the same linux drivers, or if they were adapted to android), but they weren't added to the kernel image as default. So, I compiled them as modules. I had to set a few variables on the .config file as "m", some of them weren't even there, and I had to figure out what were missing and paste them out.
Finally, after several hours struggling with compilers, makefiles and .configs, I did an "insmod mii.ko", "insmod usbnet.ko" and "insmod mcs7830.ko" and everything went fine, and now I have my usb-ethernet dongle working on my samsung galaxy s2 i9100.
I'll try to write a tutorial with all the steps I took until I reached success.
Click to expand...
Click to collapse
Dude have you written the tutorial yet?

[Q] Any scope of development on Windows?

can some1 just tell me if developpment has any scope using windows os
can i build cm form source without linux or ubuntu
I have not started on tutorials since most of them advice to use linux or ubuntu
so if there is a way to development on windows can u all tell me, how it is possible
or a tutorial ?
Just so u know my computer has 2gb ram and intel hd graphics
so i cant run emulators
Thnx in advance
 @Hnk1 help
T3snake said:
can some1 just tell me if developpment has any scope using windows os
can i build cm form source without linux or ubuntu
I have not started on tutorials since most of them advice to use linux or ubuntu
so if there is a way to development on windows can u all tell me, how it is possible
or a tutorial ?
Just so u know my computer has 2gb ram and intel hd graphics
so i cant run emulators
Thnx in advance
@Hnk1 help
Click to expand...
Click to collapse
As a beginner, I would suggest you start with windows/Linux mint. Linux/Ubuntu are for more advanced users and thus provide less friendly interface. There might be a dispute which OS is best. For Android, I would suggest LINUX.
Development requires large amount of disk space (up to 200-500gb); very fast PC (8 or more recommended) high end PC (icore 5 but icore7 recommended)
You might be able to start on windows for small projects with your PC but algorithms would take 6-12 hours rather than half an hour on a high end PC. I know many developers using minimal PC to work so it means more time for processes to finish.
For example
UBUNTU might be better because android is developed under linux with java base. So using Windows might need some adjustments while development. Also, Eclipse is preferred for all development for Android.(programme name)
As android is based on linux, using same base/framework is a key advantage. Ubuntu/Linux is that's why preferred so no more adjustments are made and thus its quicker to develop on Linux. This is because of same internal architecture used by Linux/ubuntu and Android.All Android applications use Linux as its base and java libraries for programming. Java and Linux both being open source can easily be synchronized. The simulation on Linux platform is also fast as compared to windows. You can even download some system files patches for Linux if there is any compatibility problem but it is not possible for windows.
Android/Java/Linux are all open sourced(libraries n API)and easier to debug.
Linux mint is more friendly than Ubuntu in comparision in my opinion.
Another advantage of Linux/ubuntu is booting time/quick interface as windows easily gets laggy after some time.
In the end it comes to user preference.It takes a variety of tools to make software, including drawing tools, so the OS is not that important but helpful to have both Linux and Win. You will need code editors and drawing tools.
Hnk1 said:
As a beginner, I would suggest you start with windows/Linux mint. Linux/Ubuntu are for more advanced users and thus provide less friendly interface. There might be a dispute which OS is best. For Android, I would suggest LINUX.
Development requires large amount of disk space (up to 200-500gb); very fast PC (8 or more recommended) high end PC (icore 5 but icore7 recommended)
You might be able to start on windows for small projects with your PC but algorithms would take 6-12 hours rather than half an hour on a high end PC. I know many developers using minimal PC to work so it means more time for processes to finish.
For example
UBUNTU might be better because android is developed under linux with java base. So using Windows might need some adjustments while development. Also, Eclipse is preferred for all development for Android.(programme name)
As android is based on linux, using same base/framework is a key advantage. Ubuntu/Linux is that's why preferred so no more adjustments are made and thus its quicker to develop on Linux. This is because of same internal architecture used by Linux/ubuntu and Android.All Android applications use Linux as its base and java libraries for programming. Java and Linux both being open source can easily be synchronized. The simulation on Linux platform is also fast as compared to windows. You can even download some system files patches for Linux if there is any compatibility problem but it is not possible for windows.
Android/Java/Linux are all open sourced(libraries n API)and easier to debug.
Linux mint is more friendly than Ubuntu in comparision in my opinion.
Another advantage of Linux/ubuntu is booting time/quick interface as windows easily gets laggy after some time.
In the end it comes to user preference.It takes a variety of tools to make software, including drawing tools, so the OS is not that important but helpful to have both Linux and Win. You will need code editors and drawing tools.
Click to expand...
Click to collapse
Yea the emulator for testing didnt even bootup till now
ill just have to postpone advanced development until i get a newer pc
My last Question....
does android kitchen support this device?
or partially supported? or anything close?
T3snake said:
Yea the emulator for testing didnt even bootup till now
ill just have to postpone advanced development until i get a newer pc
My last Question....
does android kitchen support this device?
or partially supported? or anything close?
Click to expand...
Click to collapse
I don't think android kitchen is supported
T3snake said:
can some1 just tell me if developpment has any scope using windows os
can i build cm form source without linux or ubuntu
I have not started on tutorials since most of them advice to use linux or ubuntu
so if there is a way to development on windows can u all tell me, how it is possible
or a tutorial ?
Just so u know my computer has 2gb ram and intel hd graphics
so i cant run emulators
Thnx in advance
@Hnk1 help
Click to expand...
Click to collapse
I hav ubuntu on my laptop... nd I really want cm on our device but my main problem is that my internet is really slow and cm11 source is around 10 gb which might take weeks on my pc...
T3snake said:
can some1 just tell me if developpment has any scope using windows os
can i build cm form source without linux or ubuntu
I have not started on tutorials since most of them advice to use linux or ubuntu
so if there is a way to development on windows can u all tell me, how it is possible
or a tutorial ?
Just so u know my computer has 2gb ram and intel hd graphics
so i cant run emulators
Thnx in advance
@Hnk1 help
Click to expand...
Click to collapse
for developing android apps.. windows works.. and a fair computer will do... unless you plan to develop something huge...
AVD's have problem with low specs on windows.... try emulating with GenyMotion
and unless you have a gpu.. the graphics won't really matter much..
and as far as building android/cm goes.. you need linux or mac os..
you could build on virtual box.. if you had whopping 16 gb of ram..
maybe cygwin works.. but i don;t know...
and it isn't hard to install ubuntu alongside windows.. all you need is a usb drive and a x64 live cd from their website.. and some patience..
ubuntu is just feels out of place for first time windows user... if you used Mac Os.. it' s easy.. the dock and the universal title bar are not hard to get.. after some time you will be more comfortable with ubuntu than windows.. or that was the case for me..
you need processing power of cpu for building... sure you can build on a p4.. but time is a great factor here.. i7 can compile faster than i5.. and it goes like that..
by the way.. i know a guy who built cm on a 4gb ram and intel core duo... took around 7 hours he said..
psych.half said:
i know a guy who built cm on a 4gb ram and intel core duo... took around 7 hours he said..
Click to expand...
Click to collapse
I hav 6gb ram and i7 processor but my internet download speed is jst 60 kbps...
Vortex99 said:
I hav 6gb ram and i7 processor but my internet download speed is jst 60 kbps...
Click to expand...
Click to collapse
buddy you don't need to download the whole 12gb of source code..
if you only plan to build for a specific device... you don't need the all platform codes for arm/ mips/ x86 or prebuilt binaries for mac os and x86 and x64..
you can select only required prebuilts and projects for your current device and current os by creating an xml file with some modifications in
.repo/local_manifests directory.. then you can reduce size of the source code...
and at 60kbps.. let's average that to 55 kb/ps... it would take around... 53 hours
but you can do continue syncing where you left off... kinda like pause and resume... so maybe in a week you will have the source code..
and just make source you sync the frameworks_base at last.. that one repository alone is over 1 gb.. O_O
psych.half said:
buddy you don't need to download the whole 12gb of source code..
if you only plan to build for a specific device... you don't need the all platform codes for arm/ mips/ x86 or prebuilt binaries for mac os and x86 and x64..
you can select only required prebuilts and projects for your current device and current os by creating an xml file with some modifications in
.repo/local_manifests directory.. then you can reduce size of the source code...
and at 60kbps.. let's average that to 55 kb/ps... it would take around... 53 hours
but you can do continue syncing where you left off... kinda like pause and resume... so maybe in a week you will have the source code..
and just make source you sync the frameworks_base at last.. that one repository alone is over 1 gb.. O_O
Click to expand...
Click to collapse
So ur sayin I can pause during the repo sync command... ??
How can I do that... ??
Now I am really getting interested... but I hav exams right now and my laptop hard disk has failed... btw can you give me detailed explanation about building cm from source or atleast post a link to guide. .. I hav seen many guides but all of them are confusing...
Vortex99 said:
So ur sayin I can pause during the repo sync command... ??
How can I do that... ??
Now I am really getting interested... but I hav exams right now and my laptop hard disk has failed... btw can you give me detailed explanation about building cm from source or atleast post a link to guide. .. I hav seen many guides but all of them are confusing...
Click to expand...
Click to collapse
well.. it's not pause.. it's like.. let's say you have already downloaded 16%.. and you stopped it that.. and turn off your pc..
next time you open pc and run repo sync.. it will check if sources have changed.. if not it will continue to sync from there..
it's just matter of copy and pasting commands to set up sources....it is not that hard..
hmmm... how about i set up the build environment for you on your laptop via ssh .. when your laptop is fixed.. pm me for your thoughts on this..
psych.half said:
well.. it's not pause.. it's like.. let's say you have already downloaded 16%.. and you stopped it that.. and turn off your pc..
next time you open pc and run repo sync.. it will check if sources have changed.. if not it will continue to sync from there..
it's just matter of copy and pasting commands to set up sources....it is not that hard..
hmmm... how about i set up the build environment for you on your laptop via ssh .. when your laptop is fixed.. pm me for your thoughts on this..
Click to expand...
Click to collapse
yea sure m gonna let you know about it...

Categories

Resources