Apr 262015

Google Play apps made with HTML5

Besides resetting my travel blog, I also completely wiped out my game dev blog. The following post was about the only one that was at all useful to other developers, so I wanted to recapture it here. In any case, if you’re using HTML5 to build your mobile app, here are a few tips to take into consideration to get your project running smoother:

1. Use native code for audio
I know the whole point of using HTML5 is so you don’t have to muck about with Java or Objective-C, but I’ve found HTML5’s audio tag to be wonky and unreliable. You get better results using native code to play sound effects. In Android, you can bridge the gap between the two with a special JavaScriptInterface class, but Objective-C isn’t as friendly. You have to trigger a URL redirect, then immediately cancel it and parse your data from the URL string. It’s ugly… but it works.

2. Use .bind(‘touchstart’) instead of .click()
A click event in Javascript is somewhat slow on a touch screen. It can be especially frustrating to try to “click” on something that is quite small, whereas a “touch” is much more forgiving and faster to respond.

3. Force hardware acceleration
Any animation or transition (sliding, fading, etc.) can chug quite a bit on lower-end Android devices. Applying the CSS property -webkit-transform: translateZ(0) to any element that moves can force the device to use hardware acceleration. Note that this is really only necessary for Android apps. Using it for iOS may actually cause your app to perform worse.

4. Disable touch highlighting
This is another Android-only fix. Whether your objects are clickable or touchable, Android devices like to highlight them in orange. Not only is this highlight super ugly but it can make clicking/touching something harder than it should be. Use the CSS property -webkit-tap-highlight-color: rgba(0,0,0,0) to remove it.

5. Set constraints on WebView
And now for an iOS-specific issue. An annoying problem I encountered in Xcode was that its WebView element doesn’t automatically take up the size of the screen. By default, its width and height are hard-coded, and it’s not immediately obvious how to set these values to “100%.” Hint: you don’t. You set constraints on each of the borders, instead.

6. Remove folder paths
Another oddity in Xcode is how it collapses all of your directories when you build your project. As a web developer, I naturally group things into folders. One for images, one for JS files, one for CSS files, etc. Xcode completely ignores this, putting everything into one folder. So not only do you need to change every path in your code to not include directories anymore, you also have to be careful you don’t have two files with the same name. Xcode won’t differentiate between folder/index.html and index.html and will only render one.

7. Don’t use CSS media queries
Let’s end on a cross-platform tip. Traditionally, we would write something like @media screen and (max-width: 400px) to tailor CSS to different screen sizes. But I’ve noticed half-tablets like the Kindle Fire ignore this rule, probably because it’s basing it off of the resolution of the screen and not the actual width in pixels. If you run into this problem, check the width in Javascript instead. For example: if ($(window).width() > 600) { $(‘body’).css(‘font-size’, ‘2em’); }

Apr 222015

Starbucks sign in China

Here’s another article I salvaged from the old China blog. I hesitated keeping it, because there are already thousands of websites to help you learn survival Chinese. But I know Mandarin is a big undertaking, and you may not have the time (or patience) to study the college-level load that everyone else recommends. So how about just five phrases and five characters? You can do five each, no sweat. First, the five most important phrases when traveling in China:

1. Duo shao qian? (How much does it cost?) <audio>
If you’re not very good at remembering phrases, then focus on this one. It’s the most important Chinese you can know, whether you’re haggling at a market or trying to buy a banana from a street vendor. The interesting thing about this phrase is that “duo” means a lot, and “shao” means a little. Put together, they become a question about how much money (qian).

2. Cesuo zai nali? (Where is the bathroom?) <audio>
You could just as easily scream, “WC!” while holding your crotch and get the same point across, but the structure is useful for asking where other things are. Just replace “cesuo” (toilet) with a different object or place. Of course, this does nothing to help you understand the directions given to you. Oh well! Note that the sentence order for this is backwards from English: Bathroom at where?

3. Wo yao neige. (I want that.) <audio>
Rather than bother figuring out what the names of all the foods are, it’s easier to just point at things and say, “I want that. And that. And that. And that.” You’ll feel like a little kid barely learning to speak, but that’s the fun part! To break it down, “wo yao” means “I want,” and “neige” means “that.”

