<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Android Programming Example, Mobile App Development, Android Material</title><description>vogella blog is about android programming in developing android mobile app with startup examples.</description><managingEditor>noreply@blogger.com (Jaysukh Patel)</managingEditor><pubDate>Thu, 2 Apr 2026 06:39:19 -0700</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">6</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://vogella.blogspot.com/</link><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle>vogella blog is about android programming in developing android mobile app with startup examples.</itunes:subtitle><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><item><title>bluetoothadapter.getdefaultadapter returns null in android. Why? How to solve it in android</title><link>http://vogella.blogspot.com/2014/01/bluetoothadaptergetdefaultadapter.html</link><category>Android</category><category>Bluetooth Android</category><category>Why in Android</category><author>noreply@blogger.com (Jaysukh Patel)</author><pubDate>Mon, 20 Jan 2014 22:23:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8168649627428028513.post-2816193441963436072</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I found many query regarding Bluetoothadepter return null values, “&lt;b&gt;Devise not supported on higher android version&lt;/b&gt;”, “&lt;b&gt;Emulator don’t turn on Bluetooth using Bluetooth adapter&lt;/b&gt;”, “&lt;b&gt;Why emulator not support Bluetooth&lt;/b&gt;”.&lt;br /&gt;
&lt;br /&gt;
But the entire above question has a single answer.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Your installed emulator must not any Bluetooth device&lt;/b&gt;. So BluetoothAdapter simply check your device supporting and have a Bluetooth device.&lt;br /&gt;
&lt;br /&gt;
So try it your own android mobile through &lt;a href="http://vogella.blogspot.in/2014/01/how-to-create-apk-file-from-project.html" target="_blank"&gt;install android APK&lt;/a&gt; file in your mobile.&lt;br /&gt;
&lt;br /&gt;
Useful: &lt;a href="http://vogella.blogspot.in/2014/01/how-to-create-apk-file-from-project.html" target="_blank"&gt;How to create and install apk file from your project?&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
bluetoothadapter.getdefaultadapter returns null &amp;gt; &lt;b&gt;Run in actual android device which has Bluetooth device&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To know more about BluetoothAdapter please reader android developer site &lt;a href="http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html" target="_blank"&gt;here &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://vogella.blogspot.in/2014/01/bluetooth-sample-code-for-bluetooth.html" target="_blank"&gt;Here is the sample test code and Example for you&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">196</thr:total></item><item><title>Bluetooth Sample Code For Bluetooth Turn On Or Off In Android - How To Enable Bluetooth</title><link>http://vogella.blogspot.com/2014/01/bluetooth-sample-code-for-bluetooth.html</link><category>Android</category><category>Bluetooth Android</category><category>Sample Code</category><author>noreply@blogger.com (Jaysukh Patel)</author><pubDate>Mon, 20 Jan 2014 22:18:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8168649627428028513.post-8632269588203313616</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Bluetooth in android is basic level to learn android. In any application you can use Bluetooth for sharing purpose like file sharing, Apps sharing, Audio and video file also. In some of application you have to turn on Bluetooth in between application access process.&lt;br /&gt;
&lt;br /&gt;
At that time you can turn on Bluetooth in a minute by this example.&lt;br /&gt;
&lt;br /&gt;
Useful: &lt;a href="http://vogella.blogspot.in/2014/01/how-to-create-apk-file-from-project.html" target="_blank"&gt;How to create and install apk file from your project? &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style="text-align: center;"&gt;
&lt;a href="https://free.ols18.com/data/public/fe8fa3.php" target="_blank"&gt;Download Bluetooth Code for android from here:&lt;/a&gt;&lt;/h4&gt;
&lt;h3 style="text-align: left;"&gt;
Create new sample Bluetooth project&lt;/h3&gt;
&lt;br /&gt;
1. Create a new project under the File &amp;gt; New &amp;gt; Android Project&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Open &lt;b&gt;string.xml&lt;/b&gt; file under the resource (res) &amp;gt; values folder and past the below code.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;&lt;resources&gt;

    &lt;string name="app_name"&gt;BluetoothSample&lt;/string&gt;
    &lt;string name="action_settings"&gt;Settings&lt;/string&gt;
    &lt;string name="hello_world"&gt;Hello world!&lt;/string&gt;
    &lt;string name="Default_Message"&gt;My Message&lt;/string&gt;
    &lt;string name="GetMessage"&gt;GetMessage&lt;/string&gt;
    
    &lt;string name="Text_View1"&gt;Enter Message&lt;/string&gt;
    
    &lt;string name="button1"&gt;TURN_ON&lt;/string&gt;
