Got data to save?
If you need to take a photo from within your app, just tap into the Camera app to do it for you.
All apps need a launcher icon.
This is the 2nd part of a two part series of articles on designing Android apps for multiple screens. Here's a link to part 1, Different images for different devices: bitmaps, pixels and other things that go bump in the night
Put all images that you use in an Android app inside a drawable folder. You should also supply different size images for the different screen densities.
Android devices come in different shapes and sizes. Their screen sizes range from small phones to 10 inch tablets and larger TV’s. They also have different screen densities.
There are two main graphic types, bitmap and vector graphics.
Vector graphics describe an image according to its geometric characteristics and can be resized without losing quality.
In Android, we’re more interested in Bitmap images which are stored electronically as a map of bits.
Another electronic image term is the pixel. Sometimes bits and pixels are interchanged and a bitmap can refer to a map of pixels, where each pixel represents a colour.
Bitmaps are resolution dependent which means they contain a fixed number of pixels so they will lose quality if you change their size.
A ListView displays items in a vertical, scrolling list. It contains a number of views, one for each item in the list. Here’s an example:
SharedPreferences are not the same as the typical user preferences where one, for example selects the preferred default sound, text size, colours, etc. for an app.
You’ve spent hours developing your app and each time you test it, it either bombs or returns results that you never expected. You would love to see what’s causing the problem. Well you can. Android’s Log class enables you to do just that. You can use the Log class to display messages as the app runs and even filter the messages so that only messages that you are interested in are displayed.
I was busy doing some Android coding and needed to compare two dates. The result of the comparison had to show whether the dates were the same or whether one was greater than the other (or smaller). Having stored the dates as an integer in a SQLite database, I extracted and converted them into long objects. It was these long objects that I had to compare.
As the long objects were accurate time stamps in milliseconds (including hours, minutes, seconds, and milliseconds), this posed a problem when comparing the dates as the same dates would not register as being equal if they differed by even a millisecond! The solution was to first convert them into a format that only represented the day, month and year.
You can have as many categories and questions as you like (although you probably won't want more than about 10 categories). The order in which you enter the categories doesn't really matter as long as you stick to the format (as described above) for each row. Remember that the trial version only shows two categories.
Once you've downloaded the text file to your device, it will be converted into a database by the app. If you choose to uninstall the app, it won't affect your text file which will remain in the device's Download folder.
You may find it easier using a spreadsheet to create your text file. OpenOffice and LibreOffice work fine and so should Microsoft Excel. I'll be posting how-to articles on the first two options here shortly.