WP Manager for XING

WP Manager for XING

WP Manager for XING

One of the reasons why I’ve been so quiet on this blog is that I’ve been busy working on another Windows Phone app… After the “failed” attempt (details about this adventure will come soon in a separate post) with My Delicious (a Windows Phone manager for Delicious bookmarks), I’ve decided to take another shot.

While I’m a long time user of LinkedIn, some time last year I’ve got an invitation from somebody to join XING… you may wonder what is XING? XING is a professional social network, very similar to LinkedIn, but very popular in Germany. They have an official Windows Phone app, which when I got it was free, but in the meanwhile got a price of €2.99. As this was the only option in the marketplace, I’ve decided to take a shot and write my own app.

Why?

  • I’ve never worked before with an API which is using OAuth for authentication
  • XING has a rather impressive API which can lead to complex apps
  • I wanted to refresh my Windows Phone development skills

After a longer than expected development period (developing in the spare time has it’s ups and downs and you’re not always keen to write more code after a long day in the office), about a month ago I’ve released to the MarketPlace “WP Manager for XING”.

The app is FREE and currently allows:

  • view your profile
  • update your status
  • view the news feed
  • like and share activities
  • view your contacts, visitors and people recommended for you
  • manage your XING messages
  • pin a contact to your home screen for quick access
  • save a XING contact to your phone’s contact list

In few days I hope I’ll be able to push a new update for the app in the MarketPlace which will fix some known bugs and also provide some additional features…

The application can be downloaded from the MarketPlace using this link: http://www.windowsphone.com/en-us/store/app/wp-manager-for-xing/37e790ef-4bff-4c32-a2a3-dc41c2ba2e86

Below are some screenshots take from the app…

news feed

news feed

news feed activity

news feed activity

contacts

contacts

more options

more options

user profile

user profile

messages view

messages view

recommendations

recommendations

share

share

Feedback and suggestions are welcomed so don’t hesitate to contact me!

Going the SPA way

AngularJS Hackathon

The SPAs are very popular lately! And I’m not talking about what everybody thinks of when they hear SPA, but about Single Page Applications. I guess every week I keep reading at least 1-2 posts in my RSS reader about the subject.

There are tons of articles already on the subject, plenty of books to read and so many frameworks aimed at making the development of SPAs easier that it’s really difficult to pick the right one for you in case you are new to the subject (just like me…).

About 2 months ago I read/watched via RSS one article written by Dan Wahlin called Video Tutorial: AngularJS Fundamentals in 60-ish Minutes. This is without any doubt the best 70 minutes I’ve spent on YouTube in a long long time. The video is very well organized, very easy to follow and introduces you to the AngularJS framework created by Google. It doesn’t go into details as it’s impossible to do it in only 70 minutes, but it shows the power of AngularJS and makes you want to find out more!

I was really impressed by what you can do with very little code and effort, so I wanted to dig a bit deeper… There are plenty of resources online for learning and understanding AngularJS and below I’ll enumerate just a few that I’ve found to be really good:

  •  AngularJS API reference – very good point to start directive, modules etc… also easy to discuss problems and get help as every topic has a Disqus thread associated.
  • Egghead.io – very good collection of short videos on AngularJS topics (the AngularJS official site points actually to this collection of videos)
  • Scoop.it! – has a very good collection of AngularJS resources that it’s worth taking a look at

As probably the best way to learn something new is to do something practical, I decided to write a small SPA in order to show the events listed on Cyprus Events in a more mobile friendly way (their “mobile” interface is old and rather unfriendly to use).

For the purpose I’ve use the following technology stack:

  • AngularJS
  • Bootstrap – cause I can’t design anything and Twitter Bootstrap is really amazing
  • jQuery
  • UnderscoreJS - a really nice JS utility library that makes life easier… it contains some nice “extension methods” for collections that helped me write “LINQ like queries” on an array – thanks to .NET Rocks and Derik Whittaker for mentioning this library in show 873.

The result is available online here… the app is not impressive from functionality point of view, but in order to make it work I’ve got my hands dirty with few AngularJS concepts: modules, routing, controllers and views, created a service to retrieve the events for a specific feed (as I couldn’t load the RSS feeds directly with jQuery’s AJAX methods I’ve used a small PHP code snippet found here), used promises and even created a factory which I’ve used to share data between 2 controllers.

One aspect that I would like to improve would be caching of events as currently the feed is loaded every time the user selects a category. One idea would be to use the HTML5 local storage if available using also the date when the feed was last loaded and reload it on user request (some button for refresh) or if the data is older than 1 hour (could be even more)… but, still I’m trying to understand what caching options is AngularJS offering (suggestions are welcomed in comments :) )…

The result is working properly on desktop browsers (Chrome, Firefox, IE, Opera) and mobile phones: checked on Android phones and also iPhone and iPad emulators (available as plugins for Web Matrix), but it’s not working on my Windows Phone device (WP 7.8) – trying to find a way to understand why the feeds are not loaded…

