Monday, July 30, 2012

File path to Uri convert android or Uri to file

Convert file path to Uri


File externalFile = new File(Environment.getExternalStorageDirectory(),"image.png");
Uri external = Uri.fromFile(externalFile);




Uri to file convert.


File f = new File(uri.toString());

Wednesday, July 11, 2012

How to set costume fonts in android


1. create assets/fonts/ and put your TTF files in there:
2.set view's properties.
 TextView tv=(TextView)findViewById(R.id.custom); 
  Typeface face=Typeface.createFromAsset(getAssets(), "fonts/ARIAL.ttf"); 
  tv.setTypeface(face); 

Tuesday, July 10, 2012

Set Dynamic Image Resource to android Image button android.




// 1.Create button
// 2 .Assign background
ImageView button = (ImageView) bottomView.findViewById(R.id.button);
button.setId(i);
button.setBackgroundResource(getResources().getIdentifier(
"image1", "drawable", getPackageName()));

content -->