Category Archives: Android

18Jul/16

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

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

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: Continue reading

29May/16

Product Flavors in 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.
Continue reading

17Oct/15

Set margins in dp programmatically – Android

Sometimes at runtime, it is required to set margin to a view. But, the problem is getting different size for different screen sizes, i.e. hdpi, xhdpi, xxhdpi, etc.

This could be done easily with the help of screen specific value resources.

Provide screen specific dimension

values/dimen.xml

Continue reading

05Oct/15

EditText with Single Line, Line Wrapping and Done Action in Android

Regular formula for making an EditText
– Single Line : no new line <Enter> allowed,
– Line Wrapping : Single line wrapped into multiple lines, and
– Done Action : imeAction set as actionDone

is possible through only XML properties. That is,

But, only this is not enough. You need to set all these properties programatically.
Continue reading

05Oct/15

How to get all values of SharedPreferences programmatically in 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.

Continue reading

05Oct/14

Create Andriod Application Project in Android Studio Continued

In previous blog post we discussed about the requirements for Android Application development using Android Studio and setup our directory structure for it.

In this post, we are going to create a project by name First App. Continue reading

29Sep/14

Create Andriod Application Project in Android Studio

In previous blog, we tried to reason with developers who are still using Eclipse to migrate to Android Studio. Well, here in this post we are going to explain the process of creating project in Android Studio. Even if you are a beginner or you were previously using Eclipse and now wants to switch to Android Studio, this post is for you. Continue reading