The project in it’s current stage is available for download on my SkyDrive

As soon as I’ll get some free time I’ll try to implement something similar, but using the approach John Papa is promoting: Durandal, Breeze (which looks really interesting), KnockoutJSHot Towel… and probably use jQuery Mobile for the interface…

Any comments or suggestions are welcomed!

Enhanced by Zemanta

NewOnTheIsland.com

New On The Island

New On The Island

As you’ve probably noticed I haven’t been active on this blog for quite a while now. That’s because of few reasons: work load in the office, a personal project during the free time and a new web address for all the Cyprus related articles I’ve wrote and published here since starting this blog.

As the amount of Cyprus related posts kept growing, I’ve decided to open a new website dedicated to this which will try to present my Cyprus experiences as well as possible. As until now, the articles will be written from a personal view, but will try to provide as much useful information as possible.

With a bit of effort, I’ve managed to move all the Cyprus related articles on NewOnTheIsland.com! Things are still not 100% finished, but the website is up and running for more than 2 weeks now and I’ve managed to publish a few articles already:

As time will pass, I’ll try to improve the overall look and feel of the website and add as much useful content as possible. For now the number one issue that I’ll have to fix is hosting – we’ve had quite a few problems lately, so if you try to access the site without success please bear with us and revisit after a while!

More articles and pages are on the way, but in the meanwhile take a look at the ones already published there if you are interested.

You can follow the new website via:

As for this blog, it will become a bit more professional and will be mainly related to IT and the projects that I’m working on.

Kindle resources

Kindle For exactly a year now, I own a Kindle 3 ebook reader… At the time I bought it, this version was already released for quite some time so there were plenty or reviews and opinions available. Although I read many positive reviews about the device, my main concern was related to reading technical/programming books on it: some online reviews and also some friends were complaining about the reading experience when it came to technical books.

Nonetheless I decided to go ahead and buy one as I wanted a dedicated ebook reader. One year later I am still very happy with my purchase… and have on my device more documents than I can read at this moment.

In order to use the Kindle at it’s best there are a series of tools that, in my opinion, every Kindle user should use.

1. Calibre  – E-book management – this is probably the best ebook manager available and it’s FREE! Supports a wide range of ebook readers (not only Kindle) and besides the syncing of ebook readers contents it also provides the ability to fetch news from the internet. While I used to buy the National Geographic every month before having my Kindle, now I simply download the latest version straight to my device – the language choice is yours! Also it provides a converter to MOBI format, but don’t expect miracles. I tried it, it works, but doesn’t do a great job when it comes to keeping the formatting. Anyway, overall, this is the best option out there for ebook reader management.

2. SENDtoREADER – as they present themselves, SENDtoREADER is a simple web application that allows you to send any webpage to your Amazon Kindle Reader instantly. All you have to do is create an account on their website (or login using your Facebook account) and using their browser addons (http://sendtoreader.com/addons/) you can send any webpage to your Kindle reader.

3. MSDN Magazine on Kindle – if you like to read the MSDN magazine and want to have it on your Kindle, this is a very good option (in my opinion even better than the “Fetch News” feature of Calibre). While downloading and producing the MOBI version of MSDN Magazine, it also downloads the Technet magazine.

While getting newspapers, magazines and web pages on your Kindle is cool, this is not enough :) Below you can find few places where you can get ebooks for free or at discounted prices.

  1. Microsoft Press Deal of the Day-  get a new ebook at 50% discount on every week day… if you are using Microsoft technologies this is a great source.
  2. Syncfusion Succinctly Series– a free collection of ebooks available in PDF and MOBI formats on various topics. If you want a book which will get you started quickly with a new technology, this may be the place for you.
  3. O’Reilly– well-known publisher. It has it’s own “Deal of the Day” section and they have “sales” on a regular basis. If you buy books from them, you may be asked to provide a review and you’ll receive a discount code for your feedback.
  4. in case you are using Microsoft technologies, you will want to take a look at this link. It contains a large collection of Microsoft books in various formats (PDF, MOBI, EPUB, XPS) for technologies like Visual Studio, Windows Phone, SQL Server, ASP.NET and ASP.NET MVC, Office etc

I’m sure that there are lots of other resources for Kindle ebooks out there… the ones listed above are just used on a very regular basis by me.

If you own a Kindle reader or any other type of ebook reader and know or use other resources that are not listed here feel free to drop me a message in the comments. I would love to find out about other sources for quality content :)

Using (and customizing) the AutoCompleteBox for Windows Phone

This is my first article on Windows Phone 7 development and I will focus on a subject that was useful in one of my recent projects: using the an autocomplete box in a Windows Phone 7 application.

By default, the Windows Phone SDK doesn’t include an AutoCompleteBox control for use, but as probably many people already know, the Silverlight Toolkit library released on CodePlex contains such a control designed for the phone.

