Professional Android 2 Application Development
All
Stack Overflow 8
This Year
Stack Overflow 2
This Month
Stack Overflow 1
first of all, if your
doGet()
anddoPost()
do the same thing, you can call one from the other, sending therequest
andresponse
Second, you can pass an
ArrayList<E>
to the android app. Both the Servlet and Android APIs have itedit: You need to read from a InputStream, generated by a HttpURLConnection object. http://developer.android.com/reference/java/io/InputStream.html
check out this book: used book http://www.amazon.com/Professional-Android-Application-Development-Programmer/dp/0470565527)
String input = getString(R.string.input);
try {
URL url = new URL(input);
URLConnection connection = url.openConnection();
HttpURLConnection http = (HttpURLConnection)connection;
int response = http.getResponseCode();
if (response == HttpURLConnection.HTTP_OK) {
InputStream is = http.getInputStream();
//do whatever you want with the stream
}
}
catch (MalformedURLException exception) { }
catch (IOException exception) { }
I'd recommend this book: http://www.amazon.com/Professional-Android-Application-Development-Programmer/dp/0470565527/ref=sr_1_3?s=books&ie=UTF8&qid=1300175470&sr=1-3
It's a very well written book with good examples and it takes a deeper dive into Android development than the regular basic books.
Get Mark Murphy's books, Reto Meier's book, read all of it, and start work. It's going to take you time, but all of what you describe is very possible, you just need to learn, and persist.
http://commonsware.com/
http://www.amazon.com/Professional-Android-Application-Development-Programmer/dp/0470565527
Videos: http://www.google.com/events/io/2010/sessions.html
You say you want to (a) learn something new and (b) make some extra income.
As far as (a) goes, your barriers to entry with Android are probably lower. You can develop on Windows, Linux, or Mac; the sdk is free, and there are no charges. Android development is usually done in Java, which is not that different to the c# you already know. So, I'd say get Reto Maier's book and give Android a try. At some point you'll need an Android phone, but you can get some way using the emulator. You won't have to buy a mac or pay for a developer licence.
Once you're familiar with developing for a mobile platform you'll have a better idea of what it takes to build apps that other people will want to use, and maybe even pay for. At that point you can evaluate the platforms from the point-of-view of (b) and decide which one to pursue. If you end-up buying a mac and paying for a development licence then at least you'll be making an informed decision. But get some experience first.
Like you, I'm a c# dev. I've done some Android development for my own amusement, and (for what its worth) my personal opinion is that its a superior platform in comparison to the iphone because it is more open (technologically and commercially). I believe Android will fairly soon either achieve partity with, or even overtake, the iphone.
Try Android, get some mobile experience, then decide.
If you are just looking for a sample, the publishers of Professional Android 2 Application Development have all their example code available for download and there is a compass application in chapter 14.
You need the following
You also need to install the Android ADT on Eclipse , here are the steps:
You can follow the install procedure from the Android SDK page above or from a brief tutorial I wrote at DroolJunkie
Update : You may also use the following screen casts to help with installation (Source/Credits)
As for how to learn to develop on Android you can start by reading artilces and tutorials on developer.android.com and using Stackoverflow and Google. There are also a few good books available. Here are 3 I like:
Pick up a book such as Hello Android. It's an easy read to skim through to pick up the basics of Android. I also bought this book buy Reto Meier.
You can also learn a lot by reading some of the more popular questions on Stackoverflow tagged Android.
Poke around some open source projects. There are some popular ones such as FourSquare that you can look at. Here is a list on Wikipedia.
I also wrote about some of my first experiences on Android here with my open source app.