Hi,
If you want to save some files on external storage and you want those files to be removed on application un-installation, then do as the documentation says ;)
If you're using API Level 8 or greater, use getExternalCacheDir() to open a File
that represents the external storage directory where you should save cache files. If
the user uninstalls your application, these files will be automatically...
Tuesday, April 17, 2012
Android: Create an image Viewer using ViewPager.
Posted by Polaris on 1:12 AM
Hi,
This post is for those guys digging the Internet trying to find out how to create an image viewer. And I managed to do that using ViewPager.
First, you'll need to download the support package using the SDK manager.
Then, set up the project to use the library, as mentioned here. OR, if you use Eclipse, you can simply right click your project > Android Tools > Add Compatibility Library.
I'll...
Posted in Android
Sunday, April 15, 2012
Android: Create a simple horizontal image list.
Posted by Polaris on 12:04 PM
Hi,
In this post we'll create our horizontal image List using HorizontalScrollView.
First, create the layout.
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<HorizontalScrollView...
Posted in Android
Friday, April 6, 2012
Android: Layout params programmatically.
Posted by Polaris on 8:13 PM
Hi,
This is a concise tip.
To set the width, height and gravity for -say - a LinearLayout, do the following:
LinearLayout linearLayout = (LinearLayout)findViewById(R.id.movieDetails_linearLayout);
linearLayout.setLayoutParams(new ParentView.LayoutParams(LayoutParams.WRAP_CONTENT
, LayoutParams.WRAP_CONTENT,Gravity.CENTER_HORIZONTAL));
Note...
Posted in Android
Subscribe to:
Posts (Atom)
Android: Saving cache files on external storage.