简体   繁体   中英

My first android app

I am building my first android app, and I am a bit confused with the Datepicker function. I am following the tutorial on http://developer.android.com/resources/tutorials/views/hello-datepicker.html on the third step they are requesting to use a java file. I found the source code, but in which directory do I store this java file? is it in the res/values folder?

Your Java source files are stored below the folder "src" according to your package name which you specified when creating the project. Just follow the folders under src to the bottom one and put your Java files there.

The file DatePicker.java belongs in the src folder, because it's an actual Java source file.

The code sample that's given belongs inside the class DatePicker , since it defines private members for that class. If that's something you don't really understand, you might want to spend some time learning Java before jumping right into Android development. Take a look at The Java Tutorials for the basics. You could also check out mobiletuts+'s Java for Android tutorials to get right into Android as you learn.

There are lots of reasons why you might want to write an Android app. Maybe you have a great idea and you want to build a prototype, maybe you just want to learn to program for Android, maybe it is part of a school or college course, or maybe you are just curious. Whatever the motivation, building Android apps can be fun and rewarding.

Building an Android app comes down to two major skills/languages: Java and Android. Java is the language used in Android, but the Android part encompasses learning XML for the design of the app, learning the concepts of Android, and using the concepts programmatically with Java.

Once you learn Java and XML (XML is really easy to get used to, and you should learn the language as you program your app rather than learning it beforehand like you would with Java), you need to learn how to connect these two using Android principles.

THINGS TO KNOW BEFORE BUILDING YOUR FIRST ANDROID APP:

  • You need to learn Java, there is no way around it
  • Android part encompasses learning XML for the app design, understanding concepts of Android and using said concepts programmatically with Java
  • Beginners should probably use an IDE
  • Building your first app is time-consuming: it won't happen overnight. This is not a project for those looking for a fast result
  • When stuck on a problem (which will inevitably happen), turn to Stack Overflow. If no luck there, look to the Android Subreddit where there is a helpful community

I think that information might help you out. If you want to get more detailed information, just visit this blog " Easiest way to learn Android App Development ".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM