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.
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.
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.
- <?xml version="1.0" encoding="utf-8"?>...
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.
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...
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:
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...
Here is an example of an applacation, that illustrates how you can create a simple AlertDialog. The dialog can display maximum three buttons.
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.
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...
New tutorials from Helloandroid
Android on Twitter
Android Development Projects
- Reverse Engineering IOS or Android APP by vw7468783vw
- Write an Android application by vinu121280
- Write some Software by vw7468783vw
- Write an Android - iPhone application whith geolocation and video capabilities by akoynadeis
- Fullstack React Native Mobile App for iOS & Android with Node.Js backend by esuite
- Write an iPhone application by errahulka
- Write an Android application by eusuff
- An application which helps people avoid heavy traffic. by janinepatillas28
- Help me with a 5 minute android task by codehelp87
- Mom's Organizer and Family Planner by bjkulkarni