Working with SDCard’s filesystem in Android

It is very easy to work with SDCard in Android. Here we are working with File objects as with standard Java I/O operations.
In this article I am going to show how to read, write, create files and how to create a folder in SDCard. Continue reading Working with SDCard’s filesystem in Android

  • Share/Bookmark

Using XML file resources in Android

In Android application you can use /res/xml XML files. These files are different than other Android resources. They are different from raw files, you don’t use a stream to access them because they are compiled into an efficient binary form when deployed, and they are different from other resources and they can be of any custom XML structure. Continue reading Using XML file resources in Android

  • Share/Bookmark

Using files as raw resources in Android

Why need such type of resources, we can get data from /assets, /res folders and now I am going to show /res/raw folder.

It is simple, raw resources are not compiled by the platform, they available as raw files and these files can refer to any type of files. When you need to include raw files in your application you can do so using /res/raw resources location. When you will place files here, they will be available as raw resources. Continue reading Using files as raw resources in Android

  • Share/Bookmark

Using filesystem in Android

You can use Android’s filesystem the same as you use it in your life. Creating, editing, deleting, reading and etc.

I want to remember that filesystem is based on Linux. Android allows to use full advantages of java.io package when you are working with it without limitations. Continue reading Using filesystem in Android

  • Share/Bookmark

Getting SharedPreferences from other application in Android

As I wrote in previous post, where I described how to use preferences system, SharedPreferences object can be created and opened with Context mode constants. These constants allows to define who has access to what preference. Also it is not a secret that data contains in xml file. As I said constants allows to define access to preferences and it is not a problem to have access from other application to these files. Continue reading Getting SharedPreferences from other application in Android

  • Share/Bookmark

Using SharedPreferences in Android

Android has a mechanism which called preferences system for saving simple key-value pairs of primitive data types within applications. This mechanism works through SharedPreferences object. Preferences system stores data in xml file. If this file doesn’t exists Android will create automatically one. Preferences can be private or be accessible to other application. You can use it for storing some global application state and so on. It is very useful feature. Continue reading Using SharedPreferences in Android

  • Share/Bookmark

Using assets in Android

Android offers one more directory where you can keep files which also will be included in package. This directory called /assets. The difference between /res and /assets is that Android doesn’t generate IDs for assets content. You need to specify relative path and name for files inside /assets. Continue reading Using assets in Android

  • Share/Bookmark