Search found 35 matches

Go to advanced search

by vivekkalady
Sat Nov 22, 2014 9:34 am
Forum: Libraries
Topic: Smart Image View for Android
Replies: 0
Views: 1011

Smart Image View for Android

SmartImageView is a drop-in replacement for Android’s standard ImageView which additionally allows images to be loaded from URLs or the user’s contact address book. Images are cached to memory and to disk for super fast loading. Features ⋅ Drop-in replacement for ImageView ⋅ Loa...
by vivekkalady
Sat Nov 22, 2014 9:19 am
Forum: Libraries
Topic: Picasso - Image downloading and caching library for Android
Replies: 0
Views: 6629

Picasso - Image downloading and caching library for Android

Picasso allows for hassle-free image loading in your application—often in one line of code! Prerequisites: ⋅ Create new Android project using your favorite IDE (I’ll using Eclipse). ⋅ Download Android Picasso library. ⋅ Put the downloaded jar file into your project’s “...
by vivekkalady
Fri Nov 21, 2014 5:57 pm
Forum: Tutorials & Examples
Topic: Layout Background texture in android
Replies: 0
Views: 560

Layout Background texture in android

Pick something from Subtle Patterns , e.g. irongrip.png and drop it in your drawable-hdpi folder Make a BitmapDrawable, e.g. irongrip_repeating.xml <?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src=&quo...
by vivekkalady
Fri Nov 21, 2014 5:45 pm
Forum: Tutorials & Examples
Topic: Write a File to SDCard
Replies: 0
Views: 495

Write a File to SDCard

This code shows how to write a file to SDCard Add this permission to manifest <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> Check availability of external storage boolean mExternalStorageAvailable = false; boolean mExternalStorageWriteable = false; String sta...
by vivekkalady
Fri Nov 21, 2014 5:36 pm
Forum: Tutorials & Examples
Topic: Read File from SDCard
Replies: 0
Views: 529

Read File from SDCard

This is a sample code to read a file and convert to string //Find the directory for the SD Card using the API //*Don't* hardcode "/sdcard" File sdcard = Environment.getExternalStorageDirectory(); //Get the text file File file = new File(sdcard,"file.txt"); //Read text from file S...
by vivekkalady
Fri Nov 21, 2014 5:06 pm
Forum: Tutorials & Examples
Topic: Sort Arraylist of Custom Object in Android
Replies: 0
Views: 463

Sort Arraylist of Custom Object in Android

Date Comparison Since Date implements Comparable, it has a compareTo method just like String does. So custom comparator could look like this: public class CustomComparator implements Comparator<MyObject> { @Override public int compare(MyObject o1, MyObject o2) { return o1.getStartDate().compareTo(o...
by vivekkalady
Fri Nov 21, 2014 4:49 pm
Forum: Tutorials & Examples
Topic: Save Image to SQLite Database in Android
Replies: 0
Views: 900

Save Image to SQLite Database in Android

This is a simple example for saving and retrieving image Setting Up the database "CREATE TABLE " + DB_TABLE + "("+ KEY_NAME + " TEXT," + KEY_IMAGE + " BLOB);"; Insert in the Database: public void addEntry( String name, byte[] image) throws SQLiteException{ Con...
by vivekkalady
Fri Nov 21, 2014 2:57 pm
Forum: Tutorials & Examples
Topic: Read from Assets folder in android
Replies: 0
Views: 432

Read from Assets folder in android

Read String from Asset Folder public static String getTextFromAsset(Context ctx,String file_name) { AssetManager assetManager = ctx.getAssets(); ByteArrayOutputStream outputStream = null; InputStream inputStream = null; try { inputStream = assetManager.open(file_name); outputStream = new ByteArrayO...
by vivekkalady
Fri Nov 21, 2014 2:47 pm
Forum: Tutorials & Examples
Topic: Read from Raw Folder in Android
Replies: 0
Views: 347

Read from Raw Folder in Android

The below code blocks allows you to read different kinds of file from raw folder of an android application Text file public static void readRaw(Context ctx,int res_id) { InputStream is = ctx.getResources().openRawResource(res_id); InputStreamReader isr = new InputStreamReader(is); BufferedReader br ...
by vivekkalady
Fri Nov 21, 2014 2:32 pm
Forum: Tutorials & Examples
Topic: Custom Font in Android
Replies: 0
Views: 463

Custom Font in Android

Method 1 This is the basic code for setting Font to a textview ⋅ create a folder called fonts in Assets folder of the project ⋅ then copy the font file (.ttf) to the fonts directory ⋅ the write the below code public class MainActivity extends Activity { @Override prote...

Go to advanced search

cron