Android Development Tutorial

Android Development TutorialIn a previous tutorial, I showed you how to Install the Android Development Tools. In this first part of my Android Development Tutorial I’m going to describe almost every file and folder used to develop an Android app.

I’ll walk through every single file and explain how it is used. I’ll explain the whole file system. We’ll also make an app and as I create it, I’ll explain every single step and what everything means. I have never seen anyone try to teach this much in one video. I hope you enjoy it. All of the commented code is available below.

If you enjoy videos like this, it helps to tell Google+

Code From the Video

activity_main.xml

<!-- 
We are going to use the LinearLayout this time. It Aligns all elements 
in one direction. We will define that by setting orientation to 
horizontal. LinearLayout is the root view and it will fill the
devices screen. 
 -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <!-- 
    To create a editable text field add an EditText element. By setting
    id you'll be able to reference this element in your app code. @ is used 
    when referring to an object from XML. Then id is the resource type. Then
    you have the resource name. You use the plus sign only when you create a 
    resource for the first time. We use wrap_content to avoid using pixels.
    hint is the String that will be displayed in the textfield by default.
    This refers to a String resource that is defined in another file. 
    If you want the textfield to fill the space not taken up by the button
    you can assign layout_weight with a value greater then 0. Every element
    has a default weight of zero. If you give one element a weight of 2 
    and the other a weight of 1, the first will take up 2/3rds of the row
    and the next the last 3rd. layout_width is now irrelevant because the
    weight has been set.
     -->
    
    <EditText android:id="@+id/edit_message"
        android:layout_weight="1"
        android:layout_width="0dp"
    	android:layout_height="wrap_content"
    	android:hint="@string/edit_message" />
    
    <!-- 
    Use Button to create a button. Pull the String for the button from
    strings.xml
    By assigning sendMessage to onClick, when the button is clicked the
    method sendMessage will be executed.
     -->
    
    <Button 
        android:layout_width="wrap_content"
    	android:layout_height="wrap_content"
    	android:text="@string/button_send"
    	android:onClick="sendMessage" />

</LinearLayout>

strings.xml

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

    <string name="app_name">First App</string>
    <string name="edit_message">Enter a Message</string>
    <string name="button_send">Send</string>
    <string name="action_settings">Settings</string>
    <string name="title_activity_main">MainActivity</string>
    
    <!-- Message String put here by Eclipse when DisplayMessageActivity
    was created -->
    <string name="title_activity_display_message">My Message</string>
    <string name="hello_world">Hello world!</string>

</resources>
<!--
Text used in a user interface should be saved as a String
resource, so that everything can be managed in one place.
-->

MainActivity.java

package com.newthinktank.firstapp;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends Activity {
	
	// Store a unique message using your package name to avoid conflicts
	// with other apps. This stores the message I plan on displaying
	public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	// This method is called when the user clicks on the Send button
	
	public void sendMessage(View view){
		
		// An intent is an object that can be used to start another activity
		// this is a reference to MainActivity
		// MainActivity is of type Activity, which is of type Context.
		// A Context can represent various application specific 
		// resources. Different resources gain access to others because
		// of shared methods inherited from the Context class.
		
		// DisplayMessageActivity is an Activity we want to start
		
		Intent intent = new Intent(this, DisplayMessageActivity.class);
		
		// Create a text area and place it in the view
		EditText editText = (EditText) findViewById(R.id.edit_message);
		
		// Store the text in the text area
		String message = editText.getText().toString();
		
		// Add the text to the intent
		intent.putExtra(EXTRA_MESSAGE, message);
		
		// startActivity causes the Activity to start
		startActivity(intent);
		
	}

}

DisplayMessageActivity.java

/*
 * Create an Activity
 * 1. Click New in toolbar 
 * 2. Select Android Folder - Android Activity
 * 3. Select BlankActivity
 * 4. Project: FirstApp
 * 	  Activity Name: DisplayMessageActivity
 * 	  Layout Name: activity_display_message
 * 	  Title: My Message
 * 	  Hierarchial Parent: com.newthinktank.firstapp.MainActivity
 * 	  Navigation Type: None
 * 5. Open DisplayMessageActivity.java (This File)
 * 6. Delete the onCreateOptionsMenu() method
 */

package com.newthinktank.firstapp;

import android.os.Bundle;
import android.app.Activity;

import android.view.MenuItem;
import android.widget.TextView;
import android.support.v4.app.NavUtils;
import android.annotation.TargetApi;
import android.content.Intent;
import android.os.Build;

public class DisplayMessageActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		// Get the message from the intent
	    Intent intent = getIntent();
	    
	    String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);

	    // Create the text view
	    TextView textView = new TextView(this);
	    textView.setTextSize(40);
	    
	    
	    // Set the String in the text box
	    textView.setText(message);
		
	    // Set the activity with this new text
		setContentView(textView);
		// Show the Up button in the action bar.
		setupActionBar();
	}

	/**
	 * Set up the {@link android.app.ActionBar}, if the API is available.
	 */
	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	private void setupActionBar() {
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
			getActionBar().setDisplayHomeAsUpEnabled(true);
		}
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home:
			// This ID represents the Home or Up button. In the case of this
			// activity, the Up button is shown. Use NavUtils to allow users
			// to navigate up one level in the application structure. For
			// more details, see the Navigation pattern on Android Design:
			//
			// http://developer.android.com/design/patterns/navigation.html#up-vs-back
			//
			NavUtils.navigateUpFromSameTask(this);
			return true;
		}
		return super.onOptionsItemSelected(item);
	}

}

AndroidManifest.xml is updated with the following by eclipse

<activity
            android:name="com.newthinktank.firstapp.DisplayMessageActivity"
            android:label="@string/title_activity_display_message"
            android:parentActivityName="com.newthinktank.firstapp.MainActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.newthinktank.firstapp.MainActivity" />
        </activity>

148 Responses to “Android Development Tutorial”

  1. Frank Reck says:

    You are a star..Great Job on all these tutorials…

  2. Conor says:

    Excellent .. thanks..

    When is your next Android tutorial ?

  3. Waqas Asghar says:

    Hey derek … how r u man?? Thanks a lot for starting android series. I was waiting for this for a long time. now finally world best teacher will teach us how to make apps in android. May God bless you. Stay Happy and blessed

    Regards

    Waqas Asghar

  4. Bacem says:

    Great starting point forAndrois development ! I like your teaching methodology Derek. It’s clear, concise, up to the point and funny :)
    You are really a special person !
    I like also very much your tutorials on OOP and design patterns.
    Wish you a successful continuation.

  5. kapil says:

    i am geting this as error
    “editmessage cannot be resolved or is not a field”
    what to do .plz help???

    • Derek Banas says:

      Did you copy the code I provided?

      • kapil says:

        yes.now when i rewrite code again in eclipse its giving—-
        W/ResourceType( 4400): Bad XML block: header size 92 or total size 0 is larger than data size 0
        W/ResourceType( 4400): Bad XML block: no root element node found
        C:\Users\kk\workspace\Myfirstapp\res\layout\activity_main.xml:30: error: Error: No resource found that matches the given name (at ‘hint’ with value ‘@string/editmessage’).
        C:\Users\kk\workspace\Myfirstapp\res\menu\activity_display_message.xml:2: error: Error: No resource found that matches the given name (at ‘title’ with value ‘@string/menu_settings’).
        C:\Users\kk\workspace\Myfirstapp\res\menu\activity_main.xml:50: error: Error parsing XML: junk after document element.

        plz help me in solving that.

  6. Nabil says:

    The R.java seems to be missing in my project. How can I fix it? thank you.

  7. mustafa says:

    This is the most powerful and clear tutorial I have seen. Thanks…

  8. Mark C says:

    Hi Derek, brilliant instructions although I still don’t get parts of it and when I try and apply my own coding I struggle with debugging and knowing what to do.

    I’d really like to program for Android devices as I’ve a few ideas knocking around but would you recommend me learning Java first?

  9. COURAGE says:

    Derek, you too much, can l ask whether you have study educational psychology before, because it gives you a good command in delivery a lesson, l think you love this job, keep it up, hope to learn from you and keep in touch with you.
    Folks, he did a great job. Thumps

    • Derek Banas says:

      Thank you :) I have taught many people in the past. First when I was a software architect, it was my job to teach new hires in a away that is very similar to what I do online. I also used to teach job skills to unemployed people for free. Yes, I love to teach, but for now I only teach online. I’m very happy that you enjoy the videos!

  10. RIchard says:

    Great tutorials TYVM

  11. jp says:

    What OS platform are you using?

  12. jp says:

    also under Hierarchial Parent there is nothing to choose..

  13. copernicus says:

    hello,

    Again can you tell me why there is NOTHING listed in Hierarchial Parent: “”"com.newthinktank.firstapp.MainActivity”"”

    I decided to my application as you did and under Hierarchial Parent there are NO choices. thks

  14. Dvir Arad says:

    10X Derek
    now I finish my exam for this simister.
    now i have some problem, i get an error

    [2013-07-08 12:46:14 - FirstApp] ——————————
    [2013-07-08 12:46:14 - FirstApp] Android Launch!
    [2013-07-08 12:46:14 - FirstApp] adb is running normally.
    [2013-07-08 12:46:14 - FirstApp] Performing com.example.firstapp.MainActivity activity launch
    [2013-07-08 12:46:14 - FirstApp] Automatic Target Mode: Preferred AVD ‘sasd’ is not available. Launching new emulator.
    [2013-07-08 12:46:14 - FirstApp] Launching a new emulator with Virtual Device ‘sasd’
    [2013-07-08 12:46:16 - Emulator] Failed to allocate memory: 8
    [2013-07-08 12:46:16 - Emulator]
    [2013-07-08 12:46:16 - Emulator] This application has requested the Runtime to terminate it in an unusual way.
    [2013-07-08 12:46:16 - Emulator] Please contact the application’s support team for more information.

  15. Hi Derek,

    I have taught classes in IT myself and also listened to a boatload of instructional videos over the years and your tutorials are the crème de la crème. Clear voice with just the right volume. I am also amazed at how you do it without halting plus keeping synchronized with the excellent video I can follow along with in Android Studio.

    The “just do it” method is the way to learn with your excellent commentary in the background, explaining the ins and outs as the tutorial progresses.

    I can’t say enough about how these are helping me with getting into mobile development. Keep up the excellent work. These make learning a difficult subject a pleasurable and rewarding experience.

    Regards,

    Stony Creek Consulting, LLC
    Joseph J. Geller

    • Derek Banas says:

      Thank you very much for the kind words Mr. Geller :) I greatly appreciate them!

      I just started making videos with an open mind and took the advice that my viewers gave me. If they weren’t nice enough to tell me how I could improve I would have never made it to the point in which I now make pretty good videos.

      I still have a long way to go. For example I know I need to provide tools that will allow people to quiz themselves and I plan on making free apps very soon to do that as well. I hope to some day cover math and science in the same way.

      Thank you
      Derek

      • Searock says:

        If you are planning to make tools that will allow people to quiz themselves, I would love to help you.

        I am currently viewing your design patterns and android tutorial and they are so easy to understand.

        Thank you, Derek :)

        Searock

        • Derek Banas says:

          Thank you very much for the offer. Yes I’m planning on creating free Android apps that will work together with the video tutorials. I may reach out to people in the future. It will be a big undertaking on my part. I’m very happy that you enjoyed the videos :)

  16. Dela says:

    Amazing tutotral, so intuitive to follow and very sound and clear.

    Apsolutely great!

    :)

  17. Mustafaraza says:

    Emulator doesn’t load when i press the play button thought it does load when you do it throught the setting method

  18. Mustafaraza says:

    DO you have videos which shows have to add buttons and text boxes have to changes colours and ETC

  19. Hey, man!

    Great job on all of the tutorials you did. Mainly, I am doing Web Application Development, but recently started doing some Android applications. I randomly saw your Android videos and decided to see in what way and how you explain things. You’re just awesome! Keep up the good work. I should start doing tutorials, too, so I can help people in need.

    Greetings from Bulgaria!

    • Derek Banas says:

      Thank you :) I basically just took the advice I received on YouTube. That is why I’m different from most other tutorial guys. I also don’t watch other tutorials to keep from being influenced.

      You definitely should give the tutorial thing a go. I dream of a day in which a free education will be available for everyone in the world. I definitely can’t cover everything on my own. Always feel free to ask for advice. There are many things I wish I would have known in the beginning.

      Best of luck

  20. vishu says:

    great job sir !!!!!1
    tell me….list of the java concepts,..one should know…to basically understand these android tutorials…..
    thnkiewwww veryyy much :) :)

  21. Purru says:

    Hey Great job…
    Good to have subject commander leading the way :)
    god bless you…
    Thx
    S

  22. Srivats says:

    Hello Sir,

    Im getting a redline under the edit_message..
    Im not able to resolve it at all…..
    I tried your code too….
    Is there any way you could help me? I cannot proceed at all if i dont get this. :( :(

  23. Cameron says:

    Please ignore, my last comment; it turns out that the error was caused by putting the activity_main.xml in the DisplayMessageActivity.xml these tutorials have been amazingly helpful and simple.

  24. Neeraj says:

    Derek, I have seen so many tutorials on the web, they all have great technical info.
    But your tutorials not only have great content and technical info, the way you communicate, everything becomes so easy to learn and understand.

    I hope this site and your videos is always available.

  25. Peter says:

    Thank you very much really helpful clear tutorial

    your videos are amazing!!!

  26. Sumitraj says:

    Absolutely great!!!
    voice is clear and understand your every code very clearly…
    Thanks for your tutorials i am gonnna build my first app soon.. :)

  27. nishant says:

    hey i have done all the things but still app is not running

  28. kuldeep says:

    Hi Derek,

    Firstly thanks a lot for such nice tutorials ! I was able to proceed further and did try this first tutorial on eclipse. However, I get strange output when i click on the button SEND. Whatever message i type in text box prior to pressing SEND, the next screen prints “hello world” .. I am not sure why it happens !! I am trying to debug it, but in case someone already asked you this before, it would be great if you can please let me know what mistake i might be doing !

    Thanks

    • Derek Banas says:

      I’m sorry, but I don’t understand what the error is?

      • kuldeep says:

        Hi Derek,

        There is no error, but the output is not correct. I mean lets say i type a message on the text box ” I am kuldeep” and then click on SEND button. The next screen shall show “I am Kuldeep”, However, it shows “hello world” !! So the functionality is not working correctly. If you see that in strings.xml

        ActivityForThought
        Enter a Message
        Send
        Settings
        My message
        Hello world!

        the last tag is “Hello World!” , this is what i get as an output !!

        activity_main.xml:

        DisplayMessageActivity.java:

        protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Intent intent= getIntent();
        String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
        System.out.println(“message is:” +message);
        TextView textView = new TextView(this);
        textView.setTextSize(40);

        textView.setText(message);
        setContentView(textView);

        setContentView(R.layout.activity_display_message);
        // Show the Up button in the action bar.
        setupActionBar();
        }

        activity_display_message.xml:

        In the MainActivity.java i have following function:

        public void sendMessage(View view){
        Intent intent = new Intent(this, DisplayMessageActivity.class);

        EditText editText = (EditText) findViewById(R.id.edit_message1);

        String message= editText.getText().toString();

        intent.putExtra(EXTRA_MESSAGE, message);

        startActivity(intent);

        }
        Meanwhile, I will try on my own and see why this is happening !

        • kuldeep says:

          OK , I see that xml tags are totally messed up which i tried to paste in above comment !! Please ignore them if they confuse you. I will try to resolve this error !

          thanks

        • Derek Banas says:

          I have a couple of guesses on the error, but if you compare your code to the code I provide on this page at a website like DiffNow, you’ll quickly find the error.

          Tell me if that didn’t work.

          • kuldeep says:

            Hi Derek,

            I was able to resolve it ! My bad that I missed a line in code , which i was supposed to comment out in display_message_activity.java

            setContentView(textView);

            //setContentView(R.layout.activity_display_message);

            after i commented above mentioned line, it started working just fine :) ..

            Thanks a lot for your time and help on this !! I really enjoy watching your tutorials :)

            Thanks
            Kuldeep

  29. GOM says:

    Hi Derek

    Thanks for your tutorial.

    I didnot get the reason you give View as input to the sendMessage method?
    What exactly view is here and how does it differ from context..

    • Derek Banas says:

      Hi,

      A View is a base class for most GUI components. A Context interface that provides access to the application. Sorry about any confusion that caused.

      • Meet says:

        So, the View object passed to the sendMessage() function is that of the button?

        Btw, thanks a ton for the awesome tutorials!

        • Derek Banas says:

          You’re very welcome :) A View is the base class for all components in Android. It is generic like Object is a base class of every other Object. The View being referenced here is the Button that was clicked.

  30. VictoR says:

    I copy and paste the entire tutorial, and I am getting an error message, after 4 hours of reinstalling eclipse 3 times, I just don’t know what the problem is. When I try to run the application I get an error messages telling me that ” R can not be resolved to a variable ” setContentView(R.layout.activity_main); It highlights in red the letter “R” can you tell me how to fix this please. the same message appears 3 times in my MainActivity.java file.. also appears in inflate(R.menu.main, menu); pls helppppppppp

    • Derek Banas says:

      This is a common error. There are a few ways to get rid of it.

      1. Make sure you delete any imports that look like the following in all the class files in your source directory : import android.R

      2. Make sure the file names in your layout folder are all lowercase

      3. Try deleting R.java in your gen folder

      After doing the above click Project -> Clean

      • VictoR says:

        Thanks For help. I follow the steps but I realized I don’t have a R.java in my gen folder. So the ” R canot be resolved ” message still appaears. Is there anyway to manualy bring that file. Since I have done this project 3 times and install eclipse 3 times, I feel I can not move to your next lesson.. Should I try Andriod Studio or Netbeans? or s ther any specific version od Eclipse that you recommend I have the Kepler version with all the updates.. please advise
        Thanks
        Victor

        • Derek Banas says:

          Hi Victor, Project -> Clean should generate it.

          Did you install the new Android Development Tools yet? It is very stable, but it sometimes requires you to downgrade to Java 1.6. I will upload a tutorial on how to install it either tonight, or tomorrow.

          Don’t use Android Studio, or NetBeans in my opinion because they are terribly buggy.

          • VictoR says:

            Thank you so much Derek, I use a different version of eclipse, and finally was able to finish this tutorial, I am exited to move on to the next. However, after I was able to run the program without getting the error message:” R cant be resolved”, The gen/R.java disappear from my folder and that error message came back resulting in me not being able to run the app. I feel maybe is my pc deleting the files.. But At least I know the code works but I can’t run it again due to this error message. is there any way I can make the file R.java come back to the gen/folder? or do I have to build the project form scratch again???

  31. kisnon says:

    how do i turn on the assist in eclipse you know that box that helps you with the library to show you what should or could be in the place that you are typing

    • Derek Banas says:

      Go to preferences, Java -> Editor -> Content Assist and edit the “Auto activation triggers for Java” field

      Type .abcdefghijklmnopqrstuvwxyz in “Auto activation triggers for Java” field

  32. HELP says:

    hi, derek banas PLEASE HELP ME how do i make a map to find churches?or any other place in android?

  33. ernie says:

    Because of your fine videos, I registered a developer account at the Samsung web site and started to pick up Samsung’s unique features.

    Many thanks for publishing and sharing your expertise. Please put my name in the hat for the Galaxy Note 3/Gears drawing.

    Have a great weekend.

  34. yang says:

    it is a great tutorial. thank you very much. but there is a little problem.
    Hierarchial Parent: com.newthinktank.firstapp.MainActivity
    I could not find this option, would you show me why?

    • Derek Banas says:

      Thank you :) When you are creating a new Android project you define the custom name. I use newthinktank because that is my website. It should be a unique name. You should define your own. The default is example.

  35. Talib says:

    Hey your tutorials are really awesome and up to the point..
    I am going in final year of Computer Engineering and planning to develop an android app in the final year, a wanted some suggestions for that..
    Few suggestions would be helpful..

    • Derek Banas says:

      Thank you :) There are so many different apps that you could make. What I’d do is look at what are the most popular apps on iOS that aren’t available on Android and make them. You’ll have to change them so you avoid copyright issues, but that is definitely a direction to go. I always learned best by trying to copy something that was already great. It gives you a clear final goal to aim for.

      I hope that helps
      Derek

  36. AndroidBeginner says:

    Thx very nice tutorials. I saw some of them.
    I think youd should mention at the beginning of the tutorial that this tutorial is not suited for Android Beginners, because you mostly go fast with the explanations and sometiome you don’t explain the code what’s happening. So if you are completely new to Android they can’t follow the tutorial, or the can follow by just typing your code but don’t really unterstand how it all work

  37. Aizel says:

    You are a Wonderful developer, thankx

  38. Ray Andrade says:

    1st Off.. Awesome job!!! Keep spreading the good word!!!

    I am using ubuntu 13.04 and out of the box I had a problem of resolving:

    import android.support.v4.app.NavUtils;

    but.. the was easily corrected adding a the jar file to the build library.

    Project -> Properties -> Java Build Path -> Libraries (tab) -> Add Jar..

    The .jar file is the one found at:

    [path-to-andorid-sdk]/extras/android/support/v4

    Just thought I would share..

    Again.. keep up the good work!!!!

    kindly Ray

  39. José says:

    Hi, I had to erase the

    AndroidManifest.xml is updated with the following by eclipse…

    In order to make it work, why?

    Thanks

  40. Prateek Senapati says:

    Very useful tutorial! I have one problem though. I followed all the steps here and I don’t have any errors also. My emulator is running with the app. I can enter any text in the textbox and I am being directed to the display_message page. But the message is not being displayed. I am just getting a blank page. Did I miss anything?

    Thanks!

  41. Mali says:

    Hi Derek,

    Can you explain why we use “com.example….”?

    public final static String EXTRA_MESSAGE = “com.example.myfirstapp.MESSAGE”;

    Thanks for everything

  42. Shirshak says:

    Hi, I love your tutorials. Really helpful.
    I was planning to start the android development tutorial while doing the java tutorial.
    When do you think I should start the android tutorial or should i complete all java tutorials?

  43. Leila says:

    Hi Derek,

    Thank you for the great tutorials. I have a problem with emulator. Whenever I try to run the MyFirstApp, in emulator it says “Process system isn’t responding” and in the Console it says”unable to install on the device”.

    Please tell how can I fix it?

    Thank you

  44. Kadeem says:

    Hi, I got an error saying ” Attribute is missing the Android namespace prefix”, on all the lines , im not sure where i went wrong. Please help if you can.

  45. Nasr18 says:

    Nice tut bro. Dude i wanna know how to make my stock rom(xolo q600) status bar to looks like samsung galaxy s4 status bar? pls say me step by step. i have little knowledge in android apk decompile and compiling. Looking for your reply.

  46. joe says:

    Please i beg show us how to pass an arraylist via json object using namevaluepair to a remote server.

  47. Michael says:

    When I create the new Activity, Android Studio tells me to sync the gradle files. When I do that, I get loads of errors in the DisplayMessageActivity.java file, it can’t find the R.java file and so on. Is this purely because of Android Studio? How can I mend this? Because I really want to use this instead of Eclipse. I’m using Android Studio 0.4.6 (19 February) on Ubuntu 13.10.

    P.S.: I truly love your videos, I think you’re awesome :D

    • Michael says:

      I’ve created a new project and carefully selected the right R file (from com.me.app, not from android.r) from the dropdown list (android studio auto imports everything) and now everything seems to be working. Sorry for bothering you for that!

      As I said before, you’re doing a truly awesome job and I can’t wait to get my first paycheck so I can “buy you a beer” :D

      • Derek Banas says:

        Great I’m glad you fixed it. No need to buy me a beer. Your appreciation is all that I require :)

        • Michael says:

          I know there’s no need to, I just want to :D I’ll probably be bombing you with questions in the upcoming weeks when I get into more advanced stuff (I’m just at tutorial 5 now), so I apologize in advance :)) and that’s not because you’re not a good teacher, but because I’m a very curious person :P

  48. Shiraz says:

    Hey Derek!
    Thank you for your awesome list of tutorials. I really appreciate what you do and like you style of teaching.
    I had one question in my mind – is it possible directly drag the textfield component into the activity form, edit its content and run emulator to test it? Or should I do all the revisions and string modifications in string.xml?

    Thank you.

  49. Zeev says:

    Hi Derek, Thanks for the amazing videos!
    i just started to learn, and i did eveything you said, but i get an error saying ” activity cannot be resolved to a type ” in the DisplayMessageActivity.java in the line where the code says ” case android.R.id.home:”

    Can you help me solf this problem please?

  50. ohad says:

    I tried the writing myself but eclipse has changed since you made this tutorial (fragment added and who knows what else)
    so it had many errors.
    now I tried copying and pasting everything from here, and the lower part of DisplayMessageActivity from line 82 is filled with errors

    starting here:

    AndroidManifest.xml is updated with the following by eclipse

  51. Jeff says:

    Mine does not display the message. I think it could be a problem with the Fragment display message.xml.

  52. Niels Batucan says:

    hi I started playing around with android now and I have a question about fragments

  53. Gulshan says:

    You are simply awesome..
    Great job..
    so many thanks for teaching us…

  54. Tiberio says:

    Dear Derek,
    Great piece of work. Great tutorial – it really helps.
    Thank you for sharing.
    Tiberio

  55. Yao says:

    Derek,

    could you please me how to debug an issue an app says “unfortunately the UI/App has stopped” (in either a real device or a simulator)? is there a tutorial that talks about it?

    I am using ADT v22.0.0-675183. Thanks.

    Thanks,
    -Yao

    • Derek Banas says:

      What error message do you see in the logcat panel in Eclipse?

      • Yao says:

        Hi, Derek,

        I don’t remember there was any useful message in the bottom panel in eclipse.

        unfortunately I have deleted the project. it was when I follow this tutorial of button send, with your fix for the fragment.xml problem, things seems a little weird, but it might also be some error caused by me.

        I was wondering whether there’s any possibility for in-circurt debugging so that when it crashes, we could get an core dump or call stack or something, but I didn’t find any. maybe it is not possible.

        I am now try to follow the android website tutorial and do this all over again.

        thanks,
        -Yao

  56. Justin says:

    Hello. In my Manifest.xml, there is an error “The markup in the document preceding the root element must be well-formed.”

    What does this mean?
    On Eclipse, the error appears on line one
    <<<<<<< Original

  57. jp says:

    It would be nice to edit the text after the save.

    In Ubuntu I can not get the Emulator to work because it won’t intall the Libraries, running 64Bit

  58. Derek Banas says:

    What chip set do you have Amd or Intel?

  59. copernicus says:

    Hello,

    Intel, but I re-installed Windows tried other IDEs. And then the projects started to work under Android Studio.

  60. Derek Banas says:

    Feel free to use Android Studio with this tutorial. It is almost exactly like Eclipse

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Google+