New tutorials

Welcome to our Tutorials section! We are working hard to bring you high quality and interesting tutorials. Also check out the tutorials forum if you have any problems or want to make a request. Also, if the text in the code samples is too small, click here for an explanation.

  • Flickr api, random image goodness

    Lately we have been doing all kinds of demo projects, and tests, where we did not want to use constant data to present our products. Having a demo of your application is only nice, if it has relevant data in it. It could be top class technology, but if it is using the same image 20 times in a list, well that does not look very good.
    Getting 20 relevant images on a subject takes up a lot of time, even with search engines and royalty free photo sites.Luckily most search able sites have...

  • How to use ViewFlipper

    You have probably already heard about ViewFlipper. If not, go to website: http://developer.android.com/reference/android/widget/ViewFlipper.html
    and check it.

    "Simple ViewAnimator that will animate between two or more views that have been added to it. Only one child is shown at a time. If requested, can automatically...

  • Gradient dividers

    Today I’m going to show you an easy way to create gradient backgrounds in your applications.

    Create an xml file in drawable directory and modify like this:

    1. <?xml version="1.0" encoding="utf-8"...

  • How to store large amount of data


    The internal storage of an android device is very limited, so if your application downloads or somehow generates a large amount of data to store, you should save it on the external storage, the sd card. Even 1mb of data takes much space compared to the whole internal capacity on most of the current devices. The sd card has a bigger magnitude, and it is even...

  • Android licensing simple example

    Android Market Licensing is a network-based service that lets an application on an Android-powered device query a trusted licensing server, to determine whether the application is licensed to the current device user. After receiving the server response, the application can then allow or disallow further use of the application as needed. In the service, the role of the licensing server is to provide the license status for the current user; the application itself is responsible for querying...

  • Database transactions

    In android it is highly important to use transactions when working with databases.

    First, in android database operations - especially writing - are very slow. Batching them into transactions will make them much faster.

    Second, the database remains consistent under any circumstances. The database system makes sure to all the operations in a transaction take effect, or on error, rollback all of them.

    If you are used to other platforms like PHP+MySQL where the code usually...

  • Encrypting your data

    Sometimes you don't want to store any data on the sd card, but you have to, because your apps resources would take up too much space int the internal memory.
    Here is a method on how to store your data securely.

  • Interrupting a call

    end callAs far as I know there is no public API for interrupting/ending a call. You can detect calls and the states of calls, maybe even prevent an outgoing call, but there is no API for ending an ongoing call.
    This must be a security issue, but I also met the need of this feature, and only was able to do some workaround: turning on airplane mode interrupts all wireless connections...

  • Share on - popup snippet, and facebook problems

    Android always had very good social network, and communcation tool integration. All of the preinstalled communication tpye apps, and a lot of 3rd party apps have support for communcation between each other, via the ACTION_SEND intent.

  • Is it on? An internet connection checker snippet

    Most of our apps use the internet in some way, so we made an util class, that we use regularly. To save some bandwidth, I only use it after a connection related exception(ioexception etc) was thrown, but of course checking ahead is a good idea sometimes.