Don't know where to start with Android programming.
18 replies, posted
I know C++ fairly well (classes, general syntax, vectors, pointers etc.) and I wanted to start programming for Android. I've started [url=http://developer.android.com/guide/basics/what-is-android.html]here[/url] but it very quickly branches off into several directions and begins to not make sense, and I can't find a proper guide on there to draw bitmaps to the screen or some kind of "layer" or "canvas". There are a few things but they don't seem to be exactly what I want.
Am I pushing the right melons by trying to learn this way or would my fruits be better picked using another method (learning Java on it's own first)?
You should at least do some basic Java first: flick through a tutorial, read some FAQs/Gotchas.
Then do [URL="http://developer.android.com/guide/tutorials/hello-world.html"]this[/URL] to whet your appetite, and start on [URL="http://developer.android.com/guide/topics/fundamentals.html"]this[/URL] to get a better understanding of the system as a whole. The android docs does have some good documentation on 2D canvases, and a useful example, but you really should have read most of this stuff first.
I've already done the Hello World application, but it felt a little like I wasn't learning anything.
I was thinking of buying this: [url]http://www.amazon.co.uk/gp/product/0321356683/ref=s9_simh_gw_p14_i1?pf_rd_m=A3P5ROKL5A1OLE&pf_rd_s=center-1&pf_rd_r=128JGE7SVNFWQCBZDPC7&pf_rd_t=101&pf_rd_p=467198433&pf_rd_i=468294[/url]
Since the syntax does seem a tad different from C++, and I have the money to buy that book.
Thanks a lot for the links.
Personally, I'm a big fan of O'Reilly books, so if you know another language and want to get started quickly, I would recommend [url]http://www.amazon.co.uk/Java-Nutshell-Desktop-Reference-OReilly/dp/0596007736/ref=sr_1_1?ie=UTF8&s=books&qid=1271800238&sr=1-1[/url]
But it's up to you. Truth be told, I've only started android programming recently: got an HTC Desire on Saturday!
[editline]10:55PM[/editline]
That other book does still seem very good though. It's a moot point!
Thank you very much! Very jealous of your phone, I have a Hero and have had for 3 months now, I love it, but now they release a few more phones that kill the lag with a 1GHz processor! Haha, ah well I can deal with it, I still like my phone very much.
Thanks for the recommendations, I think I'll go with the one you suggested as I already know C++ quite well.
[editline]06:36PM[/editline]
Reading through the second link, it's really helping me to understand actually.
I'm just glad I could help! It's a bit of the nature of technology though: in June, Apple are going to release the new iPhone, that'll probably be a bit faster, and with a bit better screen, and then I'll be jealous of people! At least I don't have to code in Objective-C for mine though :D.
Well the Desire absolutely blows the iPhone out of the water, great choice, definitely. How well does the optical trackball work?
It's not utterly brilliant, but it seems fine. I must admit it does seem pretty much entirely pointless anyway: what with the whole perfectly responsive touchscreen it's got going on.
Haha yeah you're right, though I'm sure there could be some practical uses, I use the ball on my Hero when trying to select small links on the internet.
I've looked over a lot of Java stuff and it seems [b]extremely[/b] similar to C++. I've sort of read a load of it and thought "yeah makes sense".
The syntax of Java is similar, but the detail isn't: for example. There are no pointers, only references. Anything that's not a basic type is a reference (unless it's a capitalized basic type, in which case it too is a reference). There's also no header files. Those are really the main ones I'm aware of. Also, you have to be aware that every class member needs it's data level (ie, private).
Yeah, I've picked up packages, the way classes work and all that Jazz. It's definitely going smooth. I just have one question, I didn't know the best way to look it up on the internet so I'll ask you if that's all right.
In C++, if I wanted to add a message to some data, I would do this:
[code]cout << "The data is: " << data << ".";[/code]
but how do I do that with System.out.println?
I'm about to go to bed, but google for "Java String Formatting".
All right thanks, you're a legend for all the help!
[editline]10:08PM[/editline]
Actually I was looking for concatenation, but thanks, I got it.
[editline]10:14PM[/editline]
You simply use "+" for anyone that wants to know.
Like in C#?
[cpp]
Console.WriteLine("The data is:{0}.",data)
[/cpp]
Or something like that I think.
-SNIP-
Haha, oh wow I must have been tired. I read "Android" as "Arduino".
[QUOTE=benjgvps;21495644][url]http://www.lulu.com/product/paperback/arduino-programming-notebook/3524026[/url]
This got me started, really nicely written.[/QUOTE]
Thanks but I thought Arduino boards were C++, and I already know C++.
[editline]04:50PM[/editline]
[QUOTE=Chad Mobile;21490620]Like in C#?
[cpp]
Console.WriteLine("The data is:{0}.",data)
[/cpp]
Or something like that I think.[/QUOTE]
Nah I meant concatenation:
[code]public int number1 = 1;
System.out.println("This sentence " + "is broken u" + "p in the code, " + "but put back together again as a resu" + "lt of string concatenation." + " Also, number1 = " + number1);[/code]
Etc.
Well I've learned Java to an extent that now feels sufficient, where was that "good tutorial" on Canvas drawing? If you're talking about [url=http://developer.android.com/guide/topics/graphics/index.html#draw-with-canvas]this[/url], then I can't quite get it. It feels really vague.
[QUOTE=nos217;21696614]Well I've learned Java to an extent that now feels sufficient, where was that "good tutorial" on Canvas drawing? If you're talking about [url=http://developer.android.com/guide/topics/graphics/index.html#draw-with-canvas]this[/url], then I can't quite get it. It feels really vague.[/QUOTE]
Use the the examples which come with it: the lunar lander one in particular seems to be good.
Sure, thanks.
Sorry, you need to Log In to post a reply to this thread.