Showing posts with label Android Beginners. Show all posts
Showing posts with label Android Beginners. Show all posts

Wednesday, 6 February 2013

Android Emulator Keyboard Shortcuts

Android Emulator Keyboard Shortcuts



Emulator Device Key Keyboard Key
Home HOME
Back Esc
Menu (left softkey) F2 or Page-up button
Star (right softkey) Shift-F2 or Page Down
Call/dial button F3
Hangup/end call button F4
Search F5
Toggle trackball mode F6
Enter trackball mode temporarily Delete
DPad left/up/right/down KEYPAD_4/8/6/2
DPad center click KEYPAD_5
Onion alpha increase/decrease KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)
Power button F7
Audio volume up button KEYPAD_PLUS, Ctrl-5
Audio volume down button KEYPAD_MINUS, Ctrl-F6
Camera button Ctrl-KEYPAD_5, Ctrl-F3
Switch to previous layout orientation KEYPAD_7, Ctrl-F11
Switch to next layout orientation KEYPAD_9, Ctrl-F12
Toggle cell networking on/off F8
Toggle code profiling F9
Toggle fullscreen mode Alt-Enter

Wednesday, 5 December 2012

How to run an Android Project in a Android phone

How to run an Android Project 
in a Android phone

In this tutorial,i am going to show how to run the android project application in a android smart phone.First of all,the developer need to know where the project is saving in the system.


Normally the workspace of the android project of Eclipse will be in  the 
My Document file itself in Windows XP and in User folder in Windows 7.


First step is to find the workspace of Android Project.It is easy to find by searching the path from the Eclipse.


         If you find the workspace folder.Select the ANDROID  project which you want to execute in the smartphone.

Consider the steps
   Hera consider the bellow example.

1.Selecting the project named helloworld from workspace is shown bellow.




2.In the helloworld folder.Select the bin folder





3.In the bin folder,helloworld.apk file is kept as like in the bellow figure.



4.Copy and paste the helloworld.apk file into your smartphone by using  
     bluetooth or wire transfering.


5.After transering the file,the file can be taken where it is copied earlier.
     If you use bluetooth for file transfering the file will be in the Bluetooth    
     folder in the MyFiles folder in the android smartphone.


6.Select the file.After selecting the user interface provide an option to
     Instal or Cancel.


7.Select Instal to instal  the application in the smart phone.


8.After instalation,the shortcut will be available in the icons in the phone.


9.In this case,the icon called helloworld with default android icon will be  
     available along with the other shortcuts.


10.Select the icon.Then the output will be shown as like in the emulator in 
       the Eclipse.


Hope you all understand.

"Please mention comments and queries"


Sunday, 18 November 2012

Drag & drop elements in ADVANCED


Today we are discussing about the drag & drop elements in ADVANCED.In the bellow figure show the elements in ADVANCED.



requestFocus & View
  • The class in view represents basic building blocks for the user interface.

  • A view is responsible  for event handling and drawing.

  • View is used to create interactive UI components.

  • The default code is given bellow.

    <requestFocus />

    <View
        android:id="@+id/view1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


ViewStub

  • A ViewStub is used to inflate layout resources at runtime.
  • A ViewStub is becoming visible  when inflate() is invoked.

  • The default code is given bellow.


<ViewStub
        android:id="@+id/viewStub1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
/>


GestureOverlayView

  • GestureOverlayView  is a transparency overlay for giving input that is placed on the top of other widgets.
  • The default code is given bellow.

      <android.gesture.GestureOverlayView
        android:id="@+id/gestureOverlayView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
    </android.gesture.GestureOverlayView>


SurfaceView

  • SurfaceView is used to provide a dedicated surface for drawing  embedded inside of a view.
  • The default code is given bellow.

   <SurfaceView
        android:id="@+id/surfaceView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
   />


ZoomButton

  • ZoomButton is used to zooming anything depends on the place where it is placed/
  • The default code is given bellow.
   <ZoomButton
        android:id="@+id/zoomButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@android:drawable/btn_plus"
   />
    

ZoomControls

  • ZoomControls is used for both zoom in and zoom out.
  • It is mainly used in image applications.
  • The default code is given bellow.
      <ZoomControls
        android:id="@+id/zoomControls1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
    />


DialFilter

  • The deafult code is shown bellow.


    <DialerFilter
        android:id="@+id/dialerFilter1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <EditText
            android:id="@android:id/hint"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Hint" >

            <requestFocus />
        </EditText>

        <EditText
            android:id="@android:id/primary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@android:id/hint"
            android:text="Primary" />

    </DialerFilter>

