Think of the first day I wrote a simple four operation of the scenario: I think of the process that caused us to iteratively develop the background is: two pillars to accept the teacher assigned to the task of the child, each need to set a question for the child task, generate the corresponding primary computing problems, so we face the needs of customers are pupils, So we need to satisfy the arithmetic of integer and true fraction. After continuous development of my team and my teammates, I experienced several changes in C + + because the language I was most familiar with was C + +, and I used this iterative development to make a randomly generated mixed equation with parentheses. And can judge the user result input, however unfortunately two pillars need to find a feasible way to develop to publish, so I C + + written command box input interface is not very meet the requirements, the problem comes, and my hands only Java , I had to start turning Java Development mode.
My starting point is to make a simple web version of the system, but in the feasibility analysis found that the following points:
1. After the webpage is written, it is difficult to achieve a better effect, such as: interface design, and user interaction, after all, is just a simple application of generating problems, so it is difficult to display the advantages of the Web page.
2. Web page in the implementation of technology, there are a lot of technology can choose, such as in the choice of action to produce a problem, and then write the answer to enter the database, select a lot of Web page technology, it is not conducive to judge what method of development can better achieve the goal.
In addition to the above reasons, and this semester was fortunate to choose mobile application development, can have the basis to implement a simple app , so I temporarily choose to use Android for development.
But in fact, this is still a stones process, after all, their level of feeling is HelloWorld start stage, but I am not afraid, after all, there is no progress without challenges.
Today I am still very happy to finish Android version V1.0, because I found that I have the basic knowledge of Java , but also not weak case, the feeling of getting started quickly, but also not without problems, Here is a summary of some of the knowledge and issues I have encountered:
function to generate random numbers
I personally feel that with C + + will not be much different, but looked at the internet, feeling again educated.
1. Generate a random number function random () generates randomly within the specified range (a~b)
Math.random () *b+a
and the time function of a custom system.
As the default number of milliseconds for the current system time as a seed number of random r=new random ();
2. Layout method
In fact, the way the layout is still with java The way is very similar, I basically through the linearlayout linear layout, and then add some buttons or layouts to the layout to make complex graphics, and the way to load the layout is basically through the id to control, while in the android anctivity android activity setcontentview () setcontentview (r.layout.first_layout);
After this it is easy to forget to write activity to androidmainfest, in fact this is very important, here the configuration will determine your software layout display order.
3. using Toast in activity
This is a mechanism that android uses to alert users by toast. First you need to define a popup Toast Trigger Point, just have a button on the interface, then we let click on this press
button to pop a Toast . Add code in the onCreate () method.
A toast is very simple to use, creating a toast object from a static method Maketext () and then calling Show ()
The Toast will be displayed. It isimportant to note that theMaketext () method needs to pass in three parameters. First
parameter is the context, which is what the toast requires, because the activity itself is a contextual object, so
Here, you can pass directly to Firstactivity.this. The second argument is the text content of the toast display, and the third argument is the toast
The length of the display, there are two built-in constants can choose Toast.length_short and Toast.length_long.
I have a reference to write a very good blog (we can refer to the reference)
Http://www.cnblogs.com/renqingping/archive/2012/09/24/Toast.html
4. About LogCat
Believe that a lot of people like me are accustomed to C + + or java are accustomed to print logs with the output to see the errors are seen in the console, but Android to improve, through A variety of information in the log print program. I was simply looking at Logcat, where my code error was found in the last caused by.
Now that's written so much, as the next stage of the sprint, I will continue to update the entire project process. The following is a simple (not yet interface) to run the software.
One small step in the day, a big step in the month ~ refueling
Android Random operator Development Summary 1