Przejdź do głównej zawartości

Posty

Wyświetlanie postów z maj, 2017

Learning e24cloud.com API

Today I'll show you how to use API in order to create virtual server in the cloud directly from your code. We're going write a script in PHP language and use Amazon SDK API to connect with e24cloud.com, which is the biggest and most modern hosting provider in Poland. First we need to install Amazon SDK http://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/installation.html One important note: We can use the latest version of amazon SDK but we also need to do one trick. We'll use signatureV2 instead ov Signaturev4 as e24cloud doesn't support SitnatureV4 yet. You can download it here: https://github.com/aws/aws-sdk-php-v3-bridge We need to download SDK and the bridge which allows us to use Signaturev2 to the same folder, so that require instruction work seamlessly in the form that I provided in the example below. Then go to your admin panel in e24cloud.com to find two values: a key and a secret. In the following code you need to paste those 2 values.

Xamarin.Forms Previewer

Today I'll show you a tool for every Xamarin developer - Xamarin.Forms Previewer - a tool which will help you to design Xamarin.Forms views faster. First we need a xaml view: The view can't be easier. It contains only one label. Now let's build the project and open Previewer from the View Menu: It should results in displaying the new window which renders your xaml view: Now the most interesting part. Let's add a few labels and change the screen background color. There is no need to save, the design will be changed on the previewer instantly. This is a Xamarin.Forms previewer. I'm using it because it speeds up my view desting loop. I don't need to run the app on emulator or a device to see effects of my changes.

Dependency Injection in .NET Core

Today I explain how Dependency Injection works in .NET Core and I describe 3 methods available in service provider. Up to now if ASP.NET developers wanted to use dependency injection container they had to use Ninject , Autofac or another one. To set these up we had to get NuGet package, install it and configure it in our config filels. Good news - with ASP.NET Core new alternative comes. We don't need Ninject or Autofac anymore, because ASP.NET Core MVC has its own built-in dependency injection container . All set up when new project is created. There is no need to install packages and modifying configuration files. There are 3 methots that we can use to define dependencies in ASP.NET MVC: transient, singleton, scoper Let's open Visual Studio and create new ASP.NET Core MVC application. We'l focus on Startup.cs class where you can see ConfigureServices method. If you want to instruct MVC to use specific class when controller asks for IEventRepository interfa

Xamarin Live Player

In this article I'll show how to install and use Xamarin Live Player. The tool called Xamarin Live Player is a new mobile application and let's you show and modify your Xamarin application on the fly and see effects in your phone or tablet immediately. First you have to install the newest Visual Studio 2017 preview 15.3. Next we need to download Xamarin Updater: https://marketplace.visualstudio.com/items?itemName=Xamarin.XamarinUpdater Then follow the instruction: here . When Visual studio is set up we need to install new software on our mobile device. You can find Xamarin Live Player in Google Play store: Next let's go to the Visual Studio 2017 and create a new Xamarin.Forms project: Now we should see a new device called "Life Player" in our list. Let's click the green arrow button: You'll be presented with pop-up windows with QR Code. Now take your mobile phone where you've installed Xamarin Live Player and scan the code that Visu

How MongoDB + good programming practices saved my time

Today I'll show you how in I'm using MongoBD in web service part of Perfect Life application. I'll show how using good programming practices saves time. I switch database to brand new instance of mongoDB . And I did it. And all that you'll see today was made within one hour. Interested? Keep reading... As you know I tend to use interface to connect components in my application. It helps me to keep components loosely coupled. For example I use dependency injection where controller uses IWeightRecord Repository. Using interfaces this way makes it easy to switch my repository to something else. In my case I'd like to create a new repository that depends on Mongo database instead of in-memory repository that uses Dictionary. As the reault my data won't be deleted in case of web application restart. This is my target. So first I'm adding a new Nuget package to my WebAPI application. The package is called MongoDB.Driver . Next step is to create a new

Create your own server in the cloud in 30 seconds!

Hello every one! Today I'll show you how e24cloud.com cana help you to get your own virtual machine running in less that 30 seconds . I guess your concern can be if it's possible at all. Well, a few years ago it was possible to get a virtual machine with fixed size of disk, fixed size of RAM memory and fixed processor performance. So configuration of your machine was static from the moment you purchased the server. You wasn't allowed to do any change in size of disk for example. Of course you could upgrade your server but if was often one way action cause you couldn't downgrade. Today it's much different. You can host your machines, storage, databases in the cloud based hosting provider and you can change anything in the time. This is so flexible. Let's say you are the owner of online shop. You know that each year in the period preceding Christmas sales grow up by 500% and your virtual machine which hosts your store is not sifficient and will be overlo

Learning MongoDB

NoSQL databases are getting really popular lately. I decided to learn it and build solid skills that will let me using noSql databases in commercial projects. The choice that I made is MongoDB. I have a friend who knows the topic very well and I'm of the opinion that it's easier to learn a new technology of your choice when you can look to help from someone trusted, at least on the beginning. So I've just started and in this article I describe the installation process on Ubuntu Linux. I use Ubuntu 14. If you have a chance to worh with the same operating system and want to install Mongo, you can follow the instruction: 1. Import public key for apt package manager: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 2. Create a file: echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list 3. Reload package data

How to call webAPI service in Xamarin?

In the last few weeks I worked on the web service written in ASP.NET Core. I had a plan to connect the Xamarin application to this web service. Today I'll show you how you can connect your Xamarin app to web service located anywhere in the cloud. First we need to have a web service deployed, which is our server-side part of the system. I describe how to create a web service in ASP.NET COre in my previous post: . Today I'll demonstrate how it works from client perspective, in our case it's Xamarin.Forms application but web application or desktop application can use exactly the same code. This is the great benefit of using C# language - we can use the same code on multiple platforms. OK, I bet you're interested in the code. Let's jump to the code. This is the final version of the client class that I can use to save and retrieve data from web service: The class design is straightforward. It has 2 public methods which encapsulate 2 functionalities: adding s