Posts

Showing posts from June, 2017

Analog and Digital clock in Android with Example

Image
In Android, Simple and computerized tickers are utilized to indicate time in android application .  The AnalogClock is a two-gave clock, one is hour marker and the another is minute pointer. The DigitalClock is resemble your typical computerized which show hours, watch available, minutes and seconds in advanced configuration. Both AnalogClock and DigitalClock Can't alter the time, in the event that you need to change the time, utilize "TimePicker." Example, We should get begin by making a project in Eclipse IDE . Make another venture in Shroud by exploring to File⇒ New Android ⇒ Application Project  and fill required points of interest. (I kept my fundamental movement name as MainActivity.java) Make a format petition for MainActivtiy.java under res ⇒ layout folder. I named the format record as activity_main.xml. In this design i had taken one Simple and one Computerized Clock. <RelativeLayout xmlns:androclass=”http://schemas.android.com/apk/res...

Android fill_parent and match_parent with Example

Image
A new  Android  developer may get confused about what’s the difference between  fill_parent , match_parent  and  wrap_content . In android every Tag in  Xml file  contains two important attributes android:layout_width android:layout_height Did you wonder what’s the different? Android fill_parent and match_parent Lets see the Definition, wrap_content  – The component just want to display big enough to enclose its content only. For Example  : if you are declaring button name as “Submit” and set its heigh & width as wrap_content then it will creates button contain will ” button ” name size and dose not occupy more then its content area. fill_parent  -The component want to display as big as its parent, and fill in the remaining spaces. For example :   if your parent tag has 120 dp set into width and also 120 dp into height then it will cover your whole parent area. Here parent are called as your main abo...

Top 25 Android Interview Questions and Answers Asked in Top Companies

Here are top 25  Android Interview questions and their answers are given just below to them. 1.What is Android ? Android   is a Software for mobile devices which includes an Operating System, middleware and some key applications. The application executes within its own process and its own instance of  Dalvik Virtual Machine . Many Virtual Machines run efficiently by a DVM device.  DVM  executes Java languages byte code which later transforms into  .dex  format files. 2.What are the different data types used by Android? The data can be passed between many services and activities using the following data types: –  Primitive Data Types : This is used to share the activities and services of an application by using the command as Intent.putExtras(). This primitive data passes the command to show the persistent data using the storage mechanism. These are inbuilt data types that are used with the program. They provide simple implementati...

Android Spinner Example Code with Output

Image
Android Spinner  is like the combox box of AWT or Swing. It can be used to display the multiple options to the user in which only one item can be selected by the user.Android spinner is like the drop down menu with multiple values from which the end user can select only one value. Android spinner is associated with AdapterView. So you need to use one of the adapter classes with spinner. String.Xml < RelativeLayout   xmlns:androclass = "http://schemas.android.com/apk/res/android"         xmlns:tools = "http://schemas.android.com/tools"         android:layout_width = "match_parent"         android:layout_height = "match_parent"         tools:context = ".MainActivity"   >            < Spinner             android:id = "@+id/spinner1"           ...