4. Ting bu dong. (I don’t understand.) <audio>
As much as I don’t like having to use this phrase (or hearing it from other people), it’s a good one to know. Directly translated, it means “hear don’t understand” and is the best way to deter someone from speaking Chinese with you. You’ll frequently catch Chinese people saying this about you, too. As in, “This guy doesn’t understand Chinese. Not worth my time.”

5. Xiexie ni. (Thank you.) <audio>
Obviously, there’s a lot more you could learn. Nothing simple charades can’t compensate for, though, right? In the end, you’ll appreciate knowing how to say thank you more than something like, “Bring me the bill,” or, “Who stole the cookie from the cookie jar?” The people you thank will appreciate your efforts to speak Chinese, as well. You can get by with just “xiexie,” but for those extra formal moments, you can tack on a “ni” (you).

And now to learn a couple of characters. Yes, there are thousands of characters in the Chinese language, and you’ll never memorize them all. Sorry to burst your bubble. But these are a great start and should still help you in your travels:

1. 女 (female)
The most obvious reason why you would want to know this is to avoid accidentally stepping into the wrong restroom, though the picture of a blue man or red woman is usually a giveaway. But there’s more! You wouldn’t want to find yourself buying a pair of the opposite gender’s pajamas, would you? How embarrassing! Not to mention the character 女 appears as a radical in many, many other characters, so it’s a good one to know.

2. 肉 (meat)
Not every restaurant has an English menu, or even a menu with pictures, but by the time you realize this, it’s too late to turn back without hurting someone’s feelings. So if you’re a vegetarian, absolutely do not order anything with 肉 in its name. And if you do eat meat, you’re more likely to end up with a good dish by pointing to 肉 than anything else.

3. 下 (down/next)
This is a very versatile character. Not only does it mean down or lower (as in the lower level of a building, the lower bunk bed, etc.), it can be used to denote the end of something, like the end of work or the end of the day. Oh, it gets even better! 下 also means next. This is important for knowing which button to click when using a Chinese computer, sure, but it’ll let you keep tabs on the next bus/train stop, as well.

4. 车 (car/vehicle)
I debated whether or not to include this one, but it’s actually a useful character for finding the bus station, the train station, or even a taxi, since 车 appears in the name of all of these modes of transportation. It can be daunting to make sense out of a Chinese bus stop sign, but if you’re desperate to get out of town, looking for the stop that has 车 in the name is a good place to start.

5. 园 (park)
This is another one that might seem out of place on such a cramped list, but the more I think about it, the more I realize 园 has helped me find the right bus stop on several occasions. When traveling as a tourist, you’re likely to visit a lot of gardens and parks, or at least use them as markers to find other areas. The names of these scenic spots tend to end with 园, which solidifies this as one of the most important characters to be able to recognize.

Apr 182015

Picture of Huanglong in China

This is a carryover from one of my blog posts of yesteryear, though that particular list was limited to just five entries. It can be pretty hard to take a country as huge and diverse as China, though, and whittle it down to only five or ten things to see. But if you’re planning a trip to China and don’t have two years to see it all, definitely take some of these highlights into consideration:

10. Tongli
There are plenty of “water towns” in China, and I’ll admit I haven’t seen them all. I did have the most fun at Tongli, though, because I went during the off-season when the crowds were tolerable. But you could probably choose any one of these. They’re all very rustic and quaint, and the canal setting offers a picturesque look at life outside the metropolitan cities.

9. Slender West Lake
West Lake in Hangzhou is a bigger and more famous body of water, but I prefer Slender West Lake in Yangzhou. The tighter environment makes it easier to appreciate the scenery on the other side of the lake. And the park ends at one of the more interesting temples in China: Daming Temple with its tall, square-shaped pagoda.

8. Zhangjiajie National Forest
This was the first national park dedicated in China. As such, it’s very busy and overly commercialized, which keeps it a bit lower on my list. But it’s also like nothing you’ve ever seen before. The tall, thin spires covered in vegetation are absolutely stunning.

7. Li River
Guilin is surrounded by odd-shaped mountains. You don’t necessarily need to take the Li River cruise to see them, but you’ll get some of the best photo opportunities along the ride. The cruise also drops you off at Yangshuo, a smaller town that’s worth spending a few days in to really get to know the area.

