Skip navigation

Monthly Archives: September 2011

Sending SMS

Android provides two ways of sending SMS using SDK. First of them is to use Intent library with proper configuration to use system’s messaging application. The second one is to use the SmsManager, what allows us to send SMS without any further question and confirmation. Let’s consider the latter one. Read More »

Backup all MySQL databases into separate compressed files

The easiest way of making backup is to use mysqldump, but it may not be as easy as it seems. Although there is a flag –all-databases, it results in dumping everything into a single file.

Let’s consider the following situation: you want to make automatic backup of each database on the server into the separate, bzip2 compressed file named with the date; and you want to store backups only for 7 days. Sounds a bit challenging?
Read More »

Saving files to the SD Card

At some point, an Android developer starts wondering where to store application’s additional content (i.e. images generated during the runtime) to preserve the efficiency and free space on the device. There are few answers to that riddle, but let’s consider the use of an SD Card.

First and the most obvious problem can be finding the card’s path. Most likely, it will be either /sdcard or /mnt/sdcard. It means that hard coding the path(s) is not such a good idea, isn’t it? Fortunately, you can get the card’s path by querying the system with:

Environment.getExternalStorageDirectory()

Read More »

Adding rows to a TableLayout during the runtime

Have you wondered how to create dynamic table in Android? It’s not really a hard thing to do, it just requires a XML template and some code in Java… shall we? Read More »