Retrofit library is a Type-safe REST client for android and Java, courtesy of Square Inc. Most modern android apps make HTTP requests to some remote server somewhere in Antarctica or who knows where! Making such requests can sometimes be a pain in the … what did you just say? Using this retrofit library will save you a lot of pain as well as boiler-plate code. In this simple tutorial, I will show you everything you need to get started with it. Let us get started!
Retrofit Library Implementation Steps
Below are the steps we will follow while implementing this retrofit library in our android application.
Once in a while, you challenge yourself. Perhaps you have listened to so many people tell you that you couldn’t do it. You have read so many tutorials, so many books, watched so many YouTube videos; yet there is nothing to show for it. You are almost tempted to believe the hype; the idea that only a few talented people can write code (or craft code) and you are not one of them.
But one fine morning, you wake up feeling like you could take over the world. You believe in your powers. You convince yourself that you were born to do great things; because you don’t need someone to tell you that you don’t have what it takes.
Are you willing to admit that there is something you really suck at? You are terrible at it and you don’t need someone to tell you that. I know I do. I also know that I would like to do anything I want in life. Let me cut it to the chase here; I am color blind. There, I said it. That means you might see my design efforts and wish you never saw them. I really want to be able to tell all the colors apart and design killer UIs for my apps. So, I tried it this past weekend.
Android swipe views provide lateral navigation between sibling screens such as tabs with a horizontal finger gesture (a pattern sometimes known as horizontal paging). In this post, I will be using a simple android app that I created this past weekend to show you how to create android swipe views. If you have used many android apps, there is a good chance you have seen android swipe views. If not, well, this is your chance to try them. So, here is how the app looks like using swipe views.
An android app prototype can be helpful when you want to build your next android app. Often, jumping straight to code is not the best thing to do, regardless of your experience developing applications. That being said however, sometimes the cost of prototyping tools is out of reach for many starting developers. Before Photoshop started offering their software for a monthly fee, you had to pay a huge amount to get it. If you do not want to pay that much money, Google Docs Drawing tool is your friend. All you need is creativity and time.
Comments in code is such an endless debate, so much so that I couldn’t help but share my own arguments on it. So, where do I really stand as far as comments in code is concerned? Hold it for a second. In his best-selling book Clean Code, Uncle Bob, makes the following analogy while talking about clean code : as location is to real estate, so is readability to source code. I totally agree with that statement. With that in mind, let us take a look at some arguments for and against having comments in your code.
Laravel migrations are a type of version control for your database. They allow a team to modify the database schema and stay up to date on the current schema state. Migrations are typically paired with the Schema Builder to easily manage your application’s scheme. In my last laravel post, I talked about laravel models. I also promised to show you how to create tables that you will need to store your blog posts(models) in your next blogging platform. Let us do this.
At this point, I assume that you already have a working database and you have configured it in your laravel application under app/config/database.php. Now we can move on.
Let’s learn how to rotate an image in android. Perhaps one of your requirements is to display rotated images in your latest android app and you just want to get that done so you can move on to other important things like taking over the world. In this post, I will show just that. As you step through this code, I would urge you to read it carefully and see if you can notice anything good or bad about its readability. I try to improve everyday as I lean towards writing clean code. Please be my judge – I will not strangle you!
A Laravel Model makes it very easy to store, read (retrieve), update and delete (CRUD) a resource in a Laravel application. In this post, I am going to show you how to use a laravel model to manage blog posts. I touched on this in my previous post when I talked about using laravel resource controllers here. The Eloquent ORM included with Laravel provides a beautiful, simple ActiveRecord implementation for working with your database. Each database table has a corresponding “Model” which is used to interact with that table.
A Laravel resource controller makes it easier to build RESTful controllers around resources. For instance, you may wish to create a controller that manages “blog posts” stored by your application. Normally, you use a laravel resource controller to group common routes in one class. In this post, I will show you how to create a resource controller that we will, in the future, use to manage blog posts in a demo application. Let us do it!
In your routes.php, you would add routes like this:
$posts = Post::all();
return View::make('posts')->with('posts', $posts);
$post = Post:find($id);
return View::make('posts')->with('post', $post);
//add like 20 more routes here and you start to see a problem creep in
Anatomy of a blog post