In order to demo the usage of the AutoCompleteBox control we’ll create a very simple application which will allow us to select our favourite cities from a predefined list. I am using Microsoft Visual Studio 2010 Express for Windows Phone.

Once you downloaded the latest Windows Phone Silverlight Toolkit – November 2011 (7.1 SDK) and installed it, you will  need to add a reference to the Microsoft.Phone.Controls.Toolkit.dll assembly in your project.

add_reference

To use the AutoCompleteBox control in your XAML, you will need to edit the XAML source and add the toolkit namespace as shown before:

namespace

After this step you are ready to use the AutoCompleteBox in your page. The AutoCompleteBox is a rather simple control to use, looking like a regular TextBox, but as the user starts typing into it, it displays a suggestions drop-down list based on the matches found. For the AutoCompleteBox to offer the suggestions based on what’s being typed we need to make sure that we set the ItemsSource property of the control which takes an IEnumerable collection.

For the simplest use of the AutoCompleteBox, all you have to do once you performed the steps above is to create an AutoCompleteBox control in your XAML as shown below:

autocomplete_xaml

and then assign the ItemsSource property to a collection (I’ve done it in code behind, but you can also use binding in your XAML):

autocomplete_codebehind

That’s it! Now you can run your application and test it… If you would be typing the character s, you should be seeing something like this:

app1

If you want to get the value from the AutoCompleteBox, you can check the Text property of the AutoCompleteBox control.

In a real world application it makes sense that you may want to set the Text property to some previously stored value and then allow the user to modify it if necessary.

So, after setting the ItemsSource of the AutoCompleteBox to the list of cities, add an extra line that will also set the Text property to Suceava (value that exists in our list):

cities.Text = “Suceava”;

If you run the  application again, you notice you have a problem:

app2

The AutoCompleteBox control has the suggestions drop-down list opened… I don’t want that by default and I guess most people don’t want this behaviour as well. So let’s fix it.

We need to handle 3 simple events exposed by the AutoCompleteBox:

events

All the events are rather simple and their names are very clear: the GetFocus and LostFocus are triggered when the control gets and loses the focus, while the DropDownOpening event is triggered just before the opening of the suggestion drop-down allowing us to stop the suggestion if needed.

The GetFocus and LostFocus will set a boolean variable to true or false to allow us to know if the control is focused or not. In the DropDownOpening event we will use this boolean value and we will not allow the drop-down list to open if the control is not focused – just the scenario we have above. To stop the drop-down from opening we need to cancel the event. Here is the code:

events2

Try running the application again once you implemented the events above. The application should behave as expected: the control has by default the value “Suceava” and the drop-down list is not opened by default.

What we’ve done so far is a very simple scenario of AutoCompleteBox usage. In lots of cases it could be enough, in others not.

Imagine you want to allow your users to input multiple cities in the same AutoCompleteBox control, each city separated by a comma and for each city you want to help your user by providing him help (suggestions) based on what he’s typing.

If you run the application now and type a comma after your initial selection and then start typing the first letter of another city, you will not get any suggestions as the list provided to the ItemsSource property doesn’t contain any string that will match your entire text value.

To finish this demo, we’ll try to modify the default behaviour of the AutoCompleteBox and customize it to allow us to cover the previous scenario.

To implement this, we’ll need to:

  • use one variable to remember the previously typed cities
  • handle the TextChanged and SelectionChanged events of the AutoCompleteBox. The TextChanged event has the same use as for a TextBox control, while the SelectionChangedevent is triggered when the selection in the suggestion drop-down control is changed.
  • we need also to implement a custom search method that will be used by the TextFilter property of the AutoCompleteBox

We will use the TextChanged event to store in the new variable the previous cities that the user types, in the SelectionChanged we will make sure to append the newly selected city to the previously typed cities.

The custom filtering method will make sure that we use only what is after a comma as search term. Also, this method will make sure to filter out cities that we already typed.

So, to get to the coding part, we need to attach some more events to the AutoCompleteBox:

events3

The custom filter method is rather simple and looks like this:

textfilter

The TextChanged and SelectionChanged events are also simple:

changed_events

If you will run the application again you will see that the same AutoCompleteBox allows us to input multiple cities, separated by comma and for each new city we get suggestions as we type.

app3

Hope that this demo will be useful to others and hope the explanations were clear enough. The AutoCompleteBox is a very useful control in lots of cases and with a bit of customization it can be quite powerful.

A very useful article that I read when I first started to use the control is AutoCompleteBox for WP7 in depth which provides plenty of valuable information about the various properties and events exposed by the control. If you need to learn more about the control, check it as it’s a very good resource.

The full project for this demo can be downloaded here – feel free to take it, run it and play with it.

Also, any comments or suggestions related to this demo are welcomed, so drop me a line in the comments if you have something to say.

Happy coding!