Posts with mood curious (13)

Setting values on a view: webOS vs. Android vs. Windows Phone 7
Mood: curious
Posted on 2011-12-11 13:00:00
Tags: essay palmpre windowsphone programming android
Words: 574

Now that I'm working on porting FlightPredictor to a third platform (Windows Phone), I have a better idea of the differences between the platforms. This post is about one of the more common things to do: taking values in code and making them show up in a view.

For reference, here's a screenshot of the flight info page of FlightPredictor for Android:

This view is one of the most important ones in the app, and there's a ton of information on it. Let's focus on just one part: how to make the flight times (the "4:35 PM - 5:50 PM" in the upper-right corner) show up on screen.


webOS:
For a blast to the past, let's look at Mojo first. This is the old application framework that is only used for older phones today.

In Mojo, each view is an HTML page, so in our HTML page for the flightInfo view, we include the following:

#{-publishedDepartureTimeStr} - #{-publishedArrivalTimeStr}
(I'm deliberately omitting the layout stuff...maybe I'll cover that in a future post!)
The #{} syntax means to use the property from the templateModel of the scene. (the - means don't escape any HTML in the property). So, my Flight object has these properties, and when pushing the scene I call
this.controller.stageController.pushScene({name: 'flightInfo', templateModel: event.item}, event.item);
The event.item is the Flight object, and since I'm passing it as the templateModel, that's it! All in all, this is pretty simple - as long as the property's already defined in the Flight object, I only have to change one thing (the HTML source of the view) to get it to show up.

--

Now, let's look at Enyo, the new application framework that is used on the TouchPad (and some newer phones). In Enyo, views are defined by JavaScript that generates HTML. (for a real introduction, see Enyo Basics - From the Bottom Up) Here, the FlightInfo kind includes this for the view:
{name: 'currentFlightTimes', allowHtml: true, content: ''}
and then in the create code for the scene, we have:
this.$.currentFlightTimes.setContent( flight.publishedDepartureTimeStr + ' - ' + flight.publishedArrivalTimeStr);
Here we have two things to do, but it's still fairly straightforward to make new properties show up.


Android:

Things are considerably less happy here. First, we have to define the TextView in the layout's .xml file:
<TextView android:id="@+id/flightInfoCurrentFlightTimes">
Then we have to create a variable for this TextView in the Activity class:
private TextView currentFlightTimesView;
Then, in the constructor for the Activity class, we have to get the view:
currentFlightTimesView = (TextView) findViewById(R.id.flightInfoCurrentFlightTimes);
And finally, when we set a flight, we have to set the text on that view:
currentFlightTimesView.setText( flight.getOriginalDepartureTime().getTimeStr() + " - " + flight.getOriginalArrivalTime().getTimeStr());
So that's a total of 4 changes to make, in two different files. This is significantly more irritating than either webOS version, and it really shows up when you have ~20-30 of these to add to the view.


Windows Phone 7:
Back to a world of happiness: with data binding, we can go back to a Mojo-like model and just add this to the XAML:
<TextBlock Text="{Binding PublishedFlightTimes}">
Admittedly, in this case we'd have to add an extra property for this (or make two separate TextBlocks), but there are plenty of cases where I just want a property that already exists. In any event, it's much simpler than Android. Hooray!

So, the final count:




OSChanges
webOS - Mojo1
webOS - Enyo2
Android4
Windows Phone1 (maybe 2)

I would be very curious to see what the corresponding number is for iOS - is there a way to do simple templating?

2 comments

mobile OS's and updates
Mood: curious
Posted on 2011-10-28 10:42:00
Tags: palm links
Words: 185

