
Getting Started with Android Development - falava
http://alexlod.com/2011/11/21/getting-started-with-android/
======
Zigurd
What I would add to this is:

Understand component lifecycle. Understand it well enough to know you have to
design your app around it, because you can't subvert it. Do this first. Do not
write code before you understand this. A good way of understanding this is to
override all the lifecycle methods in Activity and log them, then watch what
happens. Understand that Android can "destroy" both individual component
instances and whole processes. Understand that you can't thwart "destroy" by
holding a reference.

Understand Android's support for a data model in a sql database, abstracted by
ContentProvider, and how to build an observer pattern around this.

Understand Android's support for concurrency, enough that you know the
limitations.

~~~
tseabrooks
When you say "data model" are you talking about object persistence? I was
under the impression android didn't provide built in object persistent.

~~~
Zigurd
That's a great question. If you look at the set of classes that enable you to
build an observer pattern on top of databases in Android - Cursor, Adapter,
and View, you see that you can skip the ORM and POJOS in most cases where you
are simply displaying data, with some minor processing that can happen in the
Adapter.

This works well in Android where each process's maximum heap is something
between 16 and 48MB, and keeping your data model in a database is a way of
continuously persisting it.

There are exceptions. You probably would not want to build a CAD program this
way. Instead you would take the performance hit to rebuild your POJOs after
the component they are contained in gets reaped.

------
seanponeil
Only using 2.2 APIs at this stage would only hurt the development of your app.
Targeting 4.1 and using the support package gives you full access to Fragments
and Loaders while still supporting the older SDK versions.

~~~
mhurron
And no one will be able to run it for 2 years.

Though looking at developer.android.com it does seem that it would be safe to
target 2.3 as a minimum.

<http://developer.android.com/about/dashboards/index.html>

Unlike with iOS where it is easier for users to upgrade their OS if their
phone supports it, Android version upgrades come most often when people
upgrade their phone and that means at the end of a 2 year contract for most
people.

Targeting the most recent Android version seems like a poor way to get people
to use your app.

~~~
daniel_solano
Note the: _Targeting 4.1 and using the support package gives you full access
to Fragments and Loaders while still supporting the older SDK versions._

Sure, if you target 4.1, you can't necessarily use every single new feature in
Android on older devices. However, from a design/UI point of view, Android's
backports of many new features (and projects like ActionBarSherlock) such as
the action bar means you can design for 4.1 and have the code work with many
previous versions.

I agree with the grandparent post: design for 4.1 and set 2.2 as a minimum. In
cases where you want to use new APIs, you can use conditional classloading
techniques.

------
facorreia
I'm just about to get started learning how to develop for Android and I thank
you for posting this link. The article seems very helpful for beginners.

~~~
moystard
I think reading most guides on the developer.android.com website is the best
way to start developing on Android. The SDK also includes sample codes that
are worth looking at for good practices on various tasks.

~~~
vibrunazo
Seconded and thirded. The linked article makes a few mistakes that would be
avoided if the author paid some attention to the Android guide. Which is
extremely common for third party tutorials. The Android guide is great and is
often updated. There's ton great resources like videos and tutorials. It's by
a huge margin the best place to learn android.

I would advise anyone beginning Android development to avoid third party
tutorials as much as you can. Only use those if you cannot find a specific
topic you need in the Android guide.

~~~
facorreia
Duly noted. Thank you for the tips!

------
draven
I'm also starting to learn Android. Being an Emacs user I tried android-mode,
then Intellij IDEA and Eclipse. At the end I decided to settle on Intellij
IDEA (Java is way more bearable with a good IDE.) Is there any drawback to not
using the "official" google dev. environment (Eclipse+ADT)?

~~~
mahmud
Emacs user here, Lisper, and Android developer.

Don't fight it: learn Eclipse+ADT and Java, and yeah Emacs M-. is F4 in
Eclipse ;-)

~~~
bitwize
Getting Eclipse going was the real "fight".

Using Emacs and the bare SDK tools works just fine for me, and is easy to do.

~~~
rrmm
I've always used emacs and the SDK as well. It seems to work ok, though I've
never been one for IDEs.

Eclipse felt too heavyweight on the netbook I use to code. (I still find it
amusing that emacs is the light-weight solution).

------
jcromartie
Most Android devices are now on 2.3, not 2.2. And Eclipse is getting pretty
aggravating lately.

~~~
ketralnis
Assuming [this](<http://developer.android.com/about/dashboards/index.html>) is
your source, I'd note that it "is based on the number of Android devices that
have accessed Google Play within a 14-day period".

I suspect that it's only loosely correlated to the number of devices in the
wild running that version, but very tightly correlated to the users likely to
download an app that you write.

~~~
guelo
Since the Play/Market app periodically checks the servers to look for any app
updates it's fair to say that Google's numbers comprise just about all devices
running Google Play which is probably 99% of devices. The only notable device
without Play is the Kindle Fire which is running Gingerbread 2.3.4

