Set up Continuous Integration server (Jenkins) for Android Projects

Android, Jenkins
Jenkins is one of the best open-source Continuous Integration server available. It helps in automating the builds and sharing of the application with minimal or no user interaction. In this post we are going to set up continuous integration server Jenkins for Android projects. Later this post will be extended for flavor specific build creation and sharing. Prerequisites: Ubuntu 16.04 server with root access Topics covered: In this article following two topics will be covered: Installation of Jenkins on Ubuntu 16.04 Configure Jenkins access Configure for Android Projects 1. Installation of Jenkins on Ubuntu 16.04: In order to do this, login to the server with root access (in other words, access to terminal with #). Run following command to add the key of Jenkins to the machine. root@pcsalt:~# wget -q -O…
Read More

Solution: Access to the dex task is now impossible, starting with 1.4.0

Android
Everybody* who wants to upgrade to and above 1.4.0 build tool version is getting this error. Error:Access to the dex task is now impossible, starting with 1.4.0 1.4.0 introduces a new Transform API allowing manipulation of the .class files. See more information: http://tools.android.com/tech-docs/new-build-system/transform-api As you can see by visiting the new build system: transform api that there is no solution provided. Follow the steps to solve the problem Access to the dex task is now impossible: (more…)
Read More

Product Flavors in Android

Android
Environment plays a vital role in the application development. As per the requirements, we have to create few environments, viz. Dev, QA, UAT, and Prod. In some projects, only a subset of these environments is required. So, with different environments comes different API endpoints. But for Android application development, most of the developers are still following the same old concept of enabling the endpoint of one environment and commenting endpoints of the rest of the environments. Now, we have Product Flavors in Android. And, it maintains the build as per the requirement. That is, there is no need to change in code if a build for a different environment is required. (more…)
Read More

How to get all values of SharedPreferences programmatically in Android

Android
SharedPreferences stores all values in XML file. So, if you want to iterate through all the values stored in it, you could try following code. public static List getAllValues(Context context) { Map values = getPref(context).getAll(); List prefDataList = new ArrayList(); for (Map.Entry entry : values.entrySet()) { PrefData prefData = new PrefData(); prefData.key = entry.getKey(); prefData.value = entry.getValue().toString(); prefDataList.add(prefData); } return prefDataList; } (more…)
Read More

RecyclerView – Android

Android
In this post, we are going to load the list of posts from PCSalt.com. In our previous post, JSON Parsing – Android, we used ListView to display a list of posts. But, in this post, we are going to use RecyclerView to display it. (more…)
Read More