Archives : February-2015

A dialog can have a custom layout with buttons, text views, list, images, checkboxes, etc. You can create a layout for your dialog and show the dialog with the following simple method. The showDialog method can be a part of your activity class. In that case you don’t need to explicitly declare the context as ..

Read more

To reverse engineere the oracle database, you can use the Oracle data dictionary like follows. — Get table information from oracle DB select T.* from USER_TABLES T; — Get column information from oracle DB select C.* from USER_TAB_COLUMNS C; — Get constraint information from oracle DB SELECT cons.constraint_type, cols.table_name, cols.column_name, cols.position, cons.status, cons.owner FROM all_constraints ..

Read more

With the getAll function of sharedPreferences it is possible to save the shared preferences to a file. The following code example is probably the easyest way to do it. With the saveSharedPreferences method you can save all shared preferences a file to the root of your sdcard. Make sure your App has the following permission. ..

Read more

Google has started to use ripple animations in Material Design UIs. The setHotspot() method is added in API Level 21. This teaches the drawable a “hot spot”, and the RippleDrawable apparently uses this as the emanation point for the ripple effect. The setHotspot() method of a view take the x,y values from the MotionEvent to ..

Read more

If you have to create an object with default constructor, you can invoke the newInstance() method on a Class. This simple class creates the instance of a named class using the empty default constructor by calling the newInstance method: public class ReflectionTester throws InstantiationException, IllegalAccessException, ClassNotFoundException { public static Object createObject(String className) { return Class.forName(className).newInstance(); ..

Read more