MySpotify Demo App – RESTFul Web Service Introduction & Object Oriented Programming

Introduction

myspotify
Sample result

This application does the following:

  • Search the artist library of Spotify
  • If there’s a result, display it as a list together with a base image if available.

The  project technically demonstrate the following:

  • Consuming web service
    • Basic web service call
    • Downloading image from a URL
  • Object Oriented Programming – Classes, Inheritance
  • LINQ basics
  • .NET List object
  • Parsing result using JObject using Json.NET

Web Service Basic Concept

If you are not yet familiar with web services. Please read the following article before jumping in to the source code, so you will fully understand what is going on.

Basically, every web service call requires a “REQUEST from the sender and a “RESPONSE from the receiver. Here, our sender of request is our app – which is requesting artist information , MySpotify while the receiver of our request is the Spotify API.

Object Oriented Programming

We also cover here OOP concept – inheritance. Here – we created two class:

  • RESTService – This class is responsible for doing basic web service calls and some helper function like building query string for easier building of URL for calling and downloading images based from a provided URL.
  • SpotifyApi – This class is specifically made for calling the Spotify API. It also has sub-class, ArtistModel.

SpotifyApi needed the functionality of the RESTService, RESTService doesn’t need SpotifyApi functions – So here, we will just let SpotifyApi inherits RESTService sub routines and functions, then we will create Subroutines specific for the SpotifyApi requirements.

ArtistModel class is used for storing information about the list of artist. I encourage you doing the same if you need to process a set information.

If you want to learn more about inheritance, visit  https://msdn.microsoft.com/en-us/library/ms973803.aspx

Programming Language: VB.NET (Visual Studio 2010)

Project References:

Source Code: https://github.com/vbp-ph/MySpotify

Note: If you need to integrate with Spotify, there are existing libraries out there that can be use – please use that instead. This project was meant for web service demonstration purpose only.

Advertisements

DBConnectTester – Demo .NET app for connection string testing

(Updated 10/23/2016)

Level: Beginner

Source Code: https://github.com/vbp-ph/DbConnectTester

Programming Language: VB.NET (2010)

Required Skills: basic understanding of .NET libraries, Sub Procedures

Purpose: Test connection strings

Additional Packages:

Description:

This .NET windows form application demonstrate the following

  • Connect to the following database
    • SQL Server
    • Oledb
    • MySQL Database
    • SQLite (updated 10/23/2016)
  • Using Sub
  • How to use Link Label to create a google search link
  • Utilize clipboard

Sample Screenshots

When generating error message:

dbconnect_error1

When connection is successful:

dbconnect_ok1

Reference Materials:

https://dev.mysql.com/doc/connector-net/en/connector-net-programming-connecting-open.html

CRUD for VB 2008 using SQL 2008 R2 Database

I have a friend who was studying .NET last month. So i decided to create a quick project for her. it’s an address book application that demonstration basic database operation (CRUD – Create, Read, Update, Delete) by using stored procedures.

The U.I

The project was made using Visual Studio 2008 (i think you can use an Express Edition by downloading it here) and SQL Server 2008 R2 database.

Here’s the download link:
http://www.mediafire.com/?215bei4mkn6bbrl

http://1drv.ms/WXfh7H (reuploaded)