How to Make Android Applications

How to Make Android Applications

The way of making the following application is based on the experience of friends and myself. So, please pay attention and read carefully at the following stages of creating an Android application.

Each technology platform has its own characteristics and terms. Call it "android application" which consists of Activity, Context, and Intent. Actually there are other components that are more sophisticated and difficult to explain. But for now these three components are the most important that you need to know. Because these three components are in every android application. In this article, you are expected to be able to understand how Android applications are made, tips and tricks on how to handle application debugging using very helpful classes.

You need to know that an android application consists of several "tasks", usually programmers call it an activity. Each activity has a different purpose and relationship from other activities. You might understand better if you've played the game Chippy's Revenge.

Design application features

Game Chippy's Revenge has a design that is divided into 5 screens:

  • Splash - The initial screen / screen called the startup screen. Usually contains the game logo, version and opening music.
  • Menu - Display when the user can select several options, including "play", "score", or "help" option.
  • Play - This is where our game looks.
  • Score - If selected, it will display the highest score
  • Help - Options / help screens that will explain how to play, how to control, how to score, and possibly tips and tricks.
Beginning to understand? This is the prototype of how to make an android application, especially a game application. Almost all game applications have 5 screens / views above.

You can freely add or remove these screens. There are no special requirements for an android application user interface. The most important thing is that the application must be stable, responsive and can be played smoothly. For example, just look at the Flappy Birds game.


Determine the required activity

You will need at least 5 activity classes for the game Chippy's Revenge, including:
  • SplashActivity - In short, this activity will display a "layout" (maybe an image), short music for a few seconds, then enter MenuActivity.
  • MenuActivity - This activity is simple, there are only a few buttons ready to be pressed. Each button has the syntax onClick () which will trigger the next activity.
  • PlayActivity - The life of a game application, you need to draw (draw) several objects on the screen, handle various input from the user, save the score, and create the desired game flow.
  • ScoresActivity - It's pretty simple in content, like SplashActivity. Later it contains the score information that you will create with the TextView syntax in a Layout.
  • HelpActivity - Almost the same as ScoreActivity, but the score information is replaced with help information. Remember, the TextView syntax must have scrollability.

Each Activity class must have a layout file stored in application resources. To save app size, you can use the same layout for ScoreActivity and HelpActivity. The following is an overview of the flow of our game application.

Implementation of functions in the application

We have discussed the activity that we are going to create. Create resource files for each activity separately (except ScoreActivity and HelpActivity). Resource files can be background images, music, or other image objects. Group in 1 folder.

Once finished, you will definitely ask "OK, we already have a resource file, then how do I control the flow of the application?" How do I make settings on each object? how do you move from one activity to another? "

By continuing to think about the flow of the game application, now is the time to implement in detail how to create an android application. To start with, use Context.


Using Context on android applications

Context is a place where you can control all the top functions of an application. You can use context to access settings and resources between activity instances.

How to use the following syntax:
Context context = getApplicationContext ();

You need to know that the Activity class is a derivative of the Context class, so you can use the Activity class instead of having to explicitly use the context. If you only use context in every case, then you will run into memory leaks issues. There's one great read on memory leaks from the official android blog post.

Create a valid context for the application, and use it to access features and services.

Sorry, readers. Because there is one thing and another reason, our discussion about how to make an android application - series 1, we have finished here first.

إرسال تعليق

Post a Comment (0)

أحدث أقدم