Jay McGavren's Journal

2008-09-26

Android 1.0 API impressions...

What they’re describing here might be applicable not just to mobile apps, but maybe applications in general. Could this become the basis of an OS for a set-top box, game console, or desktop?

An Activity is a unit of action a user can initiate. Though an Activity can be used as an application, it isn’t the same concept; an Activity could be accessed from the menu of another Activity, for example.

The lifecycle of an activity is:

onCreate()
onRestart()
Called here after an application is stopped, not during its initial startup.
onStart()
Activity is becoming visible to user.
onResume()
Activity can interact with user.
onPause()
System is about to switch to another activity.
onStop()
Activity is no longer visible to user. May be followed by onRestart() or onDestroy().
onDestroy()
During this method, if isFinishing() returns true, user requested finish. Otherwise, system did.

This model is cool because it requires that an app be ready to save its state for later reloading at any time. An app that follows this setup properly will be ready for the user to switch activities, to reflect changes to the global config, or for the phone’s battery to run low.

Notifications: I’m imagining this to be like Growl or Enso notifications. Hope I’m right, but I haven’t read far enough to know yet.

Background processes!!! The inability of third-party apps to do this is my number one complaint about the iPhone. I want a daemon that can initiate different processes when I walk into work, home, or school, and I think it simply isn’t possible on iPhone.

Read more...
2008-09-24

Facebook is asking me, on behalf of Diana:

Do you think undefined undefined?

…Sometimes, yes.

Read more...
2008-09-22

Think our world is all SOA and web-service-enabled?

Think again. I just got an e-mail from a major travel industry vendor (one you’ve probably heard of), detailing changes to the procedure for manually downloading and unzipping the monthly data file they send us. This is the third vendor in the past year to pull something like this. (Actually the biggest one can’t seem to send us the same format month to month.)

“The future is already here - it is just unevenly distributed.” –William Gibson

Read more...
2008-09-19

No parking ticket. (whew!) But this was amusing, since I was wearing my “Do Not Want!” shirt:

FAIL

Read more...
2008-09-17

More experiments with objects that do weird crap when placed in ordinary situations…

This one lets you wrap an object so that its apparent value changes over time.

class ValueProxy
	self.instance_methods.reject{|m| m.to_str == '__id__' or m.to_str == '__send__'}.each do |method|
		undef_method(method)
	end
	def initialize(value)
		@value = value
	end
	def method_missing(method, *arguments)
		value.send(method, *arguments)
	end
end

Then we subclass it to do various things with @value

class ReverseProxy < ValueProxy
	def value
		@value.reverse
	end
end

And ordinary calls like this suddenly get weird.

string = ReverseProxy.new('foobar')
puts string
string2 = string + 'baz'
puts string2
puts ReverseProxy.new([1, 2, 3])

Output:

raboof
raboofbaz
3
2
1

Read more...