How to read all contacts of android phone

In this tutorial we simply display the name of all Contacts which are saved at our phone . package com.example.contactslist; import android.net.Uri; import android.os.Bundle; import android.provider.ContactsContract; import android.provider.MediaStore; import android.app.ListActivity; import android.database.Cursor; import android.view.Menu; import android.widget.Toast; public class Contacts extends ListActivity { private String name; private String phone; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); … Read more

Content Provider to load all images in Set as wallpaper in Android

res/layout/main.xml sec/java/mainactivity.java ….package com.example.allimagespath; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.app.Activity; import android.app.WallpaperManager; import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.util.Log; import android.view.Menu; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.Toast; public class MainActivity extends Activity { ArrayList … Read more

Customized Query to access Contents of android phone

Cursor cursor = managedQuery(Uri, null, null, null, null); First parameter are used for what you want to access there are built-in Uri used to access desired contents. Browser.BOOKMARKS_URI  Browser.SEARCHES_URI CallLog.CONTENT_URI MediaStore.Images.Media.INTERNAL_CONTENT_URI MediaStore.Images.Media.EXTERNAL_CONTENT_URI  Settings.CONTENT_URI  2. Second parameter is called projection. In this parameter of managQuery we want to retrieve how many columns . For Images String[] … Read more

Content Provider in Android

An android we used File , Data Base for Stored data permanently. These file and Database are accessible only to its application . Others application and packages can not access this. There fore android provide Content Provider  to shared data among packages and application. Some android shared contents are following Contact Number  Media Storage (audio, … Read more

Play Audio in Android

There are used Media Player class for playing audio file in android Programmatically . You can play audio file of your resource folder or play any file from Sd Card. Both method are describe below  Playing from resources Playing from res/raw/file.mp3 MediaPlayer player=MediaPlayer.create(PlaySound.this, R.raw.zara_se.mp3); player.start(); If you want to stop the audio use the following … Read more

Android Content Provider

Content Provider used for  Shared data of Android Mobile  . Which are easily accessible from every Application of Android. Following are the example of Shared data.  Mobile Contacts Browser Bookmarks Media Storage (images, audio and Videos) First of all we studies Built in Content Provider.

How to Develop Android Widget

Android Widget Widget are application which are run on home screen for quick access and easily inform you from current situation, like clock widget, weather widget, calender widget and much more like this. Now in this tutorial we want to develop Android Home Screen Widget Analog Clock. Complete tutorials and Source code are in this … Read more

Simple List Activity

Java Class of src folder where : import android.os.Bundle; import android.app.Activity; import android.app.ListActivity; import android.content.ClipData.Item; import android.view.Menu; import android.widget.ArrayAdapter; public class List extends ListActivity { private String[] listItems = new String[] { “Apple”, “Android”, “Symbian”, “Window” }; private ArrayAdapter< String> adapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list); adapter = new ArrayAdapter(this, R.layout.list, R.id.text1, … Read more