TwoLineItemList
  • A view group with two children is used in ListViews.
  • The default code is given bellow.
   <TwoLineListItem
        android:id="@+id/twoLineListItem1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
  />

AbsoluteLayout
  • An absolute layout is used to specify locations of its childrens
  • It is less flexible and hard to maintain.
  • The default code is given bellow.
  <AbsoluteLayout
        android:id="@+id/absoluteLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </AbsoluteLayout>

Saturday, 17 November 2012

Drag & drop elements in TRANSITION


Today we are discussing about the drag & drop elements in TRANSITIONS.Lets check it out the following given bellow.



Image Switcher

  • Image Switcher is used for to switch between two images and makes a way to transition with suitable animation.
  • The default code is given bellow.
    <ImageSwitcher
        android:id="@+id/imageSwitcher1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
    </ImageSwitcher>

Text Switcher
  • As like the image switcher,Text Switcher is used for switch or animate one text into another text form.
  • The default code is given bellow.
    <TextSwitcher
        android:id="@+id/textSwitcher1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </TextSwitcher>

View Animator
  • View animator is used perform animations between two image or text view.
  • The default code is given bellow.
    <ViewAnimator
        android:id="@+id/viewAnimator1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ViewAnimator>

View Flipper
  • View Flipper is used to animate between two or more views.
  • Only one child can be shown at a time.
  • It is possible to flip automatically between each of the child at regular intervals.
  • The default code is shown bellow.
    <ViewFlipper
        android:id="@+id/viewFlipper1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ViewFlipper>

View Switcher
  • A View Switcher is used only to have two child views and  which only shows one at a time.
  • The default code is given bellow.

    <ViewSwitcher
        android:id="@+id/viewSwitcher1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ViewSwitcher>


In the next we will learn the elements in ADVANCED, CUSTOM & LIBRARY VIEWS

Friday, 16 November 2012

Drag & drop elements in IMAGES & MEDIA


Drag & drop elements in IMAGES & MEDIA



Today we are discussing about the drag & drop elements in IMAGES & MEDIA.Lets check it out int he following given bellow.




Image View

  • Image view is used to display images such as icons.

  • It can load images from any of the sources like content provider or resources.
  • The default code is given bellow.
    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher" 
    />

Image Button

  • Image button is used for the same purpose of button,but in image button we can add image.
  • It can load images from sources like resources or from content provider.
  • The default code is given bellow.
    <ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher" 
/>


GALLERY

  • A gallery is a view that shows the items in a horizontally scrolling list as center-locked manner.

  • Gallery view must uses Gallery.LayoutParams as their layout parameter type.
  • The default code is given bellow.
     <Gallery
        android:id="@+id/gallery1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
     />

Media Controller


  • The Media Controller is used for controlling for a MediaPlayer which typically contains the buttons "Play/Pause","Fast-Forward","Rewind" and progress slider.

  • Media Controller will create a set of controls and put it into window which is floating above your application.
  • The default code is given bellow.
    <MediaController
        android:id="@+id/mediaController1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
    </MediaController>


Video View


  • Video view is used for displaying a video file and a  video view is able to load images from various sources.
  • The default code is given bellow.
   <VideoView
        android:id="@+id/videoView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
   />



Thursday, 15 November 2012

Drag & drop elements in Time & Date




Today we are discussing about the drag & drop elements in TIME & DATE.The TIME& DATE elements in ANDROID are given bellow.




Pickers


  • Android provides time and date picker for choosing the time and date in the android applications.
  • The user can set time and date by using this two pickers.

  • Time picker provides control for selecting each part of time  such as hour,minute and AM or PM.
  • The default code is given bellow.
        <TimePicker
        android:id="@+id/timePicker1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
     />



  • Date picker provides control for selecting month,day and year.
  • The default code is given bellow.
         <DatePicker
        android:id="@+id/datePicker1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
     />




Chronometer


  • Chronometer class that shows a simple timer. 
  • The default code is given bellow.

      <Chronometer
        android:id="@+id/chronometer1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Chronometer" 
      />


Analog Clock

  • This widget in Time & Date shows an analog clock with 2 hands for hours and minutes.
  • The default code is given bellow.
    <AnalogClock
        android:id="@+id/analogClock1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    />


Digital Clock

  • This widget show time in hours,minute and seconds in digital form
  • The default code is given bellow.
    <DigitalClock
        android:id="@+id/digitalClock1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="DigitalClock"
    />
  