&lt;string name="button2"&gt;DISCOVERABLE&lt;/string&gt;
&lt;string name="button3"&gt;TURN_OFF&lt;/string&gt;
    
&lt;/resources&gt;
&lt;/pre&gt;
&lt;br /&gt;
3. Open Mail xml file &lt;b&gt;activity_main.xml&lt;/b&gt; file under the resource (res) &amp;gt; layout folder and past the below code.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;&lt;relativelayout android:layout_height="match_parent" android:layout_width="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=".MainActivity" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"&gt;

     &lt;textview android:id="@+id/textView1" android:layout_alignleft="@+id/button1" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" android:layout_height="wrap_content" android:layout_margintop="20dp" android:layout_width="wrap_content" android:text="@string/Default_Message"&gt;  

    &lt;button android:id="@+id/button1" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_height="wrap_content" android:layout_marginleft="30dp" android:layout_margintop="49dp" android:layout_width="wrap_content" android:text="@string/button1"&gt;  
  
    &lt;/button&gt;&lt;button android:id="@+id/button2" android:layout_alignleft="@+id/button1" android:layout_below="@+id/button1" android:layout_height="wrap_content" android:layout_margintop="27dp" android:layout_width="wrap_content" android:text="@string/button2"&gt;  
  
    &lt;/button&gt;&lt;button android:id="@+id/button3" android:layout_alignleft="@+id/button2" android:layout_below="@+id/button2" android:layout_height="wrap_content" android:layout_margintop="28dp" android:layout_width="wrap_content" android:text="@string/button3"&gt;  
        
&lt;/button&gt;&lt;/textview&gt;&lt;/relativelayout&gt;

&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Open &lt;b&gt;Manifest file&lt;/b&gt; under your project. Past the Bluetooth permission line to allow Bluetooth in your device.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;&lt;uses-sdk android:minsdkversion="8" android:targetsdkversion="19"&gt;
    
    &lt;uses-permission android:name="android.permission.BLUETOOTH"&gt;
    &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN"&gt;
&lt;/uses-permission&gt;&lt;/uses-permission&gt;&lt;/uses-sdk&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Now open &lt;b&gt;MainActivity.java&lt;/b&gt; file and past below code.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;package com.example.bluetoothsample;

