If you are working on Android project with team of 2 or more and pushing and integrating code on daily basis on VCS, you must use Android Continuous Integration to make your life easier with all those build fails, error and basic test executions. Every time someone pushes code, Android Continuous Integration will build and run unit tests automatically on server and notify you of any errors instantly (it will notify you for successful build as well). How cool is that?
I have written simple web crawler using python automation which takes search string from you, searches google images for latest high resolution photos and set it as your wallpaper. I have modified it with minor changes so that you can also download first 100 high resolution pictures for particular search term in your computer, instantly! (well, that really depends how fast your internet connection is)
If you are Movies or TV Series buff just like myself, you must have found yourself in doing ritual of copying filename, heading to browser and downloading subtitle manually, unzipping it and loading them in VLC from Internet many a times. What if you could just right click on file and say download subtitles and computer will get them for you then and there in flash of an eye, wouldn’t that be great? I will guide you to do this exact thing in your computer within 10 minutes, don’t believe me, keep reading!
In last couple years, there has been increasing demand for Mobile application developers in software industry, specially Android and IOS, so naturally many developers are trying their hand in same. Android, holding the biggest market share in mobile market, is the favorite choice for many developers. Being Android Beginner Developers myself since last year, I have committed many mistakes which I shouldn’t have and would like to share some do’s and don’ts for Beginner Android Developers.
Room is a persistence library introduce by Google in this year I/0. Room makes it extremely easy to work with SQLite in your android application and worth giving a shot if you are using SQLiteOpenHelper as of now for handling data in your app. Migrating your current implementation to Room is, surprisingly, very easy. Google has provided samples for this here, but I personally think it’s too much code for such simple task and it can be explained easily.
If you have been following Architectural components introduced in I/0 2017, you must already be familiar with the Room Persistence Library which provides you abstraction layer over SQLite to provide smooth database access and using SQLite with full potential. If you are not aware or don’t know how Room Database works, I would recommend reading this article which shows the very basic usage and implementation of Room Database in your android project.
So as of now, our app displays only one quote. Now we need to make it display multiple quotes (say 10), we have to call the API with second parameter as 10 and make little changes to our data model and repository classes. Before we do it, I want you to imagine kind of changes you would require to do if you don’t use the current architecture which we are using. First of all, you will have to change the API call (which will be ultra easy in our case, thank you Retrofit), then changes in DBHelper classes
Continuing from last article, we need to implement some mechanism for caching the quote offline so that whenever user will open the app, he will see last quote loaded without waiting to load new quote and in background we will request server for new quote and update the UI whenever data is available. We are going to use Room Persistence Library for that!
Continuing from the last article, for fetching quotes for our app, we are going to use Retrofit and fetch quotes from this simple and free API Random Famous Quotes API. API is straightforward and simple GET request for getting single quotes from movie category will look something like this where count parameter is optional and…
Our basic requirement is the app which will fetch me a new Quote from mentioned category every time I open it. But while fetching, we should not be kept waiting and instead be presented with the last quote which we fetched.