Wednesday, 14 November 2012

Drag & drop elements in LAYOUT





Today we are discussing about the drag & drop elements in LAYOUT.The layout elements in ANDROID are given bellow.




Linear Layout


  • It is a view group which aligns all the children in a single directrion,ie.horizontally or vertically.

  • The developer can specify the layout direction by using android:orientation attribute.

  • There are 2 types of linear layout.They are linear layout(horizontally) and linear layout(vertically).
  • The default code is given bellow.

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
    </LinearLayout>



Relative Layout


  • Relative layout is a layout where posotions of the children can be described related to to the parent or each other.
  • Relative layout whose height can be set to WRAP_CONTENT and ALIGN_PARENT_BOTTOM for child.
  • The default code is given bellow.

    <RelativeLayout
        android:id="@+id/relativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </RelativeLayout>


FrameLayout


  • Frame Layout is designed to use block out an area on the screen for displaying a single item.

  • Frame Layout is mainly used for holding a single child view.
  • The default code is given bellow.

    <FrameLayout
        android:id="@+id/frameLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </FrameLayout>

Fragments


  • Fragments in layout represents portion or behaviour of user interface in an Activity.

  • We can combine multiple fragments in a single activity to build a multi pane user interface.

  • Fragments can reuse in multiple activity.