6. Lingshan Buddha
China is home to the tallest statue in the world (the Spring Temple Buddha). Unfortunately, I have not seen that statue. But I did see the bronze, 88-meter tall Lingshan Buddha in Wuxi. And 88 meters is no laughing matter! It’s an impressive statue. It’s also not in the middle of nowhere, unlike the Spring Temple Buddha. Wuxi has a lot of other fun things to see while you’re there.

5. Great Wall of China
Obviously, if you’re going to go to China, you have to see the Great Wall. Many of the other famous attractions (like the Terracotta Warrior Museum) ended up being a disappointment for me, but the Great Wall was the one thing that exceeded my expectations. I’ve been to it three times now and still wholeheartedly recommend it.

4. Huangshan
Huangshan, also known as the Yellow Mountains, has a lot of cultural significance. This is where the iconic “welcome pine” comes from, after all. It’s also just a really impressive mountain range, looking like an enormous pile of leftovers from other mountains.

3. Ice and Snow World in Harbin
Every time I see pictures of Harbin, I have a hard time believing I was actually there. The whole city felt like stepping into the ice world of a video game. The snow and ice sculpture venues were particularly surreal, because they’re so different from all the other tourist spots in China. It’s damn cold, but this seasonal festival is well worth the visit.

2. Huanglong
Huanglong, meaning “yellow dragon,” gets its name from the bright blue pools of water that look like the scales of a yellow-skinned dragon. The scenery here isn’t very diverse, though. It’s just one long trail full of blue pools, one after another, all the way to the bottom of the mountain. But, hey, that’s still pretty incredible.

1. Jiuzhaigou Valley
Usually, I would pair this with Huanglong, because they’re in the same vicinity and both feature gorgeous blue water. But Jiuzhaigou wins for being so much bigger and offering so much more. This is the most beautiful natural park I’ve ever seen. It makes me especially happy to see China taking such good care of it, since their other national parks tend to get very polluted.

Apr 042015

For the past year, I’ve been absolutely enamored with electro swing music and have spent a lot of time trying to find additional artists I may have missed on the first few passes. If you’re in the same boat, then hopefully this list saves you the trouble and introduces you to just what you were looking for:

To start with, Caravan Palace is by far my favorite electro swing group. Their second album in particular is outstanding. And Swingrowers, with their second album, is quickly becoming just as good. If you’re new to electro swing, you have to give these two a try.

That said, I think Parov Stelar is a name that comes up more often in swing discussions. Yes, his music is good, though I find his discography kind of annoying to sort through. Cut straight to The Paris Swing Box if you’re not sure where to start. I’d also place Klischee (from the video) and Lazlo on the same level as Parov.

When it comes to electro swing, though, many artists simply remix old songs, which can be pretty hit and miss. Swing Republic and Tape Five do this a lot, but it’s their completely original swing albums (Midnight Calling and Swing Patrol respectively) that make them worth checking out.

On a similar note (but perhaps a little more pop-like and silly) are 11 Acorn Lane, Dimie Cat, and Alice Francis. All five artists tend to feel more like “modern swing” than electro, but that’s kind of why I like them. They’d be a good way to wean yourself onto the heavier stuff.

Then if you’re still itching for more swing, I recommend looking into Dimaa, Paul J. Borg, and Good Co. They have a few really good songs each, but their albums overall are a little weaker compared to the rest.

And if you’re still still needing more, RetroElectric Big Band, Reliable Source Music, Deep East Music, and the trio of Guido Spumante, Pepe Spumante & Junior Di Luca have their own swing albums that, while not featuring any standout hits, make for decent background music.

Mar 312015

Z Nation

This is going to double as my Season 5 TWD review and Season 1 Z Nation review, so… spoilers, y’all. And I know upfront that comparing these two isn’t exactly fair. Each show is very different and accomplishes different things. But when I came across Z Nation on Netflix, I found myself enjoying it more than The Walking Dead. To be clear, I’m not a TWD hate watcher. I think most people who get labeled as hate watchers actually want the show to be good. Because it occasionally is pretty good. But it makes so many frustrating mistakes and frequently fumbles promising opportunities.

