Five things you must know before developing the first Android Application, Android five.

Source: Internet
Author: User

Five things you must know before developing the first Android Application, Android five.

I recently read a Post published by Praneeth VT on Reddit about how he developed his first Android mobile app, a GPA calculator. It can be seen that he is still a newbie in this programming world, so I want to explore in depth how he did it so that you can learn and learn from it.

Before that, I would like to introduce Praneeth VT first.

  • Graduated from Computer Engineering
  • In fact, he only learned a total of six months of programming classes.
  • After two introduction courses to CS, he learned the Java language again.
  • During the summer vacation, he decided to apply what he had learned and develop his own Android app.

I had a conversation with Praneeth VT about how to set sail in the field of Android applications. Below I sorted out the conversation content (the question is in bold italic ).

Finally, I have summarized five basic skills that are extremely important to new users.

Can you elaborate on the skills and programming languages used in every stage of the Android application development process?

Building an Android Application can be attributed to two main skills/languages: Java and Android. Java is a general programming language for Android, but Android also includes learning the XML language used for app interface design, learning Android concepts, and using these concepts from the Java programming perspective.

After learning Java and XML, connect the two with the Android concept.

I also shared some Android-related knowledge about Activities and Fragments in Reddit. My favorite book is the Big Nerd Ranch series, because when we encounter problems in the development process, we can be inspired in the book to find the answer.

If a beginner wants to develop an Android app, what should he learn first? Do you have any suggestions?

For a beginner, I suggest learning Java. Don't think about shortcuts. Java is a must.

In addition, I recommend a video tutorial on YouTube to learn how to install Eclipse (integrated development environment for Java Development) and the basic methods of Java Development Kit (JDK. This also helps you understand the basic methods of Java development, such as loop statements and if statements.

However, after completing these foundations, I strongly recommend that you discard the YouTube video tutorials and turn them to books and series of lectures. YouTube tutorials often do not focus on some important concepts. I think they are 100% important for programmers who want to develop Android applications.

What is Eclipse and Android Studio? Do Android applications not have to be developed?

Android Studio and Eclipse are Integrated Development Environments (IDE ). Of course, you can also use other tools to write Java, but because I am not familiar with those, it is not recommended at will.

Unlike other applications, you need to write code to compile and run code. You only need to click a button to compile the code in IDE. However, you have to install the Android SDK in Eclipse, and all the installation processes can be found on the specialized Android development website.

How much time do you spend programming every day/week?

It took me almost two months to complete my first app.

At the beginning, it took more than four hours to go to Big Nerd Ranch every day and then perform exercises based on the tutorial. When I really start writing a program, even if it is to solve a small problem, such as storing data, I have to spend a lot of time to fully understand.

However, I spent a lot of time, because I was in the summer vacation and had nothing to do.

What do you do if you have to seek help and ask questions?

I usually use Google to search. But because I am a newbie, it takes me a lot of time. The best choice is to go to Stack Overflow. If Stack Overflow still fails to give a clue, I will post on/r/androiddev Subreddit on reddit. Community members are usually very enthusiastic.

We are very grateful to PraneethVT for providing his unique insights on how to build the first Android app. Below I will summarize,

Five things you need to know before developing the first Android Application:

Do you have anything to add? Welcome to your comments.

Original article: learntocodewith. me Translation: codeceo-Xiaofeng


What should I do before developing a game for Android?

Android is a Java-based environment. This is good news for beginners, because compared with C ++, Java is widely regarded as a more easy-to-use language, and it is the specification of mobile development. Google has also done a great job in documenting the API and providing sample code for use. An example called API Demos shows the functions of almost all APIs. If you are familiar with Java and have used Eclipse, it is quite easy to run your first application. If you have never written code before, you still need to learn a lot on your way forward, but don't be discouraged.
The first step to get the SDK is to get the Android SDK (software development kit ). The SDK contains a core class library, a simulator, some tools and sample code. I strongly recommend using Eclipse and Android Eclipse plug-ins. If you are playing Android, Eclipse IDE is very useful for Java developers. If this is the first time you develop a Java project, you may need to download the full set of JDK, which includes some tools for signing and deploying your application.
Learning the application architecture doesn't rush into the ocean of development. It is important to understand the Android application architecture. If you don't learn it, it will be difficult to debug the game you have designed online. You will need to understand Applications, Activities, Intents, and how they interact with each other. Google provides a lot of useful architecture information. What really matters is understanding why your game requires more than one Activity, and what is the design of a game with a good user experience. To understand this, you must first understand what is the Activity lifecycle.
Learning Activity lifecycle is managed by the Android operating system. Your activity creation, recovery, suspension, and destruction are all controlled by the operating system. It is important to correctly handle these events so that the application can perform well and do what the user thinks is correct. It is good to know how all of this works before you design your game, because you can save debugging time and expensive redesign time for yourself in the future. For most applications, the default settings will work normally, but for games, you may need to consider opening the SingleInstance flag. When it is set to the default value, Android will create a new activity instance when it deems it appropriate. For a game, you may only need an instance of a game activity.
Depending on the type of game you write, you may or may not need a primary loop. If your game does not rely on time or it only responds to what users do, and does not make any visual changes, it will always wait for user input, then you do not need the main loop. If you are writing a primary game or a game with an animation, timer, or any automatic operation, you should carefully consider using the main loop.
The main cycle of the game generally reminds the sub-system to run as many "tick" messages per second as possible in a specific order. Your main loop needs to run in its own thread because Android has a main user interface thread. If you do not run your own thread, the User Interface thread will be blocked by your game, which will cause the Android operating system to fail to update tasks normally. The execution sequence is usually as follows: Status, input, AI, physical, animation, sound, and video.
The Update Status indicates the Management Status transition, such as the end of the game, the choice of characters, or the next level. In many cases, you need to wait for several seconds in a certain state, and state management should handle this delay and set it to the next state after the time has elapsed.
Input refers to any key that the user presses, the movement of the scroll bar, or the user's touch. It is important to handle this before processing physics, because input affects the physical layer in many cases. Therefore, first processing input will make the game more responsive. In Android, input events come from the main user interface thread, so you must write code to put the input into the buffer, so that your main loop can get it from the buffer zone as needed. This is not difficult. First define a domain for the next user input, and then set the onKeyPressed or onTouchEvent function ...... the remaining full text>

What is the general idea for developing an Android application?

Think about what you want to do, what kind of interface you need to fill in your data, and then the layout and appearance. Finally, it is code implementation.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.