Articles

Android Tutorial : Using Intent to move from one activity to another and sending data via putExtra

Image
We talked in a previous tutorial on using Buttons and how to trigger an action following a button click. This tutorial is the fulfillment of the previous tutorial: Android tutorial for beginners:using Button, Listener and Toast . In the previous tutorial we have seen how to use a button and how to add listener to the button to trigger actions.We have seen how to show a toast (a short pop up message) after clicking the button. In this tutorial we will see how to move from an activity to another after clicking the button. Create a new project in your eclipse (File ==> New ==> Android Application Poject) and give the name of 'Intention' to your project. In your activity_main.xml put this code : <RelativeLayout xmlns:android="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:

Android:Various units of measure (DP, SP, PT, PX, MM AND IN)

Image
For Android apps developement, there are six units of measure:  dp : Density  Independent Pixel - abstract unit that is based on the physical density of the screen.This unit equals 160 DPI (dots per inch) . This dimension is used for elements' setting.  sp : Scale independent pixels  - Used for font sizes.We could compare this unit to "em" in web development. The police may be larger or smaller depending on user preferences.  pt : Point - 72 points per inch. based on the physical size of the screen.  px : Pixels - Corresponds to actual pixels on the screen. This unit of measurement is not recommended as rendering on different types of screen can be different. The number of pixels per inch may vary depending on the device.  mm : Millimeter - based on the physical size of the screen  in : Inches (Inches) - based on the physical size of the screen  These dimensions are defined in the layout (XML files). 

Android tutorial for beginners:using Button, Listener and Toast

Image
This tutorials describes the usage of Buttons. we will start the course with a quick summary of the basic functions. What is a Listener?  A listener, as the name suggests, listens to a source until it is used.  For an action to be performed, it is necessary that a transmitter sends a signal to the listener that is triggered.  Action : Click on a button  Listener : Listen when the button is clicked  There is no simpler than that, we will see a  later in the examples how to implement a listener. Creating our project  As in the previous tutorial , with Eclipse and ADT, create a new project. We'll start by editing the "activity_main.xml" file located in the "res / layout" folder.  Its current syntax is as follows: <? xml version = "1.0" encoding = "utf-8" ?> <LinearLayout xmlns : android = "http://schemas.android.com/apk/res/android" android : orientation = "vertical" androi

Android User Interface Development for beginners

Image
The strength of Android is to have models of devices for all needs:  small screen's phones, big screen's phone, tablets,PDA,Smart TV etc. This is an advantage for users but a problem for android application developers. The problem with the screen size is a  burden for web developers, and Android apps developers will not escape the rule.  To define our user interfaces we need to use layouts that make up the  base class for containers of visual elements. They contain other views (buttons, lists, checkboxes, etc.) or other layouts.  Interfaces are defined using XML files. This format allows to have a graphical interface editor and to have a real separation between your Java (behavior) code and your interface. Everything that is done in XML could also be done in Java, though the code would be much more  complex to maintain.  The layout XML file All XML layout files must be placed in the /res/layout directory of your Android  project in order for the Android packa