Appcelerator: Working with JSON

While working with Appcelerator and viewing examples by others, I’ve noticed that many people seem to find the need to use an Eval() statement when parsing their remote JSON data. It works, but it can be done without using the Eval() function just to parse the JSON string data. Below is a very basic example showing the use of the parse function built into Titanium.

var loader = Titanium.Network.createHTTPClient();
loader.setTimeout(99000);
loader.open("GET","http://someplace.tld/json");

loader.onload = function(){
	data = JSON.parse(this.responseText);
	alert(data);
};

loader.onerror = function(){
  Titanium.UI.createAlertDialog({
  	message:"An error has occured.\nPlease try again.",
  	title:'Connection Error'
  }).show();
};

loader.send();

I’m Still Here

Wow, it’s been a while since I have updated this site. I recently switched to a new theme for more of a fresh look.

A lot has happened in the past few months. I graduated from college in January, and started working as a web/mobile developer with Stellar Blue Web Design. I have really been neglecting my own site, and plan on updating this page a lot more often with various new posts.

Server Move

I recently moved to a new server. If you are seeing this message, then you are viewing the site on the new server. Please let me know if you find anything that isn’t working.

Coming Soon

New Look

Soon I will be implementing a whole new look for this site.  I’ve had this theme for a few years now, and with time there comes change.

Android

public void R()
{
     String hello = "Hello, Android";
     System.out.println(hello);
}

I plan on updating this site more often with posts about Android development since I plan on launching another site for my Android software. Details on that will be released later.

Fall Already?

Where did the summer go.  The weather here seriously went from nice and warm to cold, windy, and rainy for the past week.  I really am not looking forward to winter either.

Java Browsing Reddit.com

On another note, Krista and I got a new Kitten named Java.  Here he is browsing Reddit.com  He was named partially after the Java programming language, and because of his colors.  As of right now, he is 3 months old and just keeps on growing.  When we first brought him home, Snickers was not a fan of him and would hiss and growl at him for at least a week.  Things are the opposite now.  They are pretty much best friends and play, sleep, and groom each other.  A nice thing about another cat it that we hope Snickers, who has become quite the fat kitty,  will get into better shape.  Another nice thing is that we no longer get awoken in the morning by a meowing cat who wants attention.

School and Snickers

I only have one more week of class for this year and I can’t wait.  Right now I have lots of studying, but it will be worth  it.  Right now I am in the process of trying to find another job for the summer so that I can afford to pay rent and such for the summer and next year.

On another note, Krista is working on building a nightstand out of cardboard for one of her classes.  Snickers, our cat, decided that she wanted to see if she could fit where the drawer goes.  She did, and she even posed for the camera.

edit: In order to conserve bandwidth, I removed the original picture.  It can still be viewed in the gallery though.

snickbox

RGB 7-Segment Display

I thought this was pretty interesting.  I’ve been working with 7-segment displays in class and I found someone who decided to make his own, but by using RGB LED’s.  I think you could do some pretty cool stuff since you aren’t then stuck with one color for your display.  Head on over and check out his post.

Server Move

I just got done moving the site to a new server. Everything seems to be running fine as far as I can see. If you encounter any errors, please contact me using the link on the right and let me know.

Thanks,
Ben

PS. I didn’t feel like this from moving it…