For instance, The Walking Dead has long lacked a purpose (other than survival). So when Eugene mentioned a cure in Season 4—despite every viewer knowing he was full of it from the start—that at least gave the show a direction. But the writers revealed Eugen’s secret too soon, and before Season 5 was even half-over, we were back on the road, dragging our feet again. It just feels like TWD wastes so much of the viewer’s time. In Season 4, we spent two full episodes following the Governor, only to learn he hadn’t changed at all, and then he died (thank goodness). In Season 5, we spent several episodes in a hospital, finally getting to know Beth, and then she, too, died at the end of the arc… for no reason at all, really.

Characters in general tend to die for pretty stupid reasons on this show. It’s hard to buy into the importance of a character’s death when they died due to a major brain fart and lapse in judgement. The only death in Season 5 that was effective for me was Noah’s, though I still don’t like that he died so soon (we suffered through Beth’s story to get him, and then he left before he became useful). But Noah died under realistic circumstances, because some other asshole got scared and ditched him and Glenn. So that death made sense (and really sucked, but for the right reasons). I just wish other deaths left me feeling sad instead of annoyed.

In fact, the death that affected me the most on the series was Shane’s back in Season 2. Watching him slowly lose his mind and need to be put down by his “best” friend kind of bothered me and stuck with me for several days. Interestingly, there was a scene in Z Nation, a much more campy and silly zombie show, that struck me the same way. It was the scene where Murphy robbed the mother and daughter and then let the zombified husband into the building to supposedly finish them off. It was such an evil thing for him to do and was almost out of character, until you see a tinge of regret in his face when he returns to his usual group.

It really surprised me that Z Nation could be moving, because, frankly, it comes across as such a mindless, low-budget popcorn flick. It was produced by Sharknado studio, The Asylum, after all. But the show has some really good ideas. I mean really, really good ideas. The character of Murphy alone is great. It’s a lot of fun to watch his transformation from reluctant anti-hero to zombie god. Seeing him commiserate with zombies is equally funny and depressing. I also felt like their cannibal story was more macabre and believable than TWD’s. There’s even an episode where a cult leader convinces his followers to willingly turn into zombies by committing suicide. Now that’s perfect zombie apocalypse material.

Admittedly, though, Z Nation’s execution is pretty weak. Some storylines fall horribly flat (the Groundhog Day episode in particular was pretty lame), and while I appreciate their attempts to keep things light, not every joke or gag is a winner. The effects are hit and miss, too. Radioactive zombies in a nuclear power plant sound cool, but the end result just looked like a bunch of extras broke glow sticks on their shirts. Given that The Walking Dead has a bigger budget and better talent, I’d love to see them tackle some of the same ideas.

The sad thing is, The Walking Dead has stopped wowing me. And that’s probably why I find Z Nation so refreshing. TWD has consistently played it safe since the beginning of Season 4. How awesome and bold would it have been if Season 5 opened with someone from Rick’s gang getting killed by the cannibals at the blood trough? But, of course, the cannibals are interrupted as soon as the last red shirt is dispatched. So now, every time a zombie falls on top of someone and pins them to the ground (which happens way too often), there’s no suspense. I know a major character will only die after they’ve 1) had some much needed character building and/or 2) do something stupid.

To be fair, if Z Nation makes it to five seasons, maybe it’ll suffer from the same problems. I wouldn’t be surprised. But for now, I appreciate the show’s willingness to take risks. Z Nation killed its two leaders pretty early on, after all, though those were the only major character deaths for the rest of Season 1 (not counting Cassandra’s ambiguous dead/alive state at the end). Z Nation even had the balls to do a zombie baby. Granted, that zombie baby was super cheesy and ridiculous, but I gotta at least give them credit for going there.

Still, they do overstep in places. For example, the world of Z Nation has zombie animals. Come on… If even the animals can turn into zombies, then it doesn’t make sense that humans can survive at all. They’d get overrun in no time. At least Z Nation tries to explain the discrepancy between fast and slow zombies by saying it’s based on how “fresh” they are. The zombies in TWD are wildly inconsistent, ranging from noisy, growling piles of mush to having superhuman strength and convenient stealth/ninja skills.

Ideally, it would be great to see a show that combines the best of both worlds. Well… do we really need another zombie TV show? I know zombies have been done to death in movies, but I like the serialization of TV where more elaborate and longer stories can be told. The Walking Dead still has some great characters, after all, that continue to evolve season to season. And Z Nation has proved how much fun it can be when there’s actually an end goal that isn’t so nihilistic. But until somebody does make the perfect TV show, I’ll continue to watch both.