There are times when it is necessary to convert a list of user-defined objects to string and later on retrieve it as a list in its original form. Example: like storing it into a Redis cache . How do we do that? ObjectMapper Steps: 1. ObjectMapper objectMapper = new ObjectMapper(); First, initialize ObjectMapper. 2. List<YourClass> listObj ; Create and initialize your list of user-defined object. where, YourClass is a class having multiple variables. Example - class YourClass{ String abc; String xyz; } 3. String convertedStr = objectMapper.writeValueAsString(listObj); This is the string conversion of the list. 4. listObj = objectMapper.readValue(convertedStr, new TypeReference<List<YourClass>>(); And we are back with your list object.
Hello devs! This is another short tutorial to show how to shake an Edit text view if the input is incorrect. Note : The tutorial assumes that you have the basic knowledge about android development. It involves the following steps : 1. Create the Edit text and cast it inside the onCreate. EditText edittext=findViewById(R.id.edit_text); Recommended : https://github.com/GoodieBag/Pinview Optional - Put the edit text inside a dialog to take an input from the dialog. 2. Write an animation XML. Here is an example: ( shake.xml ) Courtesy : https://gist.github.com/simon-heinen/9795036 <? xml version = " 1.0 " encoding = " utf-8 " ?> < set xmlns : android = " http://schemas.android.com/apk/res/android " > < rotate android : duration = " 70 " android : fromDegrees = " -5 " androi