Skip to main content

Posts

Showing posts from 2016

Internet Connection Example in Android

activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<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"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.chantisandroid.checkinternet.MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="Welcome to ChantisAndroid"
        android:id="@+id/textView"
        android:l…

BarCode Scanner example in android

screenshots:


build.gradle(Module: app) :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.chantisandroid.barcodescanner"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.1.1'
compile 'me.dm7.barcodescanner:zxing:1.8.4'//add this line here

}


activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http…

SnackBar Example in Android

build.gradle(Module: app) :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.chantisandroid.exampleapp"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'

compile 'com.android.support:design:23.0.1' //you can add this line

}


activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/…

Floating Lables EditText example in Android

build.gradle(Module: app) :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.chantisandroid.floatinglables"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'   //you can add this line
}


activity_main.xml:
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.an…

Spalsh Screen Example in Android

activity_main.xml :
<?xml version="1.0" encoding="utf-8"?> <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:context="com.chantisandroid.exampleapp.MainActivity">
    <TextView         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="Welcome to ChantisAndroid&apos;s Android Tutorials"         android:id="@+id/textView"         android:layout_alignParentTop="true"         android:layout_centerHorizontal="true"         android:layout_marginTop="90dp"         android:textSize="16dp"         android:textColor="#000000" /> </RelativeLayout>

activity_splash_screen.xml :
<?xml version=&qu…

Navigation Drawer example in Android

Screenshots :


activity_main.xml :
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/drawer_layout"     android:layout_width="match_parent"     android:layout_height="match_parent" >
    <FrameLayout         android:id="@+id/content_frame"         android:layout_width="match_parent"         android:layout_height="match_parent" />     <ListView         android:id="@+id/left_drawer"         android:layout_width="200dp"         android:layout_height="match_parent"         android:layout_gravity="start"         android:background="#ffffff"         android:choiceMode="singleChoice"         android:divider="@android:color/transparent"         android:dividerHeight="0dp"         />
</android.support.v4.widget.DrawerLayout>

simple.xml :
<?xml version=&q…

Custom Navigation Drawer using Slidemenu in Android

Screenshots :


activity_main.xml :
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout  xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/drawer_layout"     android:layout_width="match_parent"     android:layout_height="match_parent" >
<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:context="com.chantisandroid.exampleapp.MainActivity">
    <include layout="@layout/header" />

    <TextView         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="Welcome to ChantisAndroid&apos;s Android Tutorial"         android:id="@+id/textView"         and…