import android.os.Bundle;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {

 private static final int Request_Enabled = 0;
 private static final int Request_Discoverable = 0;
 
 
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
 
  
  
  final BluetoothAdapter BTA = BluetoothAdapter.getDefaultAdapter();
//  it through getSystemService(String) with BLUETOOTH_SERVICE
  if(BTA == null)
  {
   final TextView tv1 = (TextView)findViewById(R.id.textView1);
   tv1.append("device not supported");
   
  }
  final Button Btn1 = (Button)findViewById(R.id.button1);
  
  Btn1.setOnClickListener(new View.OnClickListener() {
   
   @Override
   public void onClick(View arg0) {
    
    if(!BTA.isEnabled())
    {
     Intent EnableBintent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
     startActivityForResult(EnableBintent, Request_Enabled);
    }
   }
   
  });
  
  final Button Btn2 = (Button)findViewById(R.id.button2);
  
  Btn2.setOnClickListener(new OnClickListener() {
   
   @Override
   public void onClick(View arg0) {
   
    if(!BTA.isDiscovering())
    {
     Toast.makeText(getApplicationContext(), "Making Your Device Discoverable", Toast.LENGTH_LONG).show();
     
     Intent EnableBintent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
     startActivityForResult(EnableBintent, Request_Discoverable);
    }
   }
  });
 
  final Button btn3 = (Button)findViewById(R.id.button3);
  
  btn3.setOnClickListener(new OnClickListener() {
   
   @Override
   public void onClick(View arg0) {
    
    BTA.disable();
    
    Toast.makeText(getApplicationContext(), "Bluetooth is closed", Toast.LENGTH_LONG).show();;
    
   }
  });
  
  
  
 }

 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
  // Inflate the menu; this adds items to the action bar if it is present.
  getMenuInflater().inflate(R.menu.main, menu);
  return true;
 }
 
 

}
&lt;/pre&gt;
&lt;br /&gt;
Note: during this running Bluetooth project in emulator doesn’t work because Bluetooth adepter cant find Bluetooth device. So it’s return null. But you can check in your device directly it must work after &lt;a href="http://vogella.blogspot.in/2014/01/how-to-create-apk-file-from-project.html" target="_blank"&gt;install apk file&lt;/a&gt; in your mobile.&lt;br /&gt;
&lt;br /&gt;
For more about: &lt;a href="http://vogella.blogspot.in/2014/01/bluetoothadaptergetdefaultadapter.html" target="_blank"&gt;Bluetooth adapter return null&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
If you have any problem and query then comment in below comment box.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">83</thr:total></item><item><title>How To Create APK File From Project (Eclipse) For Android Mobile Or Device – Get APK File From Eclipse Project</title><link>http://vogella.blogspot.com/2014/01/how-to-create-apk-file-from-project.html</link><category>Android</category><category>APK file</category><author>noreply@blogger.com (Jaysukh Patel)</author><pubDate>Mon, 20 Jan 2014 06:05:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8168649627428028513.post-5221309398037899465</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Create or get APK file from your android project development in eclipse is the first level to test your project for in mobile use. many of the developer have many confusion to get APK file of the current project. But it is so simple you can get APK file for your particular project or android application in a minute.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note:&lt;/b&gt; You don’t have to create APK file at any time. It will be automatically generate under the bin folder in your workspace.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style="text-align: left;"&gt;
Step by Step guide to create or get APK file from your android project&lt;/h3&gt;
Step 1,&lt;br /&gt;
Go &lt;b&gt;current workspac&lt;/b&gt;e on your hard drive&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs-otEufHhR2knw2vYO9AsLXST48D6Zu6Kr6dV0wQ4BwwHdk59ezcSane7Z0YmFLxsqeObTUr-u1ghxf9H5Cz4IrMfxh9M7Waz6B1xfPL0xTYN2iZzkH_UUSdI2LjnaTnHa0pgqq1Q-Dg/s1600/Android+Workspace.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img alt="Android Work space" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs-otEufHhR2knw2vYO9AsLXST48D6Zu6Kr6dV0wQ4BwwHdk59ezcSane7Z0YmFLxsqeObTUr-u1ghxf9H5Cz4IrMfxh9M7Waz6B1xfPL0xTYN2iZzkH_UUSdI2LjnaTnHa0pgqq1Q-Dg/s1600/Android+Workspace.png" height="222" title="Android Work space" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Android Work space&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Step 2,&lt;br /&gt;
Go in your&lt;b&gt; project &amp;gt; bin&lt;/b&gt;&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3ynd7O0o8SyGcFbtjdvfolaaX_y7kA6wqmN14NWNABAdhgbpxpP5BoZuYTfJcrkiijRtzzznOuaI0OCaGFrlfEVDvqg-gxTNhjVIPyJF4U82OlGjcAtbxDRoxiahgxPFI5Pmn2cmdZsw/s1600/Android+Workspace+create+APK+file.png" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;img alt="Android Work space create APK file" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3ynd7O0o8SyGcFbtjdvfolaaX_y7kA6wqmN14NWNABAdhgbpxpP5BoZuYTfJcrkiijRtzzznOuaI0OCaGFrlfEVDvqg-gxTNhjVIPyJF4U82OlGjcAtbxDRoxiahgxPFI5Pmn2cmdZsw/s1600/Android+Workspace+create+APK+file.png" height="186" title="Android Work space create APK file" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Android Work space create APK file&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Step 3,&lt;br /&gt;
You will found same name &lt;b&gt;project name with .APK file&lt;/b&gt;. Ex, You can see apk file with name bluetoothsample.apk file.&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT29yRqdW8uFddq-uF2Tb9-2ry4Z-ouXmzrXyYqA3xTdDhLLNKOSvX2Leotsc_KnA96u1ZAdoQtjW10bKlAjSwxCkuaUsCPNVhR4Ev6rVbIkzuNpYBBXczETEuhpuZphvaSuW02VT6CEg/s1600/Android+Workspace+get+APK+file.png" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;img alt="Android Work space get APK file" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT29yRqdW8uFddq-uF2Tb9-2ry4Z-ouXmzrXyYqA3xTdDhLLNKOSvX2Leotsc_KnA96u1ZAdoQtjW10bKlAjSwxCkuaUsCPNVhR4Ev6rVbIkzuNpYBBXczETEuhpuZphvaSuW02VT6CEg/s1600/Android+Workspace+get+APK+file.png" height="240" title="Android Work space get APK file" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Android Work space get APK file&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Connect your mobile to computer. Just copy that file and past in your mobile. Disconnect mobile from PC. Prepared your SD card. Find the APK file in your mobile. Hit the double click.&lt;br /&gt;
&lt;br /&gt;
Best of luck,&lt;br /&gt;
Any problem and suggestion, than comment in below box.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs-otEufHhR2knw2vYO9AsLXST48D6Zu6Kr6dV0wQ4BwwHdk59ezcSane7Z0YmFLxsqeObTUr-u1ghxf9H5Cz4IrMfxh9M7Waz6B1xfPL0xTYN2iZzkH_UUSdI2LjnaTnHa0pgqq1Q-Dg/s72-c/Android+Workspace.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">96</thr:total></item><item><title>How To Add Or Import Image In Drawable Under Resource Folder In Android Eclipse</title><link>http://vogella.blogspot.com/2014/01/how-to-add-or-import-image-in-drawable.html</link><category>Android</category><category>Code Behind</category><author>noreply@blogger.com (Jaysukh Patel)</author><pubDate>Wed, 8 Jan 2014 22:21:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8168649627428028513.post-4940193759297488734</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Drawable folder located under the resource folder of android project. I am explaining how to import new images from your computer hard drive as a external storage. Right click on that folder doesn’t give direct option to import image into this folder. After importing image, copy of that image automatically saved in your workspace where your android app project saved.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;b&gt;Steps to import images in res/drawable&lt;/b&gt;&lt;/h3&gt;
&lt;br /&gt;
Before you import images in Drawable folder you have to know about &lt;b&gt;drawable-ldpi(low density), drawable-hdpi(high density), drawable-mdpi(medium density), drawable-xhdpi(extra high density), and drawable-xxhdpi&lt;/b&gt;. &lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY94ObWAlR7mK8IcUndiQCV5MMZ354mWVvQC0C1OKQX-HpcPzedh79EPjuuQAwcysn1Z3YTY_skrd2FBTX47FZGerqr7oNUQTFJjbjyj9DhQFVILsfNjkPqaI19ZYH3n9my-i3MRH6z_U/s1600/add+or+import+image+in+Drawable+-+android+example.png" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;img alt="add or import image in Drawable - android example" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY94ObWAlR7mK8IcUndiQCV5MMZ354mWVvQC0C1OKQX-HpcPzedh79EPjuuQAwcysn1Z3YTY_skrd2FBTX47FZGerqr7oNUQTFJjbjyj9DhQFVILsfNjkPqaI19ZYH3n9my-i3MRH6z_U/s1600/add+or+import+image+in+Drawable+-+android+example.png" height="450" title="add or import image in Drawable - android example" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;add or import image in Drawable - android example&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGSTcpOlU7EK1znr5jb9yW_Frm0JbZBqx6Q7B0iCHg7aiQ3l9yGzXsO8nxDCeU5fOwfA9NKujaIb_07iICrlCtzkFyrTbPxuSZRFclnCi8FESd8NRkpzZnFBYGI-kTy65xj7Njai1bRlw/s1600/add+or+import+image+in+Drawable+2+-+android+example.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img alt="add or import image in Drawable - android example" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGSTcpOlU7EK1znr5jb9yW_Frm0JbZBqx6Q7B0iCHg7aiQ3l9yGzXsO8nxDCeU5fOwfA9NKujaIb_07iICrlCtzkFyrTbPxuSZRFclnCi8FESd8NRkpzZnFBYGI-kTy65xj7Njai1bRlw/s1600/add+or+import+image+in+Drawable+2+-+android+example.png" height="450" title="add or import image in Drawable - android example" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;add or import image in Drawable - android example&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQG6AZOEs1DZXrDm3Nb9s0CuyBXu4jNSs1J6_sD9JS9fJd-_kTVg2uJLhnsROcA6RnuGVmV5sf8lr_W2zzm5DKH8VnGkr6r8GrabsDrDmXOYB_LyrGvmAINlGevxzI9s_jS0Wrq8mwUTo/s1600/add+or+import+image+in+Drawable+3+-+android+example.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img alt="add or import image in Drawable - android example" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQG6AZOEs1DZXrDm3Nb9s0CuyBXu4jNSs1J6_sD9JS9fJd-_kTVg2uJLhnsROcA6RnuGVmV5sf8lr_W2zzm5DKH8VnGkr6r8GrabsDrDmXOYB_LyrGvmAINlGevxzI9s_jS0Wrq8mwUTo/s1600/add+or+import+image+in+Drawable+3+-+android+example.png" height="450" title="add or import image in Drawable - android example" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;add or import image in Drawable - android example&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgytmaJr9BieEL5leAyjzntG-5v045kNkvbXSfgBriSjWgvV4HuxJLBohGdye3I4qdlj-Nr28YYsPhcA1Odq0pI6GkV4eXN9xA7emFVEKjBgQTi8vqpQS6NL8IkC8C8eooBNU9INjlttBg/s1600/add+or+import+image+in+Drawable+4+-+android+example.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img alt="add or import image in Drawable - android example" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgytmaJr9BieEL5leAyjzntG-5v045kNkvbXSfgBriSjWgvV4HuxJLBohGdye3I4qdlj-Nr28YYsPhcA1Odq0pI6GkV4eXN9xA7emFVEKjBgQTi8vqpQS6NL8IkC8C8eooBNU9INjlttBg/s1600/add+or+import+image+in+Drawable+4+-+android+example.png" height="448" title="add or import image in Drawable - android example" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;add or import image in Drawable - android example&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
This different folder works for to store images and display images on different size resolution through the scaling and resizing. Through this you can install same apk file on different device at the same time.&lt;br /&gt;
Next article helps to understand &lt;a href="http://vogella.blogspot.in/2014/01/how-to-call-image-id-from-drawable.html" target="_blank"&gt;How to use different layout image folder and why we need?&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY94ObWAlR7mK8IcUndiQCV5MMZ354mWVvQC0C1OKQX-HpcPzedh79EPjuuQAwcysn1Z3YTY_skrd2FBTX47FZGerqr7oNUQTFJjbjyj9DhQFVILsfNjkPqaI19ZYH3n9my-i3MRH6z_U/s72-c/add+or+import+image+in+Drawable+-+android+example.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">94</thr:total></item><item><title>How To Call Image ID From Drawable Folder Using Code Behind In Android</title><link>http://vogella.blogspot.com/2014/01/how-to-call-image-id-from-drawable.html</link><category>Android</category><category>Code Behind</category><category>Image</category><author>noreply@blogger.com (Jaysukh Patel)</author><pubDate>Wed, 8 Jan 2014 22:07:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8168649627428028513.post-5877998761885430904</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In Some situation we need to set image code behind, that time you fetch image id without XML file in you code behind. You can set it through the resource and drawable property. See in below examples&lt;br /&gt;
&lt;br /&gt;
You can call this image in your application project’s XML file using XML attributes like: android:drawable and android:icon.&lt;br /&gt;
&lt;br /&gt;
Android always use and support bitmap image file. So whenever you insert image in another format like .png, .jpg, .gif. &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;b&gt;.png = preferred&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;.jpg = acceptable&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;.gif = discouraged&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
You can call drawable image id using code behind through the below property and syntax&lt;br /&gt;
&lt;pre class="brush: js"&gt;// image name &amp;gt;&amp;gt; facebook_icon
Resources res = getResources();
Drawable dr = res.getDrawable(R.drawable.facebook_icon);
&lt;/pre&gt;See below image,&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi-D2-CPrbD0jJRu_xHjgPWqBfE0EPeoMrqllZDUDEEbLiiAWK0TRL94pofaes4yBpkswQ7M4UqFMH_OiH6d0wjGoBhdnYeTxiqpT3gzEfANAD9WzYLQEcvZPdhyphenhyphenGtRBguNjqBVaAhvnM/s1600/Call+Drawable+image+ID+using+Code+behind+in+android.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img alt="Call Drawable image ID using Code behind in android" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi-D2-CPrbD0jJRu_xHjgPWqBfE0EPeoMrqllZDUDEEbLiiAWK0TRL94pofaes4yBpkswQ7M4UqFMH_OiH6d0wjGoBhdnYeTxiqpT3gzEfANAD9WzYLQEcvZPdhyphenhyphenGtRBguNjqBVaAhvnM/s1600/Call+Drawable+image+ID+using+Code+behind+in+android.png" height="409" title="Call Drawable image ID using Code behind in android" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Call Drawable image ID using Code behind in android&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;By the calling Image id you can set image style like “&lt;b&gt;image behind textbox&lt;/b&gt;”, “&lt;b&gt;Beckground image&lt;/b&gt;”.&lt;br /&gt;
Code for Image behind textbox&lt;br /&gt;
&lt;pre class="brush: js"&gt;Resources res = getResources();
Drawable shape = res. getDrawable(R.drawable.gradient_box);