The impression is that Apple is very good about updating older phones to newer versions of iOS, while manufacturers that make Android phones are not as good. Michael DeGusta did some research and produced this lovely chart that absolutely confirms that theory. Although it looks like HTC is a little better than average, while Motorola is worse than average (although hopefully that will change since they're owned by Google now).

Happily, the Windows Phone update will be delivered to all (or nearly all?) phones.

In the increasingly sad webOS world, some people are still "all in", although sadly that group does not include HP which will make a decision on webOS...in the coming months. I hope it finds a nice home somewhere, but I will be very surprised if it ends up on phones in the future. Sigh.

Unrelated: I am instinctually a bit skeptical when I hear about teaching kids to be entrepreneurs (probably because of Rich Dad, Poor Dad), but this story of learning about cash flow through running a vending machine is kind of awesome. I want to own a vending machine!

0 comments

What webOS app to work on next?
Mood: curious
Posted on 2010-09-02 22:51:00
Tags: palm projects proandcon poll
Words: 347

Having finished We the People and done some small changes to earlier apps, I'm raring to work on a new webOS app for my Palm Pre. (partially feeling invigorated by the announced webOS 2.0 features)

So here are my ideas:

A client to easily browse Reddit.
- Pro: I've played around with it a little and gotten some stuff to work, which is promising.
- Pro: There's a real API which looks pretty easy to interact with.
- Pro/Con: There are already a few existing Reddit clients, although none of them are in the full App Catalog (one's in beta, I believe?)
- Con: It would be a lot of work to make pages look attractive, especially since I suck at it.
- Con: I'm not sure how much more useful it is than just going to the Reddit site in the browser.
- Con: I couldn't see charging more than $1.99 for it, and I'm not sure how many people would be interested in buying it.

A bridge game (probably single-player only, at least at first)
- Pro: There are no existing bridge games in the Catalog. Even in Apple's I only see two.
- Con: That's probably because it's a huge pain to write AI that bids well. And if it doesn't bid well, it's almost useless.
- Pro: I could see charging $5-$10 for it if I spent the time to do it well.
- Con: Bidding aside, it's still a lot of work to put in correct play, proper scoring, fancy card graphics, etc. I'm not convinced I won't give up or lose interest before I'm done.

Mystery option #3, which I just thought of
- Pro: Uses some exciting new features in webOS 2.0, like <redacted>!
- Con: It's not a very original idea, and I bet someone can beat me to it.
- Pro: But it would be kinda fun to write and play around with...and I would use it...
- Con: But I can't start working on it until webOS 2.0 releases, whenever that is.
- Pro/Con: Probably a 99 cent app, although a fairly wide audience.

What do you think? (open to other ideas!)

4 comments

looking for a tree place
Mood: curious
Posted on 2009-03-24 23:38:00
Words: 19

Anyone ever bought a tree in Austin? We're looking to plant a pecan tree in the backyard this weekend.

11 comments

browser of choice?
Mood: curious
Posted on 2009-03-21 17:09:00
Tags: poll
Words: 32

So I saw this article about how Chrome is killing Firefox and I thought "Really?" That doesn't seem very likely considering Chrome's still under 1% market share.

But, just out of curiosity...

4 comments

Obama's speech, McCain picks Sarah Palin
Mood: curious
Music: Obama speech
Posted on 2008-08-29 09:57:00
Tags: politics
Words: 208

Obama's speech was pretty amazing last night - here's part 1 and part 2. A lot of people thought it was going to be very high-falutin' rhetoric but he talked about a lot of concrete things mixed in there. Even Pat Buchanan loved it! Edit: better link to Obama speech

McCain just announced he picked Alaska governor Sarah Palin as VP. She's young and pretty which has me a little worried, but she's very inexperienced (elected as governor in 2006) and apparently has a scandal about firing a state trooper (although her wikipedia page notes her as leading some anti-corruption efforts). Plus, she's a woman, which means McCain can legitimately claim to be running an "historic campaign". So I dunno. kos thinks it was a choice made in desperation. I reeeeeally wish it had been Romney :-) Edit: more information about Palin's scandal

On a more personal note, I've been pretty crabby this week for no particular reason I can think of. I don't like being that way, so I'm gonna put more effort into being upbeat and cheerful and all that. My apologies to those who had to put up with me (mostly djedi and quijax).

I'll be out of town this weekend - everyone have a nice Labor Day!

6 comments

Chrstina Aguilera: gay icon?
Mood: curious
Posted on 2008-05-09 14:50:00
Tags: music
Words: 64

Is Christina Aguilera a gay icon and I just didn't realize it? If not, why not?

I'm listening to her album "Stripped" and so far it's pretty full of strong woman be yourself kinda songs. The song "Beautiful" really exemplifies this (and the music video for it won a GLAAD award for using gay and transgender images).

...aha, according to Wikipedia she is! Yay!

2 comments

happy caucus day!
Mood: curious
Posted on 2008-01-03 09:11:00
Tags: election politics links
Words: 154

And remember, caucuses aren't elections nor particularly democratic (with a lowercase "d"), so when whoever wins try not to get too excited even though presumably the media will crown him/her tomorrow morning because it's not like the media has a blatant interest in making the caucuses overly-relevant with their millions of dollars in media ads.

Also, I will say to supporters of Hillary what my mom said to me about Howard Dean in 2004 (paraphrased and mostly remembered): "Son, feel free to support whoever you want, but if Dean wins the nomination and then loses to Bush you're in big trouble".

I heard this interesting story on NPR on the way to work: a study seems to suggest the placebo effect can make you lose weight and lower blood pressure, although there are some other possible explanations. Interesting stuff, the placebo effect.

100 things we didn't know last year from the BBC (via kottke)

5 comments

firing-attorneys-for-political-reasonsgate
Mood: curious
Posted on 2007-04-05 20:15:00
Tags: links
Words: 28

(not all scandals end in "gate", stop the madness!)

Here is an excellent summary of what's happened and how the White House keeps making things worse. (via waxy)

1 comment

betteresque
Mood: curious
Posted on 2007-03-29 15:41:00
Tags: haskell congressvotes
Words: 166

Allergies seem to be on the retreat, thanks to a little extra sleep today and tons of tea and orange juice and hot chocolate.

I should have worked on congressvotes yesterday, but I didn't have the activation energy. The problem is that parsing the XML and extracting any sort of data gets really really really slow - like 37 minutes to do a little bit of stuff to all 600ish votes from 2006. I've looked at the code and I can't find anything in particular that's inefficient about it, but I'm pretty new at Haskell. The next strategy is to do an offline transform to some sort of friendlier text format with just the information I need, and hopefully the web service, etc. can just use those text files. Hopefully I'll give this a shot sometime soon. (for some reason this post about premature optimization spoke to me; it's a good general philosophy!)

Wow, are there really going to be Kwik-E-Marts? I could go for some Krusty-O's...

7 comments

Heroes ARG!
Mood: curious
Posted on 2007-02-03 09:50:00
Tags: heroes arg
Words: 445

So djedi and I watched the last two episodes of Heroes last night - good stuff! After they were done I stumbled across the new ARG (Alternate Reality Game, like the Lost Experience that I messed around with this summer). I got the hint from the show - go to primatechpaper.com to see. Behind the cut I'll list the progress I made last night. Spoiler alert!


So you go to primatechpaper.com and look around a little. Do y'all see the "call 1-800-PRIMA16" or text "PAPER" to 46622? I didn't see that at first, or something. (1-800-PRIMA16 was also on the show) Anyway, if you don't see that you can go to the careers page and there's an invitation code it asks for. I don't know what that code is (the guy said he wrote it on the back of the card for Mohinder, I think), but you can look at the javascript and see it's just going to send you to www.primatechpaper.com/jobs, which is at what point I first saw the call/text message text.

So I haven't called the number, but I did send a text message, and it told me to go to www.primatechpaper.com/wap, which I did on my normal web browser. There's a place on there to enter your name and phone number, which I haven't done, but you can also click on the logo off of the "About Us" page which leads to this text:

I'm in and u shud b 2 Go online to Primatechpaper.com when you get home. Find helix on About Us page. Username: bennet Password: claire. Get to know them thru me. HGghx11a. Talk again soon

So, OK. I did that (the helix is in the company logo) and logged in and it brings up this neato Assignment Tracker, under which there seem to be silhouettes of one girl and three guys. Clicking on any of the pages asks for another login, and when you fail, it says:
You have attempted to access a page
that you are not authorized to view.
Your IP address has been noted.

207.138.82.11

Future attempts to access may result in legal action.

But that's not your IP address! So, you can go to 207.138.82.11 and get the following cryptic thing:
Invalid URL
The requested URL "/", is invalid.

Reference #9.b528acf.1170479141.0

That's where I ran out of time. So we have this reference number, and the string "HGghx11a" from Claire's message that might be used as usernames/passwords somewhere. I'll investigate more after dodgeball and such.

Edit: Aha! If you click on the top silhouette (Claire?) and use username: bennet password: HGghx11a you can see a profile of someone new. I really have to run though.


Namaste!

0 comments

"burn baby burn" - poll
Mood: curious
Posted on 2006-05-17 09:07:00
Tags: poll
Words: 117

Iraq's Grand Ayatollah Ali al-Sistani appeared to renounce a fatwa calling for the killing of homosexuals "in the most severe way"...um, yay!

So Austin Police Chief Stan Knee is resigning to work with police in Afghanistan. He's had a good tenure here, although there were a few incidents that reflected poorly on the department. One such incident that happened a year or two ago was that a group of police officers, watching the Midtown Club burn down, text messaged another police officer "burn baby burn". People protested because of the other messages which seemed to celebrate the burning, and this one in particular, because of the racial undertones. That leads us to this week's poll:

*swoosh*

13 comments

del.icio.us-only entry
Mood: curious
Music: not now, thanks
Posted on 2005-06-23 13:31:00
Tags: del.icio.us
Words: 223

At destroyerj's request, more del.icio.usness.

Last time I talked about the benefits of tagging your own bookmarks. But that's not all del.icio.us offers!

First, the front page is just a list of the 30 or so most recent bookmarks that anyone has added. This is a great place to find lots of random stuff. There's also a page of what's popular (as well as populicio.us, which has a list of the most popular links that were not bookmarked before yesterday). I've found lots of good articles and useful websites that way.

You can also look at the tags for all bookmarks. So, if you're looking for cool google-related stuff, try del.icio.us/tag/cool+google, or even just del.icio.us/tag/google. This to me is less useful than tags for your own bookmarks, but it's fun to just pick a random word and see what sites come up. Like trogdor!

Also, all of the bookmarks show how many other people have that site as a bookmark. So, I can see that someone else has bookmarked my iTunes info. I'm famous!

You can also get RSS feeds for all of those sorts of pages, if that sort of thing is your bag.

Well, that's about the cool things I can think of, so here ends the series. Play around with it for a while - I think you'll like it!

0 comments

This backup was done by LJBackup.