In Today’s post we are going to look at How to Change Summary of Edit Text Preference. But before moving ahead, if you want to know more about Preferences click here. First create a preference screen with only one preference EditTextPreference as show below in xml. Let us call this xml as setttings.xml <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > <EditTextPreference android:dialogTitle="Enter Name" android:key="name" android:summary="Enter Your Name" android:title="Edit Text Preference" /> </PreferenceScreen> As shown above we are creating EditTextPreference with key “name”.
Android provide various options for data persistence like Preferences, File and Database etc. This post we will introduce you to one of the option i.e. Android SQLite Database. Let us take an example of Student database. i.e. student_database (DATABASE_NAME). We will create table tb_student (DATABASE_TABLE), with 3 columns i.e. _id (KEY_ROWID), name (KEY_NAME) and grade (KEY_GRADE). Columns _id is primary key and autoincrement, while name and garde are text .
Menus are one of the most important parts of any application and when it comes to mobile Menus become more important considering the fact that area available is restricted. Through this blog we will look at the following various type of Android Menus available with example for each of them: Options Menu Context Menu Submenu Options Menu: Menu opened when MENU key on the device is clicked is called options menu.
Through this article we will look at one of the important feature of Android i.e AsyncTask for performing task which takes long time for execution with example. Also we will look at other mechanisms and see why AsyncTask is better approach. Android application follows single thread model i.e. when android application is launched, a thread is created for running that application. This single thread model works fine for normal execution, but for the instance like network call which are usually long operations, UI hangs waiting for the response from the server.
Most of applications have some setting which user can/needs to configure, and to do this setting a screen needs to be designed along with code to read the data and display and update the data back. In Android we can do this with minimum efforts via Preferences. Another advantage of using Android preference for application setting helps Android user because it will be uniform across the applications. In this article we will look at the standard Preference available i.
Considering the fact that available space on mobile screen is small, UI design of mobile application is very important. For Android each screen follows one or more layout. Layouts are like container that holds various view or layouts. Placing of views on the screen depends on the layout selected. This article will introduce following basic layouts with examples: Linear Layout Table Layout Absolute Layout Relative Layout Frame Layout Let us now look at each of them in details and understand them.