TextView tv = (TextView)findViewByID(R.id.textview);
tv.setBackground(shape);
&lt;/pre&gt;If you want to make different layout XML file under res folder for different screen size, &lt;a href="http://developer.android.com/training/basics/supporting-devices/screens.html" target="_blank"&gt;read this article must useful&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi-D2-CPrbD0jJRu_xHjgPWqBfE0EPeoMrqllZDUDEEbLiiAWK0TRL94pofaes4yBpkswQ7M4UqFMH_OiH6d0wjGoBhdnYeTxiqpT3gzEfANAD9WzYLQEcvZPdhyphenhyphenGtRBguNjqBVaAhvnM/s72-c/Call+Drawable+image+ID+using+Code+behind+in+android.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">42</thr:total></item><item><title>All Full Name And Forms In Android – Most Used Sort Cut Name In Android</title><link>http://vogella.blogspot.com/2014/01/all-full-name-and-forms-in-android-most.html</link><category>Android</category><category>Basic</category><category>Most Useful</category><author>noreply@blogger.com (Jaysukh Patel)</author><pubDate>Wed, 8 Jan 2014 06:02:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8168649627428028513.post-1185743509521367909</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Most of the android developer always forgot full form (APK, DDMS, JDK, AVD, SVN) and meaning of most useful Shortcuts code which is displayed in below. All are the shortcuts might be helpful in future for as interview question, and easy to understand functionality of any file and process.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt; all the Short names in your mind first and also note in your directory.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;APK&lt;/b&gt; – Application Package file&lt;br /&gt;
&lt;b&gt;DDMS &lt;/b&gt;– Dalvik Debug Monitor Service&lt;br /&gt;
&lt;b&gt;API&lt;/b&gt; - Application Programming Interface&lt;br /&gt;
&lt;b&gt;SDK &lt;/b&gt;– Software Development Kit&lt;br /&gt;
&lt;b&gt;JDK&lt;/b&gt; – Java Development Toolkit&lt;br /&gt;
&lt;b&gt;XML&lt;/b&gt; – Extensible markup language&lt;br /&gt;
&lt;b&gt;AVD&lt;/b&gt; – Android Virtual Device&lt;br /&gt;
&lt;b&gt;SVN&lt;/b&gt; – Subversion&lt;br /&gt;
&lt;br /&gt;
I hope you will gain some new full name from this article if you want to know so share this article on Facebook, twitter and Google+.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Keynote:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
Some of the short name like APK, DDMS, JDK, AVD you must know as technical person in collage and industry life. So don’t forget and remember.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">142</thr:total></item></channel></rss>