Using SharedPreferences in Android

Android has a mechanism which called preferences system for saving simple key-value pairs of primitive data types within applications. This mechanism works through SharedPreferences object. Preferences system stores data in xml file. If this file doesn’t exists Android will create automatically one. Preferences can be private or be accessible to other application. You can use it for storing some global . . . →Read More:Using SharedPreferences in Android

Share

Using assets in Android

Android offers one more directory where you can keep files which also will be included in package. This directory called /assets. The difference between /res and /assets is that Android doesn’t generate IDs for assets content. You need to specify relative path and name for files inside /assets.

. . . →Read More:Using assets in Android

Share

Validating user input with regular expression in EditText component in Android

What if you need to validate user input in EditText component. For example you need to save some file and filename user should set at EditText component. You can specify what chars can be used in this component,but how you determine how match “.”are there.

. . . →Read More:Validating user input with regular expression in EditText component in Android

Share

Filtering data in EditText component in Android

There are some situations when need to filter data in your EditText component. For example your EditText component represent email,phone number,city and so on. I these cases you want that your EditText component recieved only some specific data. You can use android:inputType tag in your layout xml file,but sometimes you need to . . . →Read More:Filtering data in EditText component in Android

Share

Put cursor at specific position in EditText component in Android

I found a lot of the same questions on several Android Dev forums:“How to put cursor at specific position in EditText?”. As I understood,new to platform developers can’t find proper method. At the first blush this is strange situation,because there is no such method as putCursor or setCursor,but if you will . . . →Read More:Put cursor at specific position in EditText component in Android

Share

Making not editable EditText component in Android

I found that there is a some problem to do EdiText component not editable from code. Yes,it is very easy to do that from layout xml file. There you can use tag android:editable which allows to set will this component editable or not.

. . . →Read More:Making not editable EditText component in Android

Share

Loading Menus through XML files in Android

Android has possibility to load menus through xml files. I found this approach very useful. I really like that I don’t need to worry about uniqueness menu item ID’s because Android generates all menu ID’s as other project IDs. In this post I want to show how you can use it in your work.

. . . →Read More:Loading Menus through XML files in Android

Share

Using SubActivities in AndroidUsing SubActivities in Android

Sometimes you need to run some Activity,do some operation there and return some value to parent Activity. For this situation Android has possibility to run Activity for result.

. . . →Read More:Using SubActivities in Android

Share

Viewing logs and exceptions in Android

I found that there is no logcat console in android plugins for NetBeans and IDEA 8.

But when you develop application you need to see exceptions or see simple log.

. . . →Read More:Viewing logs and exceptions in Android

Share

Using Context Menus in Android

Context menu in Android is similar to context menu in any others OS.

In Microsoft Windows or in any Linux distr you click right mouse key and see context menu. The same is in Android,but you press and hold your view which has context menu.

. . . →Read More:Using Context Menus in Android

Share

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna,tincidunt vitae molestie nec,molestie at mi. Nulla nulla lorem,suscipit in posuere in,interdum non magna.