PowenKo, Android Tutorial 065-4, File, get Cache Dir, File Dir

August 29, 2011   ·   0 Comments

package com.powenko.Tutorial_File_Temp_Cache_folder;

import java.io.File;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;

public class Tutorial_File_Temp_Cache_folderActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        TextView  textView1 =(TextView) findViewById(R.id.textView1);
        Context context = getApplicationContext();
        File	t_file1=context.getCacheDir();
        String t_path=t_file1.getPath();

        String t_path2=context.getFilesDir().getPath();

        textView1.setText("CacheDir:"+t_path+"\n FileDir:"+t_path2);

    }
}

reference:

http://developer.android.com/guide/topics/data/data-storage.html

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By

Tags: , , , ,


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Android7

Amazon

adsbygoogle

Recent Posts

Categories

Amazon