Skip to main content

Posts

Showing posts from August, 2015

Make your TextView Colorful in Android(Using SpannableStringBuilder)

Add Colors to your TextView There is a small trick behind this. You have to Keep the text value of textView Empty. Because the string will be written in java part this time. Here Goes the entire code for this: MainActivity.java package com.androiddevelopmentguru.spannable; import android.R.color; import android.os.Bundle; import android.app.Activity; import android.graphics.Color; import android.text.SpannableString; import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan;

Action Bar with Back press Enabled Button

Action bar With Back Press Enabled Button There are only three things we need to do, to achieve this objective.    Create action Bar with back button    Coding on Back button       And few changes in Manifest file 1.      Create action Bar with Button: In OnCreate() method write below given lines: getActionBar().setDisplayHomeAsUpEnabled(true);

ListView Example in Android

To create a simple listview in android as shown in below image, we generally need three things. 1. ListView 2. ArrayAdapter 3. Simple String array. Image 1 activity_main.xml

DropDown List in Android using Spinner

Usually we use drop down list in forms. In android we could achieve this using Spinner. Here goes the Code: activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/LinearLayout1"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     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=".MainActivity" >

SET ENVIRONMENT VARIABLES FOR JAVA INSTALLATION

Goto MyComputer ->> Properties ->> Advanced System Settings->> Enviornment Variables After that In user variable Make a folder Named JAVA_HOME  and set its value: C:\Program Files\Java\jdk1.7.0_45\lib and click ok if that doesn't work try this: In user Variable, click on new at bottom of tab give JAVA_HOME in variable name in value : \ProgramFiles\java\jdkk1.8.0_05

Basic Concepts of Android

The android is very fast growing technology. It is an operating system for mobile devices and tabs. Sooner we will have other devices in market with android support system(For example:Washing machines, TVs, notebooks etc). If you are familiar with java then you can easily learn this technology.The basic concepts of android to start with: Core Java Concepts Android Environment Setup with Eclipse Creating an Android Emulator Activity and Intents Android Widgets