Android Rom development (fixing video camera, etc.) - HD2 Android Q&A, Help & Troubleshooting and Genera

First of all, lots of respect to the devs for all the work they have done so far. The last few weeks we've gone from almost nothing to one of the most complete android ports of all windows devices.
Now for the topic: I'm a (beginning) software developer and after a lot of development on the .net framework I started learning java last year, at university.
I was wondering what parts of android are actually written in java. I know that the linux kernel and stuff is written in low-level languages like C(++) or even assembler. On top of that, Android runs a java virtual machine (called drupal if I remember correctly).
Does the built-in software, like for example the standard camera software, run in java, or has it been written in low-level languages to improve speed? If it has been written in Java, can we actually edit that code from the roms that are commonly used?
If so, I think there are a lot of people that could look at stuff like fixing the video camera (by changing the button layout in that mode for example) and other small bugs that occur on higher software levels. I think there are a lot of people that know nothing about kernel development but do know stuff about java (or similar OO-languages like C#) that could help out with stuff like this.
Am I on to something here? Any people that can tell me more about this?

i dont relly know
up up !!

in XTarantula's ROM the Stock Video Camera works with sound.
his build is based on Android 2.1 (Eclair) update 1.
Model Number is Nexus One and is fully stock (even with Stock Launcher, no launcher pro preinstalled.)
its a great build, im just waiting for a Froyo Build with the same features.

hope this will help: http://developer.android.com/guide/topics/ui/ui-events.html

Related

Programming CE, Book and resource recommendations

Hello,
After a decade of not doing C, I find that alot of things have changed when programming c++ native for CE. Even things like:
string somestring;
no longer function. Wow!.
strcpy has been replaced with StringCchCopy. Wow, MS has done a number here... and so on...
Anyhow I searched xda and found allot of good threads. But what if I'm looking at re-learning C++, with a focus on CE programming only? What books and other resources would you recommend, its almost like starting from scratch. I got vs2005 + emu + been reading allot of MSDN, did some basic apps. etc.
BTW: How the .... do you declare a variable length string???
and in VS2005 is running the debugger the only way to get the app to start automatically ???
Thanks
*bump*, anyone?
Couple of notes:
1) I strongly recommend avoiding VS, it is unbearably slow and balky.
2) strcpy and all the other functions are still supported by c runtime on CE (VS 2005 complains about them but you can ignore it). The problem is all windows API on CE use UNICODE so you have to declare strings as WCHAR (thats MS speak for unsigned short) and use wcscpy, and such.
3) The only book I know on CE specifically is this and I only read the two sample chapters online, so can't really recommend it. (Though the sample chapters were very useful). What you need is to get a good book on Win32 programming that will get you well on your way.
4) There is an MFC class CString which wraps up all string related functions very nicely. If you are not using MFC but clean C/C++ the only thing I can think of is malloc and free or the C++ versions new and delete.
Check out the links in my sig if you want to see code examples of small but functioning apps.
I disagree with levenum's comment on VS, but agree at the same time (weird I know). I wouldn't use VS for native development because it has A LOT of extra features that I think would be useless for native developers. Also, the lighter eVC++ has pretty much everything you need to write native apps.
I had this book called "Programming Windows CE 3.0" or something along those lines a few years ago. I got it for like $3 on Amazon. If you can find an updated version of that (or even the old version would be useful) then you should buy it. It will show you all you need to know to get started. You can learn the new api's from browsing msdn.
If you're only a little rusty with C/C++ I would suggest jumping right in to the Sdk samples and seeing how they do things.
Thanks, the reason why I wanted to use VS is so that maybe later I wouldn't mind going into MFC. So having one platform would be nice.
So far I have done some basic things, like drawing, etc, but I find I'm having a harder time making strings and including the api's to work. Almost all of the msdn examples fail to compile properly.
I have an old book MFC for Windows 95 by MS, is it even worth looking at ?
robp said:
I disagree with levenum's comment on VS, but agree at the same time (weird I know). I wouldn't use VS for native development because it has A LOT of extra features that I think would be useless for native developers. Also, the lighter eVC++ has pretty much everything you need to write native apps.
I had this book called "Programming Windows CE 3.0" or something along those lines a few years ago. I got it for like $3 on Amazon. If you can find an updated version of that (or even the old version would be useful) then you should buy it. It will show you all you need to know to get started. You can learn the new api's from browsing msdn.
If you're only a little rusty with C/C++ I would suggest jumping right in to the Sdk samples and seeing how they do things.
Click to expand...
Click to collapse
could you provide some links for msdn. also i know how to program in c but how do i compile a program for windows ce could you recommend a free one. thanks
The only way to code for Windows Mobile for free is to use embedded Visual C++. You'll have to google it to find a link.
Once you have that downloaded, check out:
http://msdn2.microsoft.com/en-us/library/bb158662.aspx
The new solution files most probably won't open in eVC++ but you can create new projects and add the source files yourself.
You'll want to look at the samples in the Win32 folder.
robp said:
The only way to code for Windows Mobile for free is to use embedded Visual C++.
Click to expand...
Click to collapse
That's not entirely true - there's still ceGCC (it works on linux or windows using cygwin) - however this one lacks resource (window, forms, etc) editor (but if you have resources already created it will compile/link properly). But it works great with apps where you want to handle all the graphics and user interaction by yourself (like games, or programs with 100% custom UI), for example using SDL, pocketHAL, etc.
Also, wxWidgets seems to have support for windowsCE, and might be made to work with ceGCC, but i haven't tested it yet.
Sorry, I actually meant to put "(I think)" after that sentence lol.
Actually I think you should be able to use any C++ compiler as long as you have the necessary libraries, and I think all the libs you need are in the sdk download. But the easiest route for beginners in native coding is probably eVC++
Well, now i can agree with you
That is, unless you want to create games - in that case ceGCC+XFlib might be a good way to go for someone with general programming knowledge, but not familiar with winCE-specific coding. Some games coded with it (and their sources) can be found on XFlib homepage: www.xflib.net.
thanks for the info
Ok, as I wouldn't mind at a later time going into MFC, and building dll's for mobile. How much "harder" would it be for me to learn VS2005 native for ce instead of using evc++ ?
Just trying to weight the cons and the pros. BTW where can I get eVC ?
Thank you.
Two more free options: PellesC and Lazarus + WinCE add-on
I don't think it would much harder. Once you get the hang of it you'll find that it makes life much easier. If you buy a boxed retail version it comes with a nice book that will take you from n00b to master in a few hours (not really but it's still a great reference).
I think the hardest part of upgrading to newer versions of VS is learning the new project file setup. Atleast that's what it looks like from watching other students at my school go from VS6.0 to VS2k5 and 2k8.
Also, I should note that I prefer VS2008 hands-down, but I don't disagree with other people who say eVC++ is faster. While I haven't done any real native development since eVC++ 4 was new, I still dabble a bit (especially since getting active on this forum) and VS2005 works great to me.
So, my advice would be to use the newest tools available to you, unless money is an issue. But don't be worried about upgrading. Your life will only get easier once you do.
robp said:
Also, I should note that I prefer VS2008 hands-down, but I don't disagree with other people who say eVC++ is faster. While I haven't done any real native development since eVC++ 4 was new, I still dabble a bit (especially since getting active on this forum) and VS2005 works great to me.
So, my advice would be to use the newest tools available to you, unless money is an issue. But don't be worried about upgrading. Your life will only get easier once you do.
Click to expand...
Click to collapse
Well I just got eVC and will give it a try too. But I am pretty much used to vs2005. I do not think I can't afford the vs2008 right now. How much difference is there between 2005 and 2008 when it comes to programming for WM?
I'm looking to create some commercial applications for WM. For the last 10 years I'v been doing .com apps, now I figured I would do some for the mobile platform. We have all the graphics/design/marketing guys for .com, so it should work out just fine for WM.
One thing we noticed when working with exec type people is their frustration, I see exactly how we can help them resolve their frustration with WM, Symb, and java type phones...
Thanks
marek101 said:
Well I just got eVC and will give it a try too. But I am pretty much used to vs2005. I do not think I can't afford the vs2008 right now. How much difference is there between 2005 and 2008 when it comes to programming for WM?
I'm looking to create some commercial applications for WM. For the last 10 years I'v been doing .com apps, now I figured I would do some for the mobile platform. We have all the graphics/design/marketing guys for .com, so it should work out just fine for WM.
One thing we noticed when working with exec type people is their frustration, I see exactly how we can help them resolve their frustration with WM, Symb, and java type phones...
Thanks
Click to expand...
Click to collapse
Honestly I wouldn't rush to upgrade. VS2008 is better, but doesn't add much to the WM development arena.
And if you already have VS2005 and are used to it, I would stick with that and forget about eVC++. You should give the compact framework a try. I promise you'll love it
compact framework, that's a part of the .NET isn't it?.
For the time being, for learning purposes, I think I will stick with the native for now. Once I get a grip, I will explore .net. The thing is I really don't like bulky apps for WM. Most of the apps I came across that required the .net framework were slow, any apps that use the .net with a today plug in seem to really slow down my phone.
BTW is HTC Home plug in written with the .net?
Thanks
marek, it seems to me that you are under the impression that you need VS 2005 to use MFC.
eVC fully supports MFC as well as creating DLLs and MFC DLLs.
It admit the reason I don't like VS is because I only write in native and don't like .NET languages a lot.
Since you want to create commercial apps you should note that any app created with WM 5 SKD will not be backwards compatible with WM 2003 which reduces your clients range.
You should compile with WM 2003 SDK which is forward compatible.
Our primary target audience would be WM6. We will make every effort to make WM5 compatible apps. Yes it does reduces significantly the client base, but also there are many positives...
We are still looking for more programmers for the simple concepts we have developed. I believe this will work out just fine. Having WM5 support is a "would be nice" but not required. WM5 has a bag of problems, 2003 I don't even want to touch it.
Thanks
I have to admit that I love VS because I love using .net
But VS is also a much more powerful editor in general than eVC is. It's still nice but the experience isn't as smooth as it is in newer versions, which is expected since the newer versions build on the previous ones.

Jython in Android?

Hey Folks,
I was wondering if anyone knew if it was possible to use Jython instead of plane Java for android development? I don't know much about Java development but I'm with Python. I was figuring that this might ease me into it better. Any thoughts?
Thanks,
-=GB=-
Have you had a look at the Android scripting environment?
http://code.google.com/p/android-scripting/
http://google-opensource.blogspot.com/2009/06/introducing-android-scripting.html
http://code.google.com/p/android-scripting/wiki/PythonAndroidAPI
Regards,
Akshay
Thanks aksd,
I don't know how I didn't find that before. Perhaps I should have just searched for Python and Android as opposed to just Jython and androind.
Anyway, this is very cool for prototyping and simple scripting. However, the main thing I was hoping for was writing apps in Python (via Jython) that could then be distributed on the Marketplace. It's kind of to bad. It doesn't look like anyone is really trying to port Jython to Android because ASE is sort of Google's official response to the whole thing. On the whole, a really great thing for people who just want to script Android but not really for App development.
In all of this searching I did find some interesting information about how to link in C libs so you could code some of the hardcore speed sucking elements in C (like a game engine) and then make calls into it via Java. I didn't know that was even possible so... Pretty cool stuff.
Hey ngrava,
I'm not much into scripts, so dont really follow whats happening with scripting and Android.
If you wanted a bit of a performance gain you can use the NDK and call the JNI to execute native libraries or code. been there for awhile but few use them. Java is just so much easier than C .
Theres a lot of interesting stuff going on on the Android platform, Mono being ported to Android, Scala being ported to Android, I'm actually currently working on profiling the performance of scala code on android.
Regards,
Akshay
On the Google DevFest on Argentina, Google´s ingeneers afirmed that they are working to make more languages availeable on Gingerbread, they specifically mentioned Ruby. We just have to wait to see if this is true and if we are going to be able to ship apps of other languages to the market, and I´m not sure if they will be backwards compatible with earlier versions of android as well.
PD: Oops, sorry for reviving this old post, I just realised i clicked last page instead of next

[ANDROID] So how is it done?

How is Android actually ported to work on the Vogue?
Are you guys literally taking the source code, changing things, compiling & releasing it?
How have you guys learned how to do it?
I'm really interested in helping out and would like to learn more, so any info is great!
Still interested. If any developers could chime in I'd really appreciate it.
Even if you just post a link to some resources I could read.
I googled...I found..
http://www.kandroid.org/android_pdk/index.html
It may be old IDK....Have fun
Thanks!
If anyone has anything else.. please post!
http://cs-alb-pc3.massey.ac.nz/vogue/
^A bit of info about how the project came to be and progressed
Thank you for the reply!
So, when it comes to myn and plemen releasing their builds, what exactly are they doing? Are they getting the source code from Google and completely customizing it, or are they customizing a source that has already been ported for the Vogue? Or... what?
To summarize:
The brunt of the porting effort is in the kernel (the heart of Linux) - a kernel which supports the Vogue hardware needed to be constructed, and the Android-specific extensions added and made to support the hardware. Martin (dzo) did most of the work on that.
Then, there are some core user-space libraries in Android which interface with the hardware and kernel (audio and radio being the big two, with lights, GPS, camera, etc. following). These also needed to be created and updated to support the Vogue hardware. Each time a new Android version comes out, these libraries tend to change and parts need to be rewritten to keep up with Android. A lot of people were and are instrumental in this process.
Then comes the questions you're asking, the "userland" pieces of the build: porters can start from an AOSP (Android Open Source Project) build, which is built ground-up from the released Android sources, a build from another phone (Tattoo, Hero, Droid, etc.), or an SDK emulator build (which is usually not preferred because SDK builds have extra debugging and are missing features for real hardware). To "port" a build, the Vogue libraries are copied in and init scripts and build properties are updated to support the Vogue's screen resolution and hardware initialization. Some porters go an extra mile and unpack, modify, and repack application data to support 320x240 better or to add new themes. For the most part, this is what people like myn and plemen do.
Builds can also be "zipaligned" (package files are aligned to match cache and block boundaries, so they're loaded faster), and image files downsized or removed to enhance speed.

So many question, so little time.

Hello all,
I am new to the Android scene and I wanted to find out if there are any good tutorials on app/rom development, what are the programming languages used, etc... I know learning from scratch is probably a long and bumpy road, but it is something I am interested in. I have already rooted and flashed my phone, good times that was. Thank you all for your help.
Th3Cap3
What's your existing programming experience? You could do worse than check out the anddev forums. App development is principally in Java though you can write parts of apps in C or even assembler.
My existing programming consist of very very very basic python, and some web stuff like HTML and CSS, I would basically have to learn how to program the ones you have mentioned from scratch, I have books for most of those though. I will go check out those forums and see what I can dig up Thanks for the info.
I bookmarked that page thank you, I just got a hold of their Eclipse software and all of their beginner tutorials I can't wait to dive into this stuff.
Me too. I know C, but only have a passing acquaintance with Java & Linux; Android I know even less about, not having encountered it till getting my Hero in February. I'm working my way through Thinking in Java (Eckel) to be followed by Professional Android 2 Application Development (Meier).
Even if your grasp of Python is basic it's still a start - you don't have to struggle again with fundamental procedural programming concepts like conditional execution, program flow control & so forth. Plus Python is an OOP language, aiui (I don't know Python) so you have a head start there too
I've installed Java, Eclipse & Android's SDK on this Windows box, but I'm thinking of dual booting Ubuntu as some things just work better in Linux, especially if one wants to cross compile ROMs. Aiui Cygwin, which I already use, can be a little problematic & when one is likely to be asking for help at times, it's useful to be using a similar set up to most devs.
I have been thinking about dual booting again, I just havent had to time to partition my drive and install some sort of linux release, UBuntu is the one I am most familiar with, which isnt very, but its a start.
I am going through those video tutorials from anddev.org right now, it seems to be similar to Python in the way the coding is done, I am excited.
I have also downloaded the Eclipse program, but I have the pulsar version, it seems to be geared more towards mobile development and I have gotten the Android toolkit installed and I have had the Android SDK from when I rooted my Hero (Which is awesome, running the newest Damage Control) good times.
I think I may have a java book on PDF somewhere as well, I will have to go look.
Atm I can't make up my mind between dual boot & Virtual Box, or maybe both, to see if I can wean myself off m$
I have been thinking about the dual boot option a lot since you mentioned it, not sure what to do, I may wait till this quarters class is over so that if something goes missing. it Sony be a big deal
Sent from my HERO200 using the XDA mobile application powered by Tapatalk

[IDE] Using IntelliJ IDEA for Android development

When starting with Android development most people start so by using Eclipse, so did I. Unfortunately for me this was a quite frustrating experience no matter if I developed on Windows or Linux. I often had troubles launching projects after some changes and was forced to rebuild the whole workspace (which takes a while esp. if you included a couple library projects). So after a while I decided to switch to IDEA which is a lot more satisfying. I never had any issues with broken projects and everything just builds so much faster.
One big difference (and it seems many people have troubles with it) is IDEA's handling of library projects. Unfortunately I think this is done in a very logical way, as each "project" is handled as a model. Means you create a project ("My app"), add a module for your main app project, and add new modules for each library project you would add. For each modules you can set the dependencies and say on which modules it depends.
In the newest version (12) Jetbrains also added an Android UI designer, which was one of the features not available before.
If you are curious you can download and install IDEA from their website, or when you are using Ubuntu you can simply download it from Software center.
http://www.jetbrains.com/idea/
And here's a nice article given a quick introduction:
http://www.itwriting.com/blog/7083-intellij-idea-the-best-ide-for-programming-android.html
IDEA rocks, +1. It makes my little Arch box work like a real PC at times
i use idea too,just feel good
Sent from my Nexus 4
What about the on-the-fly analysis performed by IDEA during development? Does it detect many bugs?
Have you never used this functionality?
Nobody uses this feature of IDEA?
I've only had a brief play with it so far - updated the Android SDK and loaded 1 project from GitHub, but it compiles like lightning compared to Eclipse. Thanks for letting us know about this - it's much appreciated
So how does it handle multi-module projects? The advantage of Eclipse/Qt Creator is you can keep multiple projects open at once plus the plugin integration with Maven and Git.
I briefly tried out IntelliJ a couple months back and immediately stepped away when it failed multi-module requirement for me.
More speed than molasses Eclipse would be nice, though the Windows version runs tolerably on fast i5 and SSD.
If it supports .webp on the UI designer (unlike Eclipse), then I'll be all over it!
IntelliJ IDEA has no workspace concept like Eclipse, but its project can have multiple modules: http://www.jetbrains.com/idea/documentation/migration_faq.html .
I'm a total noob/beginner when it comes to programming - never really been into it. That said, I've recently been giving it a go using Eclipse - creating my own Android app. I've just installed IDEA and find it far better to use then Eclipse. Really loving it actually.
I never got into Eclipse. The only Eclipse project I tried using was IBM's Lotus version of OpenOffice. The thing was huge, bloated with Eclipse libraries.
Netbeans is my preferred IDE (also good for C++ and others) but it, unfortunately, falls short for Android.
Intellij worked first try. Glad to see a forum for this on XDA!
Really happy this gets some attention, I've switched from Eclipse to IDEA a while ago and I can't go back.
IDEA is just so smart and works so nice!
I think the best part of IntelliJ is that when you are programming you do it in one environment, from IntelliJ I can see Jira stories, commit svn/git and everything else I do while programming, without switching to 5 different applications
I hope more and more people will switch to IntelliJ, thanks for this thread!
Isn't anyone here bothered by the slow compile times compared to Eclipse? I'm working on a relatively large project, and each time anything is modified it seems to rebuild from scratch. Eclipse in comparision is able to launch the app with the new changes almost instantly.
I love IntelliJ when it comes to it's editor and project management, but in the end it takes about 20s to get my changes on the screen. I'm probably saving some time not having to bother with corrupted workspaces and such though.
I have been using it for more than a year now, haven't looked back at eclipse again.
One thing that bugs me about all of these options is that they don't work on Android itself. Not a big deal for me yet, but I see it becoming more important as we start to see Android devices with bigger screens and keyboards.
I know that AIDE is a decent IDE that runs on Android, but it only runs on Android and it doesn't compare with Eclipse or IntelliJ (yet).
I heard that the current version of Eclipse (4.2) enables some degree of GUI independence, and the next version (due in June) enforces that. That would be a good step forward, but still mostly a theoretical one.
If JetBrain were to undertake the rather large task of making IntelliJ work on Android, as well as existing desktop platforms, they would certainly get my $.
I wonder - is the new Gradle based build system compatible with Android itself?
I found the new-ish GAE Endpoints service to be quite interesting in that part of the build process (code generation) happens on the server as a service. This strikes me as very Googly and I wonder whether Google will provide Android build as a service sometime in the near to medium future. That would certainly help move us towards a platform independent future, though I guess AIDE has shown that it is not the build system, but the IDE, that is holding us back from developing on Android.
I've been using IntelliJ since just after I started Android development (2+ years ago). I had tried Eclipse before that, and besides the excellent feature set, always found the editor to be lacking in many ways (still no virtual space). So when starting with Android development I just hated it because I had to do it in Eclipse. No offense to the people who use and love it, I'm sure that it is a great IDE, it just does not suit me at all.
When I discovered IntellJ, I immediately felt comfortable within the IDE. This made me enjoy the coding that much more which, to me, beats out any feature that an IDE can ever have. IntelliJ has some shortcomings, but overall I find it an exceptional IDE for Android development. It can be a tad sluggish in large projects, but not to the point of annoyance. It is also insanely stable, and I have NEVER in 2 years of working with it had a single crash - just brilliant.
Also, having been using it over an extended period, I can safely say that they excellent developers at JetBrains have constantly been improving on the Android support within the IDE. Feature wise, I think that IntellJ is definitely almost on par with Eclipse, and they have done this without any official support from Google (as far as I know). If Google would take notice of IntelliJ and provide support (I'm thinking ADT) that would just make it even better - here's hoping.
I would highly recommend anyone attempting android development to give IntellJ a go - the Community Edition is free. Especially developers coming from Visual Studio
Thanks, tried it, but I prefer Eclipse.
I'm a new programmer (now learning), and it seems better for me now.
DubelBoom said:
Thanks, tried it, but I prefer Eclipse.
I'm a new programmer (now learning), and it seems better for me now.
Click to expand...
Click to collapse
I think this is an important point. Try all the options available, and make a choice based on what you prefer.
I'm just glad that at this point Android has at least two very capable IDEs to provide that choice.
I really cant figure out how to get IDEA to see my install of the android SDK. It looks like their setup tutorial assumes default locations for jdk and android-sdk on windows. How do you setup paths if android-sdk is somewhere else? (using a mac)
Also, second link on the first post seems to be dead right now.
truehybridx said:
I really cant figure out how to get IDEA to see my install of the android SDK. It looks like their setup tutorial assumes default locations for jdk and android-sdk on windows. How do you setup paths if android-sdk is somewhere else? (using a mac)
Also, second link on the first post seems to be dead right now.
Click to expand...
Click to collapse
Check my answer here: http://stackoverflow.com/a/16485929/104891 .
I am on my second attempt at using IDEA for Android dev and I am stuck at the same point as last time, and its the only thing that Eclipse has going for it: I want to create a new Android app, min SDK 8, target SDK 17 (or whatever). This is fairly easy in Eclipse and I can go though the wizard for a new project, choose my settings, even the app icon and end up with the bare outline of my app that has the ICS style (ie an ActionBar & Holo theme)... can I hell do this is IDEA. I know that there is something I am/am not doing that is causing this but I have followed tutorials for adding support libs and even had a go at ActionBarSherlock.
I think this is where a lot of users are scared off of IDEA - I think its interface and usability is better than Eclipse, hell, the GUI editor for the layout XML files is better in IDEA than in Eclipse! (Eclipse freaked out on me several times trying to put static, non moving buttons at the bottom of the screen with a vertical scrollview above them, IDEA, sure, no problem!).
If they could sort the basics out, like getting the wizards included and even if they could allow you to add in various other frameworks (ABS, ViewPager etc) then they would have a winner.
On that matter, anyone got a tutorial on setting up a new project in IDEA the same as Eclipse with Holo theme?
Thanks

Categories

Resources