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.

  • Using ksoap2 for android, and parsing output data

    So the other day, I was asked to check out how we could use soap on Android, preferably with ksoap2 for android, and a public SOAP Web Service. For the latter the TopGoalScorers web service was chosen.

  • Is this the first run?

    Ever wanted to have a different flow of actions on the second or third run of your app? I had that many times, in almost every project that I haver worked on. So here is a little snippet, that you can use to store, and check the fact, if this is the first run of your app. You can modify it easily, to suit your needs.

  • How to send email from your application

    Today we'll create an easy email sender application.
    First of all we need to create a layout to set the address, the subject and email body box.

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

  • How to play video and audio on Android Part 2.

    In this part, I'm going to focus on MediaPlayer. I'm going to show you, how to stop it properly, and how to create a media player more easily.
    The default behavior is the same, with every activity, after onPause and onStop, if the activity is not destroyed, it will continue to run in the background, until it is killed so the system can free up the memory it is using. So until the activity is destroyed, the mediaplayer will continue to occupy space in the phones memory.

  • How to avoid OutOfMemory Error / OOM (The Ugly Truth Revealed)

    ERROR/dalvikvm-heap(4204): 691456-byte external allocation too large for this process.
    01-25 22:13:18.694: ERROR/(4204): VM won't let us allocate 691456 bytes 01-25 22:13:18.694

    If you have ever got the message above, you are at the right place.

    First of all the reason:
    Heap size != External Memory size

    Dalvik's external memory is limited to ~ 4MBs for each process (That is the Ugly Truth). If it overflows, you get...

  • How to have a default database

    If you want to include a database with initial data in your apk, you have to insert the database file into the projects assets folder, then programmatically check if the database, and if it does not exists copy the one from the assets.

    You will need a function to check if the database exists, fox example:

    1. private...

  • How to display a custom dialog in your Android application

    How to display a custom dialog in your Android application

    Yesterday Jozsi showed you, how to make an alert dialog, today I'm going to show you, how to make a custom dialog/popup window.
    Sometimes, it's better to make your own dialog, because this way, you can display whatewer you want., the way you want it.
    First, make your own layout, with the needed elements. Here, I'm going to use two buttons, a textview inside a scrollview, and an imageview...

  • How to display an AlertDialog in your Android application

    Here is an example of an applacation, that illustrates how you can create a simple AlertDialog. The dialog can display maximum three buttons.

  • Connecting to MySQL database

    The most spread method to connect to a remote MySQL database from an android device, is to put some kind of service into the middle. Since MySQL is usually used together with PHP, the easiest and most obvious way to write a PHP script to manage the database and run this script using HTTP protocol from the android system. mysql logo
  • How to play video and audio on Android

    There is more than one way, to play media files on an Android phone, let me show you two of them.


    MediaPlayer is the easier way, if you just want to play an audio file in the background, somewhere in an appliaction. There are no ui controls here, but of course you can use MediaPlayer.stop(), play(), seekTo() ,etc. Just bind the needed...