• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Getting started

Ranch Hand
Posts: 574
VI Editor Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A little background. Been using *nix since about '84 or so. Started with Linux in 94. Contributed to the Linux firewire and ethernet driver code. Ported Linux to the SH-4 microprocessor in 2000, where the code died when the startup I was working for went toes up. Written several Linux device drivers for custom chips (none of which are in the Linux tree because, well, I'm a code monkey, not a legal monkey).

That is to say, I know my way around programming, and Linux, and am currently learning Java.

I wrote a "hello world" program this afternoon. Did it in some Java file Eclipse created for me. But google leaves the impression I should have done this in an xml file somewhere.

The goal is to write a simple 2D graphics game (probably pong or breakout), then partner with someone who is an idea generator and Get Rich Soon. But Hello World taught me there is a lot of stuff to know that has nothing to do with programming.

My question is, is there a good resource for learning how you *should* learn to write Android apps? Book or website, doesn't matter.

If you're interested, my Hello World lists the prescription drugs I take daily, the relevant code is:

Comments on how much this code sucks appreciated.
Posts: 43081
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The usual way to create layouts in Android is indeed via XML files. That's not to say that doing it programmatically is inherently wrong, but it is the exception - any open source Android app you look at will generally have numerous XML files in the res/layout directory that describe the details of how things are displayed. And any static text that is displayed will usually be kept in the res/values/strings.xml file, and then be referenced by the TextView that display it. The activity code would then be a mere:

assuming main.xml is the layout file. A lot you need to know about that can be found at http://developer.android.com/guide/topics/ui/declaring-layout.html (and just about everything written in http://developer.android.com/guide/components/index.html and its linked pages is good to know). Android is by now a huge subject, a book would really help organize for you all that's out there. I liked Android in Action, but there are numerous others; some are listed in the https://coderanch.com/how-to/java/AndroidFaq. The odds of creating an app successful enough to provide even a modest living for a team of 1 or 2 are just about zero, I'd estimate (unless you jump in full time). The expectation of users who should pay for the app (or make in-app purchases) are high these days, due to the large number of competing offerings, so it's hard to create something polished enough to find lots of users. Not to discourage you, mind you, just to set expectations properly.
    Bookmark Topic Watch Topic
  • New Topic