The Artima Developer Community
Sponsored Link

Java Buzz Forum
Android Notebook, page 3

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Elliotte Rusty Harold

Posts: 1573
Nickname: elharo
Registered: Apr, 2003

Elliotte Rusty Harold is an author, developer, and general kibitzer.
Android Notebook, page 3 Posted: Jan 20, 2009 3:38 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Elliotte Rusty Harold.
Original Post: Android Notebook, page 3
Feed Title: Mokka mit Schlag
Feed URL: http://www.elharo.com/blog/feed/atom/?
Feed Description: Ranting and Raving
Latest Java Buzz Posts
Latest Java Buzz Posts by Elliotte Rusty Harold
Latest Posts From Mokka mit Schlag

Advertisement

Perhaps just because it’s an initial tutorial, but the event handling model feels like a sort of monolithic Java 1.0/Mac OS 6 event loop rather than the more flexible event listener based approaches of Swing and other more modern GUI frameworks.

Local variable access is much more efficient than field access in the VM. I guess the CPU (or battery) is too underpowered to do fancy JIT tricks, as I’d expect a good optimizer to account for this. Worth remembering. Hmm, does Dalvik even have a just-in-time compiler? Apparently not.

An Intent holds a map of user defined properties wrapped up as a Bundle named extras. Hmm, what is an intent or an activity anyway? Backtracking a bit, “An activity is usually a single screen in your application. Each activity is implemented as a single class that extends the Activity base class….Android uses a special class called an Intent to move from screen to screen. An intent describes what an application wants done. The two most important parts of the intent data structure are the action and the data to act upon. Typical values for action are MAIN (the front door of the application), VIEW, PICK, EDIT, etc. The data is expressed as a URI. For example, to view contact information for a person, you would create an intent with the VIEW action and the data set to a URI representing that person.”

On the other hand, I’m not sure why intents/activities should be wired up in XML in AndroidManifest.xml. This feels more like a job for Java. Maybe it’s just that I think of XML as the right place for nouns and adjectives, but I get nervous when we start turning it into verbs. (Just like I get nervous when we start using code to describe things rather than behavior.) I am not sure this is actually sensible. It may be perfectly reaosnable to use XML to describe behavior and procedural code to describe data. However, I think there’s the beginnings of another general principle here:

Use XML to describe things. Use code to define processes.

How functional programming languages fit into this I have no idea. (And as I said, this may not actually be a good principle anyway.)

Read: Android Notebook, page 3

Topic: Teodor Danciu has released JasperReports 3.1.3, an open source (LGPL) Java library for... Previous Topic   Next Topic Topic: GPS via javascript-Android Video

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use