Integrating Facebook in Windows Store Apps Part 2 – Boredom Challenge Day 13

Standard

In my previous article, we’ve seen how we can sign in to Facebook, display our user’s data and share status updates in Windows Store apps. In this article, we will take our example app further by reading and displaying the user’s timeline and allowing the user to like/unlike posts, view a post’s comments and also add comments of his/her own.

1

We’ll start with the part 1’s completed app and continue from there. If you wish to go with the article step by step, you can get it here. If you’d rather not, jump to the end of the article for the completed source code. 😉

In this article, we will see how we can create Json classes for Facebook items, how we can read and display our user’s timeline, how we can like/unlike posts and how we can display and add comments. Apparently we have a lot of work to do.

➤ We’re basically making a Facebook client here…

Using a Public Dropbox File as Data Source for Our Apps – Boredom Challenge Day 5

Standard

If you are an individual developer (and especially a new-grad or a student), chances are you won’t have the resources to have a backend for your app, or maybe you need to just keep a small amount of information that you don’t want to get a server or hosting provider for. In this case, we can use an online storage service (SkyDrive, Dropbox, Google Drive, whatever you wish) to provide read only data for our apps.

1

For example, you want to create a TV app that gets video streams for multiple different TV channels. If you hard-code them into your app, you’ll start getting errors when a TV channel decides to change the address of their stream, and to replace it you have to change the link in your code and publish an update for you application (which will take several days, at least). Instead, you could put the links of the streams in a public file and then read them in your app when your app starts, which will give you the opportunity to change them any time, and your changes will be effective instantly. Heck, don’t just keep the links, keep the name and picture link and any other information you want about that TV channel (you can use XML or Json formatting) and then read all of this data in your app: This way you can instantly add new channels, edit existing ones or remove them whenever you want.

Therefore, if it is not a problem for the file to be publicly visible, this is a free (emphasis on free), quick, easy to use and effective method for providing read only data to our apps. In this article, we’ll use a public Dropbox file and see how we can use this in a Windows Store app.

➤ For bonus points, you can read app settings (like background color) from this file and change it whenever you want… 😛

Windows Store Uygulamalarında XML Serialization

Standard

Serialization, en genel haliyle bir veri yapısını ya da nesneyi saklanabilecek ya da taşınabilecek bir biçime dönüştürme işlemidir. Bu işlemin amacı genelde bir veri yapısını dosya içinde saklamak ya da ağ üzerinden bir başka konuma aktarabilmektir, ki bu sayede ardından deserialization işlemi uygulanarak nesneye istenilen zamanda ya da konumda ulaşılabilir.

Buna örnek olarak bir haber uygulamasını verebiliriz: Haberleri ilk açılışında internetten çekip, ardından serialization işlemi uygulayarak bir dosyaya kaydedebilir, sonrasında ise güncellemesi için belirli bir süre geçmediği takdirde her açılışta haberleri sıfırdan indirmek yerine dosyadan çok daha hızlı bir şekilde okuyarak kullanıcıya gösterebilir (ya da, haberlerin indirilmesi uzun sürüyorsa, bu süre içerisinde ekranın boş olmaması için en son indirdiği haberleri gösterebilir). Başka bir örnek de, bir kullanıcının Facebook’taki hareketlerini Facebook’a bağlanarak almak istediğimizde bize bunu serialization uygulanmış halde vermesini ve bizim kendi uygulamamızda bunu deserialization ile uygun bir sınıfa dönüştürmemizi verebiliriz.

Bu yazımda, bir Windows Store uygulamasında kendi sınıfımızın bir listesini XML Serialization kullanarak dosyaya kaydedip, ardından okuyan örnek bir uygulama oluşturacağız.

Bunun için Visual Studio 2012’yi açıp, yeni bir Windows Store Blank App projesi açalım.

1

➤ Devamını okuyun…