Skip to main content

Posts

Showing posts with the label Example

Android Pay Example with Android Studio

1. Create an Android Studio ProjectOpen Android Studio and create a new project.  Enter your Application Name and Company Domain.On the Add Activity screen, select Blank Activity and click Next. The next screen will ask for an activity name, layout name, and more.  Leave the default values and select Finish.


2. Configure your Gradle Build File
Add Dependencies The Android Pay API is part of Google Play Services, so let’s add a dependency on Google Play Services to the project:Open thebuild.gradle file in theapp module and add the following to the dependencies block:
dependencies { compile'com.google.android.gms:play-services:7.5+'compile'com.android.support:support-v4:+'compile'com.android.support:appcompat-v7:+' }

Next, click the “Gradle sync” button in the top toolbar.  If this button is grayed out, wait for Android studio to finish loading the project (you can see progress in the lower right):  to download the dependencies you just added.


3.Configure the And…

Android Basic Tutorial : Grid View Example

In this tutorial, we will learn how to arrange the components in two-dimensional gridView. To display number from 1 to 25 in grid view layout.It is quite simple to implement grid view layout by using <GridView /> tag in XML layout coding.
There are few settings can be set for the grid view layout such as  android:numColumns="..." to set the number of column,android:columnWidth="..." to set the width of the column,android:gravity="..." to set the position of the content and other settings.
<?xml version="1.0" encoding="utf-8"?> <GridView xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/gridView1"     android:numColumns="5"     android:gravity="center"     android:columnWidth="50dp"     android:stretchMode="columnWidth"     android:layout_width="fill_parent"     android:layout_height="fill_parent" >
</GridView> After t…