Android allows us to store files in its file system which is quite similar to any other Linux filesystem that you must have experience with. Using the
java.io file input/output APIs we can start reading and writing files to the Android filesystem. This is super useful when you want a store files (but not relational data or some sort of key/value cache pairs) on the device. Files like audio, video, images, documents, etc. all makes sense to store in the file system when required.
Android has a concept of shared preferences using which application preferences data can be stored persistently. That means the data or state won’t be lost until the application is uninstalled. The preferences data can be stored as key/value pairs and are available across all the Activities of the given application or can also be restricted to a particular Activity.
In this quick tip, we’ll see how to use the excellent Android Debug Bridge (adb) tool on the command line to list all the installed packages on our android device (non-rooted in my case) and then extract one of their APK files to our computer.
When using the versatile Android Debug Bridge (adb) tool to issue commands, if there’s only one device or emulator attached then that’s fine as the commands will be executed on exactly that. But if there’s more than one instance then we’ll get an error on the terminal saying
error: more than one device and emulator.
I upgraded a lot of things on my system. From Mavericks to Yosemite (upgrading the entire Mac operating system itself) to upgrading the Android SDK with Eclipse as well as Android Studio from 0.6.1 to 0.8.6.
We’ve already discussed
ViewPager in depth in one of my earlier posts. We saw how to use it with specific
PagerAdapter implementations like
FragmentStatePagerAdapter that works with fragments but we can also use it to inflate any other
ViewGroup (with standard View hierarchy) by hooking it up with
PagerAdapter itself. In this tutorial we’ll just discuss how to how to hook a
PagerAdapter to a
ViewPager to create an Image slideshow.