Tag Archives: Quot Quot

TextView with link in ANDROID…….

By | June 24, 2012

Hi all……. All of you may be familiar with TextViews in ANDROID. But how many of you know that we have have html as text in a textView. This post is a simple example to show this. Create a fresh project and copy this code to the main java file. The main.xml The AndroidManifest.xml file

Get a file from PhotoGallery and copy it to your directory in your project resources in Titanium(iPhone or ANDROID).

By | May 3, 2011

This example opens the photogallery and then when you select a file from it , it will be copied to your resources directory. First manually create a directory in your resources, here the directory is named “mydirectory”. Call this functiion inside a button click or something Now after running this code check the directory you… Read More »

Email validation in ANDROID.

By | May 24, 2012

This is a simple example showing email validation in ANDROID. This example uses regex for email validation. Create a button and an edittext in your main.xml file and try this code. Check this link to find how you can send email from android programatically. Please leave your valuable comments……

Program to generate Fibonacci series in C Sharp/C#

By | April 27, 2011

Hi, Here is a simple program to generate Fibonacci series using C Sharp /C#. It will generate Fibonacci numbers < 100. [csharp] class MainClass { public static void Main() { int oldNum = 1; int presentNum = 1; int nextNum; System.Console.Write(presentNum + ","); while (presentNum < 100) { System.Console.Write(presentNum + ","); nextNum = presentNum +… Read More »

Android dialog with ListView

By | April 21, 2011

For implementing a ListView, we first create a xml which contains a ListView named list.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android"   android:layout_width="fill_parent"   android:layout_height="fill_parent">   <ListView     android:id="@+id/listview"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     /> </LinearLayout> Next we create a Dialog Object and inflate the above xml and when the listItem… Read More »

Using GridView in ANDROID….

By | September 20, 2012

GridViews are those in which you can arrange elements in a two dimensional grid. It is what you see in the gallery where images are arranged. Here images are arranged in a two dimensional grid. Copy the below code and save it as “MyGridView.java” package com.pack; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import… Read More »

ProgressBar in ANDROID…..

By | June 4, 2012

Progress bars are our basic needs when we want to show something for a long time or some progress takes a long time and we want to show it’s progress. Keeping that in mind ANDROID also has built in progress views. There are basically two types of progress views in ANDROID. ProgressDialog.STYLE_SPINNER and ProgressDialog.STYLE_HORIZONTAL Take… Read More »

Dynamically Load images in ANDROID? OR Load image in ANDROID using a string path.

By | May 10, 2013

With the following code you can load images in your drawable folder dynamically by giving the filename as a String. For that you have to use getResources().getIdentifier which has parameters as the “path”,”drawable” and the “package name”. This returns a unique resource ID which can be used to set the image for a ImageView using… Read More »

Load html string into WebView in android

By | June 26, 2012

This sample code helps you to load html from a string and from a file into webview in ANDROID. String str = Your HTML String; /* use src=’file:///android_asset/images/photo_3.jpg’ for loading images from the assets /images folder */ /* To load from a string use loadDataWithBaseURL */ webview.loadDataWithBaseURL("",str , "text/html", "utf-8", ""); /* To load from… Read More »