Table Layout
  • Table layout arranges its chidren elements into columns and rows.

  • A Table Layout consist of number of rows and columns.
  • It does not show the table border.
  • The default code is given bellow.
    <TableLayout
            android:id="@+id/tableLayout1"
              android:layout_width="match_parent"
                android:layout_height="wrap_content" >
                    <TableRow
                          android:id="@+id/tableRow1"
                            android:layout_width="wrap_content"
                              android:layout_height="wrap_content" >
                            </TableRow>
                                <TableRow
                                      android:id="@+id/tableRow2"
                                        android:layout_width="wrap_content"
                                          android:layout_height="wrap_content" >
                                        </TableRow>
                                            <TableRow
                                                  android:id="@+id/tableRow3"
                                                    android:layout_width="wrap_content"
                                                      android:layout_height="wrap_content" >
                                                    </TableRow>
                                                        <TableRow
                                                              android:id="@+id/tableRow4"
                                                                android:layout_width="wrap_content"
                                                                  android:layout_height="wrap_content" >
                                                                </TableRow>
                                                              </TableLayout>
                                                              
                                                            Table Row


                                                            • Table Row arranges its children elements horizontally.
                                                            • It is always used as a child of Table Layout.
                                                            • The default code is given bellow.

                                                                <TableRow
                                                                    android:id="@+id/tableRow1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content" >
                                                                </TableRow>


                                                            Tuesday, 13 November 2012

                                                            Drag & drop elements in Composite


                                                            Today we are discussing about the drag & drop elements in COMPOSITE.The composite elements in ANDROID are given bellow.


                                                            ListView

                                                            • A list view is a list of scrollable items in a group

                                                            • The List view items are automatically inserting the elements into the list using an adapter that enter the source content from database or array.
                                                            • The default code is given bellow.
                                                                <ListView
                                                                    android:id="@+id/listView1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content" >
                                                                </ListView>



                                                            Expandable List

                                                            • The Expandable List view which shows items in vertically scrolling 2 level list view manner.
                                                            • It allows users to expand individually each list into another list.
                                                            • Expandable List shows an indicator besides each item having child elements.
                                                            • The default code is given bellow.


                                                                   <ExpandableListView
                                                                    android:id="@+id/expandableListView1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content" >
                                                                </ExpandableListView>



                                                            Grid View

                                                            • Grid view shows items in two dimensional scrolling format.

                                                            • Items in the Grid View are comes from ListAdapter which is associated with the view.

                                                            • Grid view is mainly used for displaying items in a thumbnails format.
                                                            • The default code is given bellow.


                                                            ScrollView

                                                            • The scroll view helps to scroll and view the content fronm top to bottom or bottom to top 

                                                            • Scroll View is a frame layout which having the ability to scroll entire contents.

                                                            • ScrollView only support for vertical scrolling.
                                                            • The default code is given bellow.
                                                                <ScrollView
                                                                    android:id="@+id/scrollView1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content" >

                                                                    <LinearLayout
                                                                        android:id="@+id/linearLayout1"
                                                                        android:layout_width="match_parent"
                                                                        android:layout_height="match_parent" >
                                                                    </LinearLayout>
                                                                </ScrollView>
                                                               

                                                            Horizontal ScrollView


                                                            • HorizontalScrollView is only support for horizontal scrolling.
                                                            • The default code is given bellow.
                                                                  <HorizontalScrollView
                                                                    android:id="@+id/horizontalScrollView1"
                                                                    android:layout_width="wrap_content"
                                                                    android:layout_height="wrap_content" >

                                                                    <LinearLayout
                                                                        android:id="@+id/linearLayout1"
                                                                        android:layout_width="match_parent"
                                                                        android:layout_height="match_parent"
                                                                        android:orientation="horizontal" >
                                                                    </LinearLayout>
                                                                </HorizontalScrollView>


                                                            Sliding Drawer


                                                            • Sliding drawer allows users to drag contents horizontally or vertically and user to drag by a handle to bring contents in the screen.
                                                            • Sliding Drawer should only used inside of Frame Layout.
                                                            • The default code is given bellow.
                                                                <SlidingDrawer
                                                                    android:id="@+id/slidingDrawer1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="match_parent"
                                                                    android:content="@+id/content"
                                                                    android:handle="@+id/handle" >

                                                                    <Button
                                                                        android:id="@+id/handle"
                                                                        android:layout_width="wrap_content"
                                                                        android:layout_height="wrap_content"
                                                                        android:text="Handle" />

                                                                    <LinearLayout
                                                                        android:id="@+id/content"
                                                                        android:layout_width="match_parent"
                                                                        android:layout_height="match_parent" >
                                                                    </LinearLayout>
                                                                </SlidingDrawer>


                                                            WebView
                                                            • A web view is used for displaying web pages.

                                                            • Web View uses Webkit rendering engine to display web pages.

                                                            • Web View having the methods to zoom in and zoom out,navigate forward and backward and having text search capability.

                                                            • The default code is given bellow.
                                                            <WebView
                                                                    android:id="@+id/webView1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="match_parent"

                                                             />

                                                            TabHost

                                                            • Container for a tabbed window view. 
                                                            • This object holds two children: a set of tab labels that the user clicks to select a specific tab, and a FrameLayout object that displays the contents of that page.
                                                            •  The individual elements are typically controlled using this container object, rather than setting values on the child elements themselves.
                                                            • The default code is given bellow.
                                                                   <TabHost
                                                                    android:id="@android:id/tabhost"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="match_parent" >

                                                                    <LinearLayout
                                                                        android:id="@+id/linearLayout1"
                                                                        android:layout_width="match_parent"
                                                                        android:layout_height="match_parent"
                                                                        android:orientation="vertical" >

                                                                        <TabWidget
                                                                            android:id="@android:id/tabs"
                                                                            android:layout_width="match_parent"
                                                                            android:layout_height="wrap_content" >
                                                                        </TabWidget>

                                                                        <FrameLayout
                                                                            android:id="@android:id/tabcontent"
                                                                            android:layout_width="match_parent"
                                                                            android:layout_height="match_parent" >

                                                                            <LinearLayout
                                                                                android:id="@+id/tab1"
                                                                                android:layout_width="match_parent"
                                                                                android:layout_height="match_parent" >
                                                                            </LinearLayout>

                                                                            <LinearLayout
                                                                                android:id="@+id/tab2"
                                                                                android:layout_width="match_parent"
                                                                                android:layout_height="match_parent" >
                                                                            </LinearLayout>

                                                                            <LinearLayout
                                                                                android:id="@+id/tab3"
                                                                                android:layout_width="match_parent"
                                                                                android:layout_height="match_parent" >
                                                                            </LinearLayout>
                                                                        </FrameLayout>
                                                                    </LinearLayout>
                                                                </TabHost>



                                                            THIS IS FEATURED POST 1 TITLE

                                                            THIS IS FEATURED POST 1 TITLE

                                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam

                                                            Quas molestias excepturi
                                                            THIS IS FEATURED POST 2 TITLE

                                                            THIS IS FEATURED POST 2 TITLE

                                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam

                                                            Impedit quo minus id
                                                            THIS IS FEATURED POST 3 TITLE

                                                            THIS IS FEATURED POST 3 TITLE

                                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam

                                                            Voluptates repudiandae kon
                                                            THIS IS FEATURED POST 4 TITLE

                                                            THIS IS FEATURED POST 4 TITLE

                                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam

                                                            Mauris euismod rhoncus tortor