티스토리 뷰

public class ContextExam extends Activity{

private static final String TAG = "ContextExam";

public void onCreate(Bundle savedInstanceState){

super.onCreate(savedInstanceState);

//1. 시스템 서비스 호출

AccessibilityManager accessibilityManager =

(AccessibilityManager)this.getSystemService(Context.ACCESSIBILITY_SERVICE);

//2. Context application Pakcage에 연관된 database array return

String[] databaseList = this.databaseList();

for(String database : databaseList){

Log.i(TAG, "1. database : " + database);

}

Log.i(TAG, "2. database path : " + getDatabasePath("webview.db").getAbsolutePath());

//3. Return global application object of the current process

Context applicationContext = this.getApplicationContext();

ApplicationInfo applicationInfo = this.getApplicationInfo();

Log.i(TAG, "3. Application ClassName : " + applicationInfo.className);

Log.i(TAG, "4. Application SourceDir : " + applicationInfo.sourceDir);

Log.i(TAG, "5. Application DataDir : " + applicationInfo.dataDir);

//4. Return AssetManager instance

AssetManager assetManager = this.getAssets();

try{

String[] assetList = assetManager.list("/data/data/com.example.view");

for(String asset : assetList){

Log.i(TAG, "6. asset : " + asset);

}

}catch(IOException e){

e.printStackTrace();

}

//5. CacheDir 경로

File cacheDir = getCacheDir();

Log.i(TAG, "7. CacheDir = " + cacheDir.getAbsolutePath());

//6. PackageName

String packageName = getPackageName();

Log.i(TAG, "8. PackageName = " + packageName);

Log.i(TAG, "9. ExternalCacheDir = " + getExternalCacheDir());

Log.i(TAG, "10. ExternalFilesDir = " + getExternalFilesDir(null));

Log.i(TAG, "11. FilesDir = " + getFilesDir());

Log.i(TAG, "12. PackageResourcePath = " + getPackageResourcePath());

String stringName = getResources().getString(R.string.app_name);

Log.i(TAG, "13. R.string.app_name = " + stringName);

Log.i(TAG, "14. R.string.app_name = " + this.getString(R.string.app_name));

Log.i(TAG, "15. isRestricted = " + isRestricted());

//sendBroadcast();

//startActivity();

//startService();

//registerReceiver();

Log.i(TAG, "16. PackageCodePath = " + getPackageCodePath());

}

}

 

위와 같다.

참고로 cocos2d-x에서 getWritablePath로 얻어올때의 경로는 DataDir의 경로와 일치한다.

 

위의 자료는 http://blog.daum.net/mellowwind/10853723 에서 퍼옴.

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함