In 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>
You are a star..Great Job on all these tutorials…
Thank you very much 🙂
Excellent .. thanks..
When is your next Android tutorial ?
I’m uploading it today. I’ll cover a bunch of technical things so I can get them out of the way and then just make apps in every other tutorial that follows.
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
Thank you very much 🙂 I will do my best to teach everything. This tutorial will be really fun for me to make. May God bless you and your family as well.
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.
Thank you very much for the nice message 🙂 I do my best to improve on each tutorial series. I’m very happy more people have been watching them
i am geting this as error
“editmessage cannot be resolved or is not a field”
what to do .plz help???
Did you copy the code I provided?
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.
Are you using the code that I supplied?
Hey Derek, can one copy the code without the numbers at the left?
Yes put your mouse over the right hand corner of the code box and 3 icons show. Click the first that says view source.
Thanks!
You’re welcome 🙂
The R.java seems to be missing in my project. How can I fix it? thank you.
Make sure you created an Android Package. It will show up. Don’t touch it. It updates all on its own
This is the most powerful and clear tutorial I have seen. Thanks…
Thank you 🙂 You are very welcome.
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?
Thank you very much 🙂 Yes you need to understand the basics of java. Here is my Java Video Tutorial. All you need to watch are parts 1 through 17. Feel free to skip parts 8 and 10 as well. Feel free to ask questions
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
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!
Great tutorials TYVM
Thank you very much 🙂
What OS platform are you using?
I have a Mac, but I duel boot Windows 7 as well
also under Hierarchial Parent there is nothing to choose..
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
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.
“
Here are a bunch of fixes for that http://stackoverflow.com/questions/7222906/failed-to-allocate-memory-8
I hope that helps 🙂
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
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
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
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 🙂
Amazing tutotral, so intuitive to follow and very sound and clear.
Apsolutely great!
🙂
Thank you very much 🙂
Emulator doesn’t load when i press the play button thought it does load when you do it throught the setting method
Yes I always use the run configurations to run
DO you have videos which shows have to add buttons and text boxes have to changes colours and ETC
I haven’t covered how to make advanced interfaces yet. I’m waiting to cover the basics first, but I’ll get to it.
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!
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
great job sir !!!!!1
tell me….list of the java concepts,..one should know…to basically understand these android tutorials…..
thnkiewwww veryyy much 🙂 🙂
Thank you 🙂 I have all my Java video tutorials here. If you watch parts 1 through 19 (minus 8 and 10) you’ll be ready to go with Android. I hope you enjoy them.
Hey Great job…
Good to have subject commander leading the way 🙂
god bless you…
Thx
S
Thank you very much 🙂 May God bless you and your loved ones as well.
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. 🙁 🙁
What error message is it giving you?
I have the same problem. It appears that edit_message cannot be resolved or is not a field.
What Can I do?
Compare the code I have on this page to your code using DiffNow and you’ll find the error. Tell me if that doesn’t work.
My code is the exact same as yours, copy pasted to make sure, but edit_message seems to not be resolved. Maybe my generated R file is different from yours?
I have the package file available for download. If you are having trouble with the r file part 26 of my android tutorial shows how to update to the newest version of eclipse.
Thanks. I ended up just following the official android tutorial and it somehow fixed the problem. I appreciate your quick reply!
Great I’m glad you fixed it.
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.
Thank you 🙂 I’m very happy that you enjoy the videos
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.
Thank you for taking the time to me you found the videos useful 🙂 I greatly appreciate that. I have videos planned for many years, so many more are coming.
Thank you very much really helpful clear tutorial
your videos are amazing!!!
Thank you 🙂 You’re very kind.
Absolutely great!!!
voice is clear and understand your every code very clearly…
Thanks for your tutorials i am gonnna build my first app soon.. 🙂
Thank you very much for the kind compliments 🙂 They are very much appreciated!
hey i have done all the things but still app is not running
What errors are you seeing in the LogCat panel in Eclipse?
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
I’m sorry, but I don’t understand what the error is?
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 !
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
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.
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
Great I’m glad you fixed it. Sorry if I didn’t point that out better.
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..
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.
So, the View object passed to the sendMessage() function is that of the button?
Btw, thanks a ton for the awesome tutorials!
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.
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
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
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
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.
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???
Great I’m glad you figured it out. I now use Eclipse Kepler. All I needed to do was downgrade to Java 1.6 and I haven’t had an error yet 🙂
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
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
hi, derek banas PLEASE HELP ME how do i make a map to find churches?or any other place in android?
The very next video after I’m done with the Samsung apps will be on Google Maps
thank you very much i will need it for my final project!
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.
Thank you 🙂 I wish you the best of luck in the contest.
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?
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.
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..
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
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
Yes I agree this definitely requires knowledge about Java. I will be making a beginning Android developer tutorial soon.
You are a Wonderful developer, thankx
Thank you very much 🙂
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
Thank you for helping others 🙂 Much appreciated
Hi, I had to erase the
AndroidManifest.xml is updated with the following by eclipse…
In order to make it work, why?
Thanks
The Manifest isn’t always updated on its own some time.
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!
Thank you 🙂 Make sure you change the text in the display_message tags in the file named strings.xml
Hi Derek,
Can you explain why we use “com.example….”?
public final static String EXTRA_MESSAGE = “com.example.myfirstapp.MESSAGE”;
Thanks for everything
I use com.newthinktank….. because I own the domain. That makes it unique so I will cut down on potential conflicts with other classes.
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?
Thank you 🙂 You don’t need all the Java tutorials. If you watch 1 – 18 ( Minus 8 and 10 ) you’ll learn most everything you need. You may also prefer to better understand OOP by watching the first 2 videos in my design patterns video tutorial. Since everything in Android is based on MVC you may also benefit from watching my MVC video tutorial. I hope they help 🙂
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
Check out my new tutorial on how to install the new Android tools. That should fix it.
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.
Make sure you have android:id instead of just id in your layout file.
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.
Thank you 🙂 I’ll cover widgets soon. These are the tools I use to decompile APKs JD GUI, apktool and Dex2Jar. It is rather easy
Please i beg show us how to pass an arraylist via json object using namevaluepair to a remote server.
I’ll be covering web services very soon in my App Inventor tutorial.
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
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” 😀
Great I’m glad you fixed it. No need to buy me a beer. Your appreciation is all that I require 🙂
I know there’s no need to, I just want to 😀 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 😛
Thank you 🙂 Feel free to ask questions. I do my best to answer them all. I was very sick this weekend, which is why it took me a while to get back to you.
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.
Thank you 🙂 Yes you can definitely do that, but it is preferred to use string.xml.
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?
Hi, This is normally solved by clicking Help -> Check for Updates in Eclipse. If that doesn’t do it check your code against mine with DiffNow.com.
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
I made an updated tutorial on the tools that I now use here. If you use those tools everything should work. I just tested a few apps to make sure. i hope that helps
Mine does not display the message. I think it could be a problem with the Fragment display message.xml.
I finally got it going by using your tutorial. For some reason it didn’t work using the android developer website. I thought it might not work because there were some differences in the code but figured it out.
Great I’m glad to hear that you got it working 🙂
hi I started playing around with android now and I have a question about fragments
Feel free to ask anything
You are simply awesome..
Great job..
so many thanks for teaching us…
Thank you 🙂 I’m glad you found it useful.
Dear Derek,
Great piece of work. Great tutorial – it really helps.
Thank you for sharing.
Tiberio
Hi Tiberio, Thank you for the nice compliments 🙂 You are very welcome.
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
What error message do you see in the logcat panel in Eclipse?
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
Hi Yao,
Yes there are a few apps that provide access to the log files for errors. The first that comes to mind is LogViewer. I hope that helps 🙂
Thank you Derek, very helpful info! -Yao
you’re very welcome 🙂 Thank you
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
Did you copy and paste my code? That is a generic error that means the xml has an error. Make sure you close all your tags.
Hi Derek,
I just wanted to thank you very much!!! I am so happy that there are people like you!!! God Bless You!!! Live long and happy life!!! Everybody should learn from your deeds =)
Hi Sake, Thank you for the kind message. Many more videos are coming. May God bless you as well.
Hi Derek, I built an android program from scratch with the aid of your second tutorial, but this program won’t run, my IDE couldn’t detect any errors in my code, yet I get an X sign on the project but not on any other files in the project, my Main.java is OK, so is Main.xml and string.xml, but this program just won’t work, it keeps telling me whenever I try to run it, your project contains error(s), pls fix them before running application, this is so annoying, pls help. Thanks
There should be red dots on the right side of your screen. That is where the errors are.
There are no red dots there, I corrected all of them and they all disappeared before I ran the program, I can’t see any signs of an error, but the problem persists.
Take a look at part 26 of this tutorial series. You may have an installation issue.
Thank you for the great tutorials Derek. Please would you tell me how to generate numbered source code like yours on eclipse?
You’re very welcome 🙂 Preferences -> Editors -> Text Editors Check Show Line Numbers