India, week 1
Mood: relaxed
Posted on 2013-02-10 17:54:00
Tags: pictures travel
Words: 1080
<- click for full album
Monday 2/4 evening
First day of work here! I had breakfast at the hotel and the owner came over and chatted with me a bit, which was neat. Then it was time to drive to work during what I can only hope was rush hour, because...wow. The office is less than 2 miles away and it took 20 minutes to get there and it seemed like we nearly got in 5 accidents. At tricky intersections you basically have to almost cause an accident to get anywhere. I was talking about this with people at work some - it sounds like it's mostly because Bangalore has grown so much in the past 7-10 years (there was very little SW industry here even in the 1990's) and the infrastructure hasn't scaled with it. Apparently the traffic is less crazy other places in India.
The NI office is nice - it's less than two floors of one building, but there are neat dance-related things on the walls, and the conference rooms are named after famous Indians, including Ramanujan! The power blipped out a few times during the day, but all the computers are on a UPS.
I had some problems with my work computer, but I did manage to get some work done. Unfortunately I haven't totally beaten jet lag and got pretty tired in the afternoon...
Now I'm back in the hotel room and in addition to the usual honking there's some seriously thumping bass that's been going on for an hour or so. Not sure what that's about. (Ed: I think there was a banquet going on downstairs or something. It stopped before I went to bed...)
Wednesday 2/6 evening
Yesterday was fairly boring: get up, have breakfast, nearly get in accidents on the way to work, do work, nearly get in accidents on the way to the hotel, eat, relax, sleep. I did give a talk at work which I think went decently, although I realized afterwards I omitted a key point. Oh well!
Today was mostly the same. After work, though, I walked to a nearby park. I've been planning to do that for a few days now, but my plan had been to wait until the traffic died down so crossing the street would be less scary. Of course, by the time that happened I would be tired and not excited about leaving the hotel. So, today I went out right after getting back. The traffic was heavy, but the only street I had to cross has a traffic light that is mostly obeyed, and I crossed with a crowd of people.
It took less than 10 minutes to get there (although I walked around three-quarters of it looking for the entrance), and it's a nice little park! I walked around it a bit and sat on a bench and read (on my phone Kindle, the best thing ever for reading on the go) for a bit. It's well-lit and there were lots of people walking and sitting down.
Today's random India topic: ever since I got here, everyone in the service industry (hotel, car, restaurant) has been extremely friendly, sometimes to the point of making me uncomfortable. The first time the driver met me at work to drive me back to the hotel, he took my backpack and carried it for me. All of the drivers I've had open the door for me when I enter and exit the car. The security guard at the hotel opens the door for me. After bringing me a bottle of water, the waiter at the restaurant pours some into my glass (and refreshes it when it gets low).
I'm not sure what to make of this. Is this a cultural thing? Am I getting special treatment because I'm American? (or, at least, clearly not Indian) I'd rather open my own car door, but I don't want to give offense and I'm new here and when in Rome, etc., etc.
Friday 2/8 late evening
Let's see: work over the last two days has been good. I feel pretty settled in now, and I was actually able to fix a bug this morning! (although the lag on remote desktop is somewhat painful) I gave a presentation today that went pretty well, and I had something that wasn't Pizza Hut for lunch. (ordered from a local Indian place, although it's possible I'm starting to get tired of Indian food...) Yesterday was their version of Snack Thursday, at which everyone had some Taco Bell.
Thursday evening I went out walking a different direction (south!) and almost had to turn back - I was waiting to cross the street to come back, but there was 0 chance I was going to do that at anything but a bonafide stoplight. Luckily I eventually encountered one and crossed, and my reward was eating at a KFC on the way. It was...well, a lot like American KFC's. Except the drink I got was tiny (which was fine!), and the menu seemed to have some vegetarian options.
Tonight I went out with Rakesh and played some pool, then went out to a nice restaurant. To get to these places I rode on the back of Rakesh's motorcycle. I was a bit hesitant about this, but the places weren't far away and he gave me a smooth ride!
Random: there's a mosque near to work, so we hear the calls to prayer around lunchtime and early evening. The sound is quite beautiful - reminds me of music from Battlestar Galactica.
Random India topic: I happened to see the new version of the Big Mac Index...and look, India's at the very bottom! According to the index, things should be around 60% cheaper here, and that seems about right. Entrees at the hotel restaurant are around $4. I can get a Coke from the minibar in my room for $1. Tomorrow we're going to Mysore, and we're renting a taxi to drive us around all day for a total of $60. I guess the price of travel and difference in GDP can keep things this way, but it's still surprising.
Somewhat related: apparently it's not uncommon for bachelors to have a part-time cook service, where someone comes and delivers you home-cooked food every day. One person even has a full-time cook who lives at his apartment (although he does live with several other people), and the cook does laundry, cleaning, etc. I'm guessing this is related to the Big Mac Index...
India, weekend 1
Mood: tired
Posted on 2013-02-06 23:20:00
Tags: pictures travel
Words: 1014
<- click for full album
I thought for this trip I'd try posting pictures and entries as I went. I'm already a bit behind, though, so I doubt I'll really keep up. But, here's my first Bangalorian weekend!
Friday 2/1/2013 afternoon
I'm on my way to India! I arrived at the Austin airport obscenely early for my Dallas flight, which was uneventful. In DFW I realized that some of my Nokia friends were on their way to an event, so I walked from Terminal D to C to say hi. Then I had to quickly walk back, as it was a longer walk than I had expected and it was getting close to departure time. But I did sneak in a cup of Ben & Jerry's - tasty!
The flight to London was long but fine. I rented four movies on my Surface before I left and watched "The Cabin In The Woods" ("Joss Whedon horror movie" sums it up perfectly) and "There Will Be Blood" which was also good. I'm glad I had those to watch - the 777 entertainment system had movies but the selection was small and none of them tempted me even a little. In between, I chatted with the woman next to me, who was also heading to Bangalore, randomly enough! I also read some, including a book about airplane crashes; fate - consider yourself tempted! Tried to sleep but was mostly unsuccessful, so I was feeling blah when we landed. Walking around Heathrow helped a lot. Terminal 5 is very nice, after having to go through security again (blah) I got some souvenirs and lunch at Pret a Manger, my favorite place ever. The sandwich was only OK (my fault for getting one with avocado as the main ingredient - I love me some avocado but it's a bit much on its own) but the yogurt and fruit parfait was excellent. Mealtimes are so weird on multi-time zone trips, but my stomach's doing OK so far.
Tea at lunch helped, but I'm clearly out of it - while browsing shops I saw a Kindle for a very good price...until I realized it was in pounds. Not two minutes later, I thought that the currency exchange place was offering a terrible deal on rupees...until I realized that was in pounds as well. Going to take some melatonin on this next flight in the hopes it will help me sleep...
Saturday 2/2 evening
Not sure if it was the melatonin or being really tired, but I managed to sleep 5-6 hours on the Bangalore flight, which is easily a personal best. So I felt OK but disoriented (and tired of plane flights!) when we arrived. I did my best at filling out the immigration form, then picked up my luggage and went outside to find my driver.
As it turns out, our flight was quite early so I had to wait a bit for the driver, who drove me to my hotel. Even though it was 5:30 AM, the drive in was still terrifying. We would be on a road with lanes, and then there would be a sign about construction and everyone had to swerve to the left and drive on a part of the road without lanes. Honking was applied liberally. I also did see a cow on the side of the road!
I spent most of the day in the hotel room, getting my stuff set up and trying not to fall asleep. The room is nice, but unfortunately it faces the corner of two rather large roads, which means there is lots of honking all day long. I suppose I'll get used to it in a few days, but I'm glad I brought earplugs for sleeping. I did a tiny bit of walking around, but I'm planning to hang out with NI folk and do some sightseeing tomorrow. After a full night's sleep, of course!
Sunday 2/3 early evening
Ahh sleep. I felt so much better this morning! Unfortunately I seem to have lost my melatonin (left it on the last plane, I guess?) but I didn't need it - went to bed at 10:30 and quickly fell asleep. After showering and a short video chat with David (the WiFi in the hotel is barely good enough for this to work), I had breakfast and met Rakesh downstairs. We planned out where to go for the day, and then got on our way!
First stop was Big Bull Temple, which is a Hindu temple which has a giant statue of Nandi, a bull. After that we went to a big ISKCON temple. It was interesting - there was a long path to walk that went through the main temple but then you ended up at a market downstairs with souvenirs and food and whatnots. Our next stop was Bangalore Palace, where I got a lot of good pictures.
Afterwards we met Kanika and had a delicious Indian lunch, where I got my first taste of paneer here. (it was excellent!) Then we went to a shopping center where I got an Indian shirt and a few snacks, then we had tea and chatted for a good while. It was already 5 PM by the time we were done, so I just headed back to the hotel. I'm doing remarkably well for only my second day - I'm a little tired from walking around, but nothing like the jet lag I went through in Germany. Adjusting times quickly and getting a good night's sleep seems to be a winning combination. My stomach's also been holding up decently.
I've already adjusted to honking all the time on the roads - at first I had a visceral reaction to it, because I'm used to it meaning "something bad is about to happen", as opposed to "just FYI, I'm here" or "drive faster!", etc. Driving is still kinda scary but I just don't look too much. I saw some signs reminding people not to drink and drive, and all I could think was that there would be no way you could drive drunk in this traffic without getting in an accident!
a few quick pre-India links: tea steeping strategies, NFL fans analysis, SimCity
Mood: excited
Posted on 2013-01-31 13:32:00
Tags: links
Words: 275
- Tea: Does bouncing your tea bag actually do anything substantial? - you don't need to sign up for Quora; the first answer is pretty comprehensive!
- More documents came out in the lawsuits about the no-hire agreements between Apple and other high-tech companies, and Jobs's letter to Palm includes the following:
I'm sure you realize the asymmetry in the financial resources of our respective companies when you say: "We will both just end up paying a lot of lawyers a lot of money."Ouch! Some of the other documents are pretty damning as well - even if the only policy was "don't pursue people from these companies, but it's OK to hire them if they come to us", I think that's still kinda wrong.
Going to India!
Mood: excited
Posted on 2013-01-27 19:05:00
Tags: travel
Words: 93
I'm going to India this week! I'm leaving on Thursday and will be working in Bangalore for two weeks.
I've never been there before, and as such I'm excited and nervous in various proportions depending on my mood. Any travel tips would be greatly appreciated!
I've always enjoyed travelling, but as I get older the downsides are becoming more apparent, mostly the whole more likely to get sick/be exhausted thing. Hoping to avoid that this time around, but with more than 24 hours of travel to get there(!) we'll see how it goes...
Windows Phone: promotion for new developers: write an app, get a Lumia 800!
Posted on 2013-01-21 00:36:00
Tags: nokia windowsphone wpdev
Words: 328
This promotion has ended - thanks to all who participated!
In addition to the existing promotion for writing new apps, I'm happy to announce a new promotion for new Windows Phone developers!
The rules are pretty simple: write a new app and send it to me for testing/feedback. Once you do that I will send you a Windows Phone dev center token (a $99 value) and help get you signed up to DVLUP. Once the app is in the store and you've submitted it for a DVLUP challenge, I'll send you a Lumia 800! Since the Windows Phone 7.8 update is coming soon those 800's will be even more exciting!
As with the other promotion, the fine print:
Windows Phone: debugging crashes in a released app
Mood: content
Posted on 2013-01-19 18:45:00
Tags: windowsphone wpdev
Words: 415
Unfortunately, bugs are a fact of life, and your app will probably crash occasionally in the wild. But, there are a few nifty tools to help you debug them after the fact.
I wrote about Little Watson a while ago, and while it's helpful, it does require the user to send in a report. Microsoft provides data in the Windows Phone Dev Center that doesn't require the user to do anything - here's how to use it!
Step 1: Get the data
Log in to the Windows Phone Dev Center and go to the Dashboard. At the bottom of the page there's a "Highlights" section that shows app downloads - click on the little arrows at the bottom to see crash count statistics:
(click for full image)
For the app you're interested in, click on the number next to it - in this case we're going to be looking at FlightPredictor.
Now you'll see a screen like this:
(click for full image)
Click on "Export stack traces" - this will download and open an Excel file with the crash data.
Step 2: Analyze the data
You should see something like this:
Go ahead and click the "Enable Editing" button at the top.
Most columns you see should be pretty self-explanatory. Note that "Mango" is OS 7.5 and "Apollo" is 8.0. The call stacks are grouped together - you can see in my example that the top row has 2 crashes, so it's the most common one.
For this crash the problem function is "Unknown", which isn't terribly helpful. So let's look at the full stack trace - move over to that cell and press F2 to see it (and press Up to get to the top of the text). And we see:
So we can see the most recent call in the stack is FlightPredictor.Model.Flight.UpdateCalculatedValues(), and hopefully the call stack will help you track down why the app is crashing.
I tried to use the offset to find what line of code the crash is happening on, but I couldn't make it match up with IL offsets or native offsets (see this MSDN thread). I'll update this post if I find out how to make it work.
--
See all my Windows Phone development posts.
I'm planning on writing more posts about Windows Phone development - what would you like to hear about? Reply here, on twitter at @gregstoll, or by email at ext-greg.stoll@nokia.com.
--
Interested in developing for Windows Phone? I'm the Nokia Developer Ambassador for Austin - drop me a line at ext-greg.stoll@nokia.com!
links: traffic fatalities visualized, lead is bad, comment trolls are also bad
Mood: okay
Posted on 2013-01-18 15:14:00
Tags: gay links
Words: 282
- Five Years of Traffic Fatalities - interesting visualizations of traffic fatalities. They're definitely more common on weekend evenings, but not as much as I had thought.
- America's Real Criminal Element: Lead - I've read this hypothesis before about the crime wave in the 60s and 70s and subsequent reduction, but this presents a very good case for it. I'm a sucker for stories explaining things in the past that were mysteries!
- Never Lie About Who You Really Are - this resonated so hard with me I nearly exploded. I am to the point where I don't hide that I have a husband, but I don't necessarily volunteer it even if it's relevant. Maybe that's not good enough.
- The Science of Why Comment Trolls Suck - from the article:
Those who already thought nanorisks were low tended to become more sure of themselves when exposed to name-calling, while those who thought nanorisks are high were more likely to move in their own favored direction. In other words, it appeared that pushing people's emotional buttons, through derogatory comments, made them double down on their preexisting beliefs.and that sounds about right from my personal experience.
Know Your States now available for Windows Phone!
Mood: happy
Posted on 2013-01-18 11:32:00
Tags: windowsphone projects
Words: 20
Know Your States, the non-award winning app from the AT&T Dev Hackathon, is now available on the Windows Phone Store!
Las Vegas recap: AT&T Developer Summit, CES
Posted on 2013-01-12 22:55:00
Tags: pictures travel
Words: 702
- click for the full album!
Note: the trip was jam-packed with activities, so I didn't actually write in my journal that much
Friday Jan 4 after midnight
Long day! The parts of Vegas I've seen have been, by and large, crazy. Getting a lot of good pictures of famous casinos and such.
After dinner at Texas de Brazil (a Brazilian steakhouse that was good, although not quite as good as Fogo de Chao), we got to hang out in a Skyloft at the MGM Grand.
The curtains and lights are remote controlled and we played foosball. It was over the top, in a good way.
Saturday Jan 5
Today was the hackathon, so I was either coding (working on Know Your States) or helping people all day. Exhausting! In the casino, I did see someone playing computerized roulette (although the ball/wheel were real) and graphing out the results. I (mentally) wished him well - it's theoretically possible that the wheel is misshapen in some way, right?
Sunday Jan 6
Today was the hackathon part 2. I helped a few people out and managed to finished (enough of) Know Your States, an app to help you learn state capitals/birds/trees/etc. Not terribly exciting (and not related to AT&T at all), but I like it. After the 2PM deadline, the 70+ teams(!) got to demo their app for 90 seconds. I think my demo went pretty well. Around 18 teams developed Windows Phone apps and 10 won prizes, myself not included. I can't really disagree but I'll admit to being a little disappointed. Oh well!
Afterwards, we had drinks at Rain (our favorite hotel bar), and some folks went up to a club. I was a little tempted, but instead tried my hand at blackjack. Two fine-looking women were my dealers (they seem to change shifts/tables often!) and helped me figure out what I was doing. I mistakenly chose an empty table, which meant that hands happened very fast. I was briefly up but then I ordered a (free!) drink, so I felt obliged to stay until the drink came and by then I was down a lot. More people came to the table, which slowed down my descent but the dealer was on fire. Vegas!
Monday Jan 7
The AT&T Developer Summit proper was today, and I ended up working the Nokia booth for a long while. It was fun to talk to people about Nokia/Windows Phone, but tiring. Went to see a session that was held in one of the casino movie theaters - neat!
After that was the Nokia party, which was awesome. 8-bit games, and artists making 8-bit versions of people - it was a nice theme!
After that was The Killers concert where I paid for a drink for the first time in quite a while.
In the meantime, I got to try out two new table games. Roulette was OK but I was the only one playing most of the time. Also I kept betting on black and it kept coming up red, so...yeah. Craps was fun, though - a lot of people were betting so there was a lot of camaraderie. Also, I ended up a bit, which was nice! You don't get the same one-on-one interaction you do in blackjack, but between the camaraderie and the fact that it can take a long time to know whether your bet wins or not (read: you lose money slower), I think craps wins. There were a lot of complicated bets people were making, but I stuck to betting on "Pass".
Tomorrow is CES! It occurred to me today that I haven't been outside in three days, and that doesn't see weird, which in itself seems weird.
Tuesday Jan 8
CES was pretty neat, although I spent all day just walking from booth to booth and my feet ache like nobody's business. (glad I got new shoes recently!) Saw a lot of cool stuff, though.
Afterwards I took the monorail and walked to Caesar's Palace instead of taking a shuttle back. This sounded like a great idea last night, but I was tired and my feet hurt so it was less appealing at the time. Did get a few other random casino pictures, though.
Windows Phone: earn a Lumia 800 or 900!
Mood: sick
Posted on 2013-01-12 15:57:00
Tags: nokia windowsphone wpdev
Words: 302
This promotion has ended - thanks to all who participated!
There's a new promotion for new Windows Phone developers - check it out!
Here's a chance to earn a Nokia Lumia 800 or 900! Here's how:
- Submit three new apps to the Windows Phone Store and get a free Lumia 800
- Submit five new apps to the Windows Phone Store and get a free Lumia 900
You must be a member of DVLUP to win - contact me at ext-greg.stoll@nokia.com if you need an invite code. Note that you can also use these apps to earn points in DVLUP challenges, so it's a win-win!
The fine print:
Windows Phone: adding enum settings to your app
Mood: sick
Posted on 2013-01-11 21:10:00
Tags: windowsphone wpdev
Words: 447
After my last post about adding a settings page to your app, I thought I'd follow it up by adding an enum-like type to the page. Enums and booleans are (at least in my apps!) the most common types of settings, and enums are slightly trickier than the Boolean settings we saw last time.
For this example, I'm going to be adding a QuestionDirection "enum" to my settings page.
Step 1: Add the "enum" class
First, you need a QuestionDirection.cs:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
namespace KnowYourStates.wp7
{
public class QuestionDirection
{
public string Name { get; set; }
public string DisplayName { get; set; }
public bool HasForward { get; set; }
public bool HasBackward { get; set; }
private static QuestionDirection _forward = new QuestionDirection()
{ Name = "forward", DisplayName = "Forward", HasBackward = false, HasForward = true};
private static QuestionDirection _backwards = new QuestionDirection()
{ Name = "backwards", DisplayName = "Backward", HasBackward = true, HasForward = false };
private static QuestionDirection _both = new QuestionDirection()
{ Name = "both", DisplayName = "Forward + Backward", HasBackward = true, HasForward = true };
private static Collection<QuestionDirection> _directions = null;
public static QuestionDirection Default
{
get
{
return _both;
}
}
public static Collection<QuestionDirection> Directions
{
get
{
if (_directions == null)
{
_directions = new Collection<QuestionDirection>();
_directions.Add(_forward);
_directions.Add(_backwards);
_directions.Add(_both);
}
return _directions;
}
}
public override string ToString()
{
return DisplayName;
}
}
}
Here the important parts are the Default
property and the Directions
property. (the ToString()
method is necessary to make it look right in the ListPicker we're going to use, but how you implement it is up to you)
Step 2: Modify UserSettings.cs
In your UserSettings.cs (see the previous post for the necessary parts), add the following:
const string QuestionDirectionKeyName = "QuestionDirection";
QuestionDirection QuestionDirectionDefault;
public QuestionDirection QuestionDirection
{
get
{
return GetValueOrDefault<QuestionDirection>(QuestionDirectionKeyName, QuestionDirectionDefault);
}
set
{
if (AddOrUpdateValue(QuestionDirectionKeyName, value))
{
Save();
}
}
}
public Collection<QuestionDirection> AllQuestionDirections
{
get
{
return QuestionDirection.Directions;
}
}
and then to the constructor, add
QuestionDirectionDefault = QuestionDirection.Default;
Step 3: Add a control to the Settings page
Here's the XAML for the Settings PivotItem
:
<controls:PivotItem x:Name="SettingsPivotItem" Header="settings">
<StackPanel Orientation="Vertical">
<TextBlock Text="Question Mode:" FontSize="{StaticResource PhoneFontSizeLarge}"/>
<toolkit:ListPicker ItemsSource="{Binding Source={StaticResource appSettings}, Path=AllQuestionDirections}"
SelectedItem="{Binding Source={StaticResource appSettings}, Path=QuestionDirection, Mode=TwoWay}"/>
</StackPanel>
</controls:PivotItem>
Note that the ListPicker
is from the Windows Phone Toolkit, which is a (free!) must-have. It also requires you to have this inside the PhoneApplicationPage
XML element:
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
Just like in the previous post, you can listen for the appSettings
changing, and you can access the current setting with UserSettings.Instance.QuestionDirection
.
Again, this isn't really that difficult, but whenever I need to do it I find this code and copy it, so now you can too!
--
See all my Windows Phone development posts.
I'm planning on writing more posts about Windows Phone development - what would you like to hear about? Reply here, on twitter at @gregstoll, or by email at ext-greg.stoll@nokia.com.
--
Interested in developing for Windows Phone? I'm the Nokia Developer Ambassador for Austin - drop me a line at ext-greg.stoll@nokia.com!
Windows Phone: how to get accent color in your app
Mood: cheerful
Posted on 2013-01-02 23:20:00
Tags: windowsphone wpdev
Words: 227
As I mentioned in my post about icon design, I'm terrible at art, and I'm also not very good at making apps attractive.
But I do know that a splash of color helps, and since Windows Phone has user-selectable themes, you can use the theme accent color and make the app look "at home" on the phone, since the Start screen will have the theme accent color all over the place.
In XAML, this is very simple, for example for a TextBlock you can use Runs like:
<TextBlock TextWrapping="Wrap">
<Run>Better with a</Run>
<Run Foreground="{StaticResource PhoneAccentBrush}">splash</Run>
<Run>of color!</Run>
</TextBlock>
Brush accent = Application.Current.Resources["PhoneAccentBrush"] as Brush;
reviews: Fitbit One, Nokia Lumia 920, Lenovo Thinkpad T430
Mood: cheerful
Posted on 2012-12-17 16:21:00
Tags: reviews windowsphone
Words: 873
I got a few new things recently - here are my thoughts on them:
Fitbit One - I lost my Fitbit back in September, and my FitCalendar has been awfully sad since them. I ordered a Fitbit One and it just arrived a few weeks ago. Here are the main differences from my thoughts on the original Fitbit:
- It automatically syncs with iPhones and iPads (and soon some Androids), but sadly not Windows Phone. (yet? please?) And now, instead of working with the old dongle, it comes with two - one tiny one for syncing, and one for charging. Why are there two of these?? It's bizarre. At least you can now order extras of either of them separately, but now I have to keep track of two tiny dongles...
- They redid the design of the clip, and while it's a little harder to get out, it's more than made up for the fact that the clip now feels very very secure. Given that almost everyone I know who had a Fitbit lost it, this is encouraging.
I can definitely tell that my steps had dropped off when I lost my Fitbit...I'm working my way back up to 70K steps a week (almost made it last week!), so I really feel like having the device and paying attention to the numbers makes me healthier.
---
Nokia Lumia 920:
As the Nokia Developer Ambassador for Windows Phone, I was excited to get one of these. After having used it for a few weeks, I'm even more excited - here are my top reasons:
- The phone just feels very high-quality - the curved glass front almost melts into the sides.
- The battery life has been very good - after a normal day (for me) I usually have 60-70% left.
- Wireless charging - woo! That plus NFC enables some cool things like the JBL PowerUp Wireless Charging Speaker, which is exactly what it sounds like.
- Resizing live tiles is surprisingly fun, and really makes the whole Start screen more powerful since I can leave the truly live tiles big, and make the ones that are just links to apps small.
- Internet Explorer lets you choose what button to put by the URL bar (instead of refresh/stop), and I'm using the button that brings up open tabs, which I hit ALL THE TIME and it's so convenient!
- The camera is quite good - looking forward to really putting to the test when I travel next month.
- The feature I'm way more impressed with than I thought is the ability for apps to set the lock screen background, and Weather Flow lets you show the Bing picture of the day and the upcoming weather forecast. Very handy!
---
Lenovo Thinkpad T430
A few years ago I bought an HP laptop, as a gaming laptop that ran Windows. Now that I'm using my laptop for Windows Phone development, it really got to be painful, because:
- It was 17" and heavy. That was fine when I never took it anywhere, but now that I'm going to more Windows Phone events, it got irritating.
- The battery life was somewhere between unacceptable and pathetic. Admittedly, this might be partially my fault because I left it plugged in most of the time (that's bad for batteries, right?), but if I was doing any sort of development it lasted around 2 hours. Although one of the reasons was...
- It was really really slow most of the time (so I couldn't use the battery-saver mode, as that made it laggy enough that I wanted to throw it out the window). Sometimes Visual Studio would take a minute to response as the hard drive spun up.
So! I wanted something that was smaller, faster, with better battery life (and one that came with Windows 8). I looked at a bunch of options (including the Samsung Series 9 that David has and loves), but ended up with a tricked-out Lenovo Thinkpad T430, as recommended by The Wirecutter. Here's what's awesome about it:
- I was able to get an 180 GB SSD (most ultrabooks only came with 128 GB, which might not be enough after installing Visual Studio, etc., etc.) It even comes with a DVD drive (which is powered down unless it's in use), and you can swap that out for an extra hard drive if you need to, so I have some room to grow.
- It's not as light as an ultrabook, but it is pretty light. It has a 14" screen with 1600x900, which seems to be a good balance between portability and having enough real estate.
- I got a "real" graphics card in it (instead of just the onboard video), which means I can hopefully play games on it. Like SimCity which I am extremely excited about! But it has NVIDIA Optimus so it uses onboard video for better battery life unless you're playing a game or something.
The battery life is very impressive - I can use it all day with ease, and even into two days depending on what I'm doing.
The one thing I'm a little sad about is that it doesn't have a touchscreen, but I'm very happy with literally everything else about the laptop. (plenty of USB ports! fingerprint reader! charges quickly! has separate buttons for mute and volume controls!)
Two awesome things by Ryan North (of Dinosaur Comics fame)
Mood: okay
Posted on 2012-12-14 15:23:00
Words: 150
If you haven't read Dinosaur Comics you should give it a try! (although, today's is pretty confusing; MAYBE try a different day's instead?)
1. He has a Kickstarter for To Be Or Not To Be: That Is The Adventure, which is a *ahem* choose-your-own-path-style-adventure based on Hamlet! You can be Hamlet or Ophelia or King Hamlet (who dies at the beginning!) and the choices continue from there! It looks super awesome, and if you scroll through the updates people are collectively playing through one path.
2. On said Kickstarter page I saw a reference to B^F which is Mr. North's reading of the novelization of Back to the Future, which is, as he puts it, "insane", and after reading a lot of his posts I can't help but agree! It's also available in ePub/Kindle form for the low price of $3, so there's really no reason not to do that!
Windows Phone: adding settings to your app
Mood: cheerful
Posted on 2012-12-13 23:09:00
Tags: windowsphone wpdev
Words: 861
I like including a lot of settings in my apps - it gives the user a lot of control about how the app looks/behaves. But it's a little tedious to add the code to save them to Isolated Storage, notify when they've changed, and allowing the user to change them on a settings page. After just doing this for a new release of PhotoNotes, I thought I'd write a step-by-step guide to adding settings to an app.
In this example, I was adding a boolean setting for whether PhotoNotes's tile should be live. So, let's get started!
Step 1: Add a UserSettings class
This class will provide access to the settings and handle saving/loading to Isolated Storage, as well as have an event for when the settings have changed.
Here's the actual UserSettings class for PhotoNotes. If you prefer you can also download UserSettings.cs here.
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.IO.IsolatedStorage;
using System.Collections.ObjectModel;
namespace NoteLens.wp8
{
public class UserSettings
{
IsolatedStorageSettings settings;
public event EventHandler SettingsChanged;
const string TilePictures = "TilePictures";
const bool TilePicturesDefault = true;
public bool ShowTilePictures
{
get
{
return GetValueOrDefault
}
set
{
if (AddOrUpdateValue(TilePictures, value))
{
Save();
}
}
}
public static UserSettings Instance = null;
// This can't be private because it's called from the XAML in App.xaml,
// but don't create one of these in code!
public UserSettings()
{
try
{
settings = IsolatedStorageSettings.ApplicationSettings;
if (Instance == null)
{
Instance = this;
}
else
{
System.Diagnostics.Debug.Assert(false,
"Created multiple UserSettings!");
}
}
catch (Exception)
{
settings = null;
}
}
///
/// Update a setting value for our application. If the setting does not
/// exist, then add the setting.
///
///
///
///
public bool AddOrUpdateValue(string Key, Object value)
{
bool valueChanged = false;
// If the key exists
if (settings.Contains(Key))
{
// If the value has changed
if (settings[Key] != value)
{
// Store the new value
settings[Key] = value;
valueChanged = true;
}
}
// Otherwise create the key.
else
{
settings.Add(Key, value);
valueChanged = true;
}
return valueChanged;
}
///
/// Get the current value of the setting, or if it is not found, set the
/// setting to the default setting.
///
///
///
///
///
public T GetValueOrDefault<T>(string Key, T defaultValue)
{
T value;
// If the key exists, retrieve the value.
if (settings.Contains(Key))
{
value = (T)settings[Key];
}
// Otherwise, use the default value.
else
{
value = defaultValue;
}
return value;
}
///
/// Save the settings.
///
public void Save()
{
settings.Save();
EventHandler settingsChanged = SettingsChanged;
if (settingsChanged != null)
{
settingsChanged(this, new EventArgs());
}
}
}
}
The bottom part of this file (from the constructor down) is pretty boilerplate. If you want to add a new setting, all you have to do is define a new key name (like TilePictures here), a new default value (like TilePicturesDefault) and the name of the property that exposes it (like ShowTilePictures) - then you can just copy and paste the existing property and make the three replacements.
Step 2: Define a resource for your UserSettings
This will let you easily access the UserSettings from XAML and code.
In your App.xaml, first make sure you have a namespace added for wherever your UserSettings class is. I didn't, so I had to add
xmlns:nl="clr-namespace:NoteLens.wp8"
to my <Application> tag.
Then, inside the <Application.Resources> tag, add
<nl:UserSettings x:Key="appSettings"/>
Step 3: Add a control to change the setting to a page
I already had an About page in the app (possible future post!) which used a Pivot control, so I just made the settings a new PivotItem under that.
The best way to show a Boolean value is to use a ToggleSwitch, which is part of the Windows Phone toolkit which is put out by Microsoft. So first, make sure you have that installed - I had to install it with NuGet. Now, here's the XAML for adding the new PivotItem and control:
<controls:PivotItem Header="settings">
<StackPanel Orientation="Vertical">
<toolkit:ToggleSwitch IsChecked="
{Binding Source={StaticResource appSettings},
Path=ShowTilePictures, Mode=TwoWay}">
Live Tile
</toolkit:ToggleSwitch>
</StackPanel>
</controls:PivotItem>
Here we're binding to the appSettings resource we declared in step 2, and through the magic of data binding this will show the current value of the setting and also let the user change it.
Step 4: Listen for when the setting changes
We're almost done! In this case, I wanted to know when the user changed the setting so I could immediately update the tile to make it live or not. So, in About.xaml.cs (the codebehind for the About page) I made the following changes:
To OnNavigatedTo(), added
UserSettings.Instance.SettingsChanged += appSettings_SettingsChanged;
To OnNavigatedFrom(), added
UserSettings.Instance.SettingsChanged -= appSettings_SettingsChanged;
And finally added the method:
void appSettings_SettingsChanged(object sender, EventArgs e)
{
Util.UpdateLiveTile();
}
Step 5: Use the setting in code
This is obviously very app-dependent, but to get the value of the setting in code you should use
UserSettings.Instance.ShowTilePictures
It's important to always use UserSettings.Instance and not create a new UserSettings class instance to access the settings, otherwise your SettingsChanged events might not fire in the right places. I added an assert to ensure that we only ever create one of them, and that will happen when the app resources are created from App.xaml.
In this example, we just added a boolean setting - see this follow-up post for adding an enum-like setting.
--
See all my Windows Phone development posts.
I'm planning on writing more posts about Windows Phone development - what would you like to hear about? Reply here, on twitter at @gregstoll, or by email at ext-greg.stoll@nokia.com.
--
Interested in developing for Windows Phone? I'm the Nokia Developer Ambassador for Austin - drop me a line at ext-greg.stoll@nokia.com!
PhotoNotes now available in the Windows Phone Store!
Mood: proud
Posted on 2012-12-11 19:09:00
Tags: windowsphone projects
Words: 55
PhotoNotes is now available in the Windows Phone Store!
Formerly known as PictureNotes, here's a description from the official website:
Write notes on your saved pictures on the go! PhotoNotes is a great way to remind yourself of what you were taking a picture of. You can type a caption or record an audio note.
linkstravaganza: defeating the norquist pledge, morgan freeman in an LGBT ad, C++ pitfalls
Mood: tired
Posted on 2012-12-11 15:55:00
Tags: gay links
Words: 274
Apparently I'm only doing these once a month now. That's OK! Here goes:
Economics:
- America...And The Rest - hey, looks like stimulus was a better choice than austerity, no? Maybe there's something to this Keynesian stuff.
- Grover Norquist, author of the "never ever vote for a tax increase" pledge, is facing somewhat of a revolt in the Republican party. Which I think is good: the idea that you could sign a pledge saying never to vote for anything, no matter what the circumstances, seems rather short-sighted. (I'm talking about economics here, not, say, civil rights and such)
- Warren Buffett still thinks we need higher taxes on the wealthy.
Gay:
- A long article about the recent marriage initiative fights in the four states. Spoiler alert: we win!
- Now that same-sex marriage is legal in Washington state, here are pictures of happy people, including Dan Savage!
- And since the Supreme Court will be hearing same-sex marriage cases, the Onion gets a scoop with an editorial from Clarence Thomas: I Get To Determine Whether Gay People Can Marry.
- Morgan Freeman narrates an LGBT equality ad! First they ignore you, then they fight you, then Morgan Freeman does an ad for you, then you win.
Other:
- I found this page of C++ pitfalls both enlightening and depressing. There seem to be an unbounded number of very small mistakes you can make that still compile and yet act very wrong.
- A long story about the origins of Lost, at Grantland of all places.
- The new SimCity is coming in March! Check out this 10 minute strategy video to get a feel for what it will be like. I am excited!
Windows Phone: implementing fast app switching (needed for DVLUP!)
Mood: tired
Posted on 2012-12-10 23:30:00
Tags: windowsphone wpdev
Words: 348
Since my last post talked about making a Live Tile update, which is needed for the DVLUP challenges, I thought I'd talk about a different requirement - Fast App Switching.
The key to implementing Fast App Switching is understanding the lifecycle of an app. The MSDN page on App activation and deactivation for Windows Phone is an excellent guide, and I refer to it often. The table at the bottom of the page is a quick guide to what you need to do to support app suspend/resume, including Fast App Switching.
Here's a quick example in code. Let's assume the MainPage just has one TextBox on it whose contents we want to preserve if the user switches away from the app.
// a bunch of code omitted
public partial class MainPage : PhoneApplicationPage {
private bool _isNewPageInstance = false;
public MainPage()
{
InitializeComponent();
_isNewPageInstance = true;
}
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) {
base.OnNavigatedTo(e);
if (_isNewPageInstance)
{
if (State.Count > 0)
{
// this assumes you always save everything
// if not, check with State.ContainsKey()
myTextBox.Text = State["TextBoxContents"] as string;
}
}
}
protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e) {
base.OnNavigatedFrom(e);
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
{
// save state for all controls
State["TextBoxContents"] = myTextBox.Text;
} else {
// navigating back, so don't save any state
State.Clear();
}
}
}
The Eyre Affair review
Mood: okay
Posted on 2012-12-09 16:28:00
Tags: reviews books
Words: 33
The Eyre Affair by Jasper Fforde
My rating: 5 of 5 stars
Delightful book. The premise is outlandish but the author really sells it well and sucked me in!
View all my reviews
Windows Phone: updating your app's tile, simply (needed for DVLUP!)
Mood: cheerful
Posted on 2012-12-08 23:54:00
Tags: windowsphone wpdev
Words: 343
Windows Phone Live Tiles are great, but setting up push notifications is a lot of work, and even running a background agent comes with limitations. There are two easier ways to update your live tile:
- One way is to just update it when the app runs. This is not as appealing to the user as one that updates in the background, but for some apps it might be good enough. For example, I'm going to do this in my Marriage Map app, as the data doesn't change very often.
To do this, here's some sample code:
var tileEnum = ShellTile.ActiveTiles.GetEnumerator();
tileEnum.MoveNext();
var tile = tileEnum.Current;
#if WP8
FlipTileData ftd = new FlipTileData();
#else
StandardTileData ftd = new StandardTileData();
#endif
// This next part is app dependent
ftd.BackContent = "back of a medium tile";
#if WP8
ftd.WideBackContent = "back of a wide tile";
#endif
tile.Update(ftd);
Include all 3 sizes of Live Tiles (must animate between at least 2 frames within the tile space with data, images, or text).so if you want to earn rewards during Pointstravaganza, you'll need to do something to make your tiles live!
PictureNotes: new Windows Phone app submitted! and on omitting features
Mood: accomplished
Posted on 2012-12-02 00:08:00
Tags: essay windowsphone projects
Words: 172
I just submitted the app I've been working on, PictureNotes, to the Windows Phone Store!
The idea is that if you're on vacation or somewhere you're taking a lot of photos, you can write captions or record voice notes right then. (I got the idea when we were on vacation and I took a lot of photos :-) )
I originally imagined the app as a Lens app (which is new in Windows Phone 8), but I ran into some issues with orientation changes - the live picture from the camera kept moving around. It mostly worked, but it was not a great user experience and since you can get most of the functionality by editing existing photos, I decided it wasn't worth making the app look bad by including the Lens part. (of course, now that I think about it I might have a way to fix it...maybe for the next version!)
Anyway, I don't think it'll be useful for that many people, but it will be useful for me, and that's good enough.
Big new promotion for Windows Phone apps: Pointstravaganza!
Mood: excited
Posted on 2012-11-30 21:07:00
Tags: nokia windowsphone
Words: 131
If you've been thinking about writing a Windows Phone app (or already have some in the Windows Phone Store), there's a big new promotion happening in DVLUP!
From now until the end of the year, you can earn 1000 XP for _each_ new WP8 app or game, and an additional 1000 XP for _each_ existing WP7 app or game updated to WP8!
For some perspective: 750 XP will get you a $50 Amazon or Starbucks gift card, or a year of Xbox Live. There are a bunch of other great rewards you can earn - check them out here.
There's more information at the official Pointstravaganza blog post. If you're planning on working on an app, drop me a line - I'd be happy to help or test or whatever I can do!
O'Reilly books 50% off - good Windows Phone 8 book available!
Mood: happy
Posted on 2012-11-26 13:24:00
Tags: windowsphone wpdev
Words: 49
O'Reilly is having a big Cyber Monday sale today - everything's 50% off! I'd recommend Windows® Phone 8 Development Internals - it's still a "preview", but if you buy it now you get access to the full book when it's done. I've read the preview and so far it's quite good.
Designing an icon for your Windows Phone app
Mood: cheerful
Posted on 2012-11-25 20:04:00
Tags: windowsphone wpdev
Words: 748
I'm terrible at art, so when I'm developing an app I've learned to dread when it comes time to design an icon. Fortunately, I've done it enough times that I've got a decent process down. Hopefully this will help you get at least halfway-decent icons for your Windows Phone app!
Step 1: Install GIMP - it's free and works great as an icon creation tool. I'm by no means an expert at it, but if you've never used it before I'd recommend looking at some basic tutorials, like "The Basics" (just ignore all the drop shadow stuff!) and "GIMPlite Quickies" for a bit of image manipulation.
Step 2: Find a few icons to represent the app - this can be the hardest part, depending on what your app does. Here are some sites I've had success with:
Small icons
- Glyphish ($25, or free with attribution) - the icons are small, but there are a lot of them. I've used Glyphish icons in a few of my apps, including the one I'm working on now. It's worth $25!
- Syncfusion Metro Studio (free) - 600 Modern-style icons
- Silk (free) - 700 icons, although they're all rather small at 16x16
- Ikonic ($5 for PNGs) - 150 icons that are a bit larger
- Batch (now free!) - 300 icons, although they appear to require Photoshop
- The Noun Project (prices vary, many are free) - many black and white icons. These are good choices if you go with a transparent icon (described later)
Bigger icons
- Cutcaster (prices vary) - I used Cutcaster extensively for the city backgrounds in FlightPredictor for Windows 8. They have a pretty good selection, the pricing is reasonable, and many images don't require any sort of attribution.
Step 3: Decide on a full-color or transparent icon
There are two styles I consider for icons: a "full-color" one, such as the one for FlightPredictor:
or a "transparent" one, such as the one for this new app I'm working on:
In this one, the icon itself is white, and the background is transparent (I made it brown here so it's visible) and matches the theme color of the phone. This is a nice effect, especially if the icon itself is fairly simple. I didn't use this for FlightPredictor because the clock icon would have been obscured.
If you do decide on a full-color icon - don't forget that gradients look out of place on Windows Phone! The FlightPredictor icons on other platforms has a slight gradient over the length of the plane, but I changed that to a solid color for Windows Phone.
Step 4: Create a blank app icon
It's always easiest to start with the largest icon you'll need and scale down from there. For Windows Phone 7 this is 173x173, and for Windows Phone 8 this is 336x336 for the medium tile. (for the large tile I'd copy from the medium one into the large one, which is of size 691x336) The sizes are different for iconic live tiles - see this page on tile resolutions.
For transparent icons, it's easiest to create the app icon with a transparent background, then paste the icon parts in and turn them all white.
Step 5: Copy the parts into the app icon
If you've followed the steps until now, this shouldn't be that hard. Keep in mind that you will need to leave some blank space at the bottom of the tile for the name of the app. Be sure to keep separate layers for the different source icons in case you want to move them around later.
Step 6: Save it
Be sure to keep the original .xcf, as this will retain the layer information. Then save copies as .png at the various resolutions you will need.
--
As you can see, it's still a somewhat long process, but with the steps hopefully it won't be too painful. Feedback is welcome: post here or at @gregstoll on Twitter. And if you're interested in getting started with Windows Phone development, and if you're in the Austin area, email me to get access to DVLUP!
Edit: Randall Arnold points out that Inkscape is a great free tool for doing vector art, which gives you much better quality (and resolution-independence).
--
See all my Windows Phone development posts.
I'm planning on writing more posts about Windows Phone development - what would you like to hear about? Reply here, on twitter at @gregstoll, or by email at ext-greg.stoll@nokia.com.
--
Interested in developing for Windows Phone? I'm the Nokia Developer Ambassador for Austin - drop me a line at ext-greg.stoll@nokia.com!
Got a Wii U, a bit irritated at Fry's
Mood: irritated
Posted on 2012-11-18 11:56:00
Tags: rant wii u
Words: 260
I was happy after we were able to preorder our Wii U yesterday at Fry's to pick up today. However, I possibly should have read the fine print a little better.
The Wii U comes in 2 versions - the "basic" for $300 and the "deluxe" for $350. The deluxe is clearly the better option - it comes with Nintendo Land (a game that costs $60) and the console itself has 32 GB of storage instead of 8, and a vertical stand, and maybe some other stuff. (spoiler alert: I don't know exactly what you get with the deluxe version!)
So when we ordered yesterday, we got a bundle that came with a Wii U, Nintendo Land, the new Mario game (which we were going to get anyway) and a "Wii Wand pack", which we don't really need since we already have 4 Wii controllers, but if it was rechargable that would be a nice bonus.
It turns out that they sold us the basic package, and added the two games at full price. And the "Wii Wand pack" is a third-party controller that is not rechargable. (I have a strong aversion to third-party controllers, for historical reasons)
I guess I haven't bought a console on launch day...umm, ever? I assume it's standard practice to bundle it, but it seems a bit cheeky to sell us the cheaper bundle so they could charge us more for the game. Sigh.
(and I'm patching now! What a wonderful world we live in, in that everything video game related requires patches before you can play...)
This backup